Plugin do WooCommerce para criação de combos de produtos.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 lines
811 B

(function( $ ) {
'use strict';
$(function() {
$(document.body).on('change', '._wc_cdp_bundle_product_select', function() {
console.debug('select triggered');
if ( ! $( this ).closest( '._wc_cdp_bundle_product' ).is( ':last-child' ) ) {
return;
}
console.debug('after return check');
var container = $( this ).closest( '._wc_cdp_products_container' ),
index = container.find( '._wc_cdp_bundle_product' ).length,
row = container.data( 'row' ).replace( /\[99999\]/g, '[' + index + ']' );
container.append(row);
$( document.body ).trigger( 'wc-enhanced-select-init' );
});
$('._wc_cdp_bundle_product_remove').click(function(event) {
event.preventDefault();
$(this).closest('._wc_cdp_bundle_product').remove();
});
});
})( jQuery );