Added pricing to quickedit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/*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('.custom_field_demo', '.inline-edit-row').show();
|
||||
} else {
|
||||
jQuery('.custom_field_demo', '.inline-edit-row').hide();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user