32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
/*global inlineEditPost, woocommerce_admin, woocommerce_quick_edit */
|
|
jQuery(function( $ ) {
|
|
$('#the-list').on('click', '.editinline', function(){
|
|
|
|
/**
|
|
* Extract metadata and put it as the value for the custom field form
|
|
*/
|
|
inlineEditPost.revert();
|
|
|
|
var post_id = jQuery(this).closest('tr').attr('id');
|
|
|
|
post_id = post_id.replace("post-", "");
|
|
|
|
var $cfd_inline_data = jQuery('#package_additional_fields_inline_' + post_id),
|
|
$wc_inline_data = jQuery('#woocommerce_inline_' + post_id );
|
|
|
|
jQuery('textarea[name="_package_pricing"]', '.inline-edit-row').val($cfd_inline_data.find("#_package_prices").text());
|
|
|
|
|
|
/**
|
|
* Only show custom field for appropriate types of products (simple)
|
|
*/
|
|
var product_type = $wc_inline_data.find('.product_type').text();
|
|
|
|
if (product_type==='bundle') {
|
|
jQuery('#wiaas_pricing_quick_edit', '.inline-edit-row').show();
|
|
} else {
|
|
jQuery('#wiaas_pricing_quick_edit', '.inline-edit-row').hide();
|
|
}
|
|
|
|
});
|
|
}); |