Hi Caleb,
thanks for the answer!
Do you have any reference to write my javascript to work along side the main script?
Actually, I only need to make a little customization on WooCommerce Product Bundle extension. The file is add-to-cart-bundle.js and I think it’s not a good idea to dequeue the whole original Javascript file and replace it with a new customized file.
I just need to make a little modification on this function:
/**
* Formatted bundle contents for display in Composite Products summary views.
*/
this.cp_get_formatted_contents = function(component) {
var formatted_contents = '',
bundle_qty = component.get_selected_quantity();
$.each(this.bundled_items, function(index, bundled_item) {
if (bundled_item.$self.hasClass('bundled_item_hidden')) {
return true;
}
if (bundled_item.$bundled_item_cart.data('quantity') > 0) {
var formatted_item_title = bundled_item.$bundled_item_cart.data('title'),
item_quantity = parseInt(bundled_item.$bundled_item_cart.data('quantity') * bundle_qty),
formatted_item_quantity = item_quantity > 1 ? '<strong>' + wc_composite_params.i18n_qty_string.replace('%s', item_quantity) + '</strong>' : '',
formatted_item_meta = wc_cp_get_variation_data(bundled_item.$bundled_item_cart.find('.variations'), true);
formatted_item_title = wc_composite_params.i18n_title_string.replace('%t', formatted_item_title).replace('%q', formatted_item_quantity).replace('%p', '');
if (formatted_item_meta) {
formatted_item_title = wc_composite_params.i18n_selected_product_string.replace('%t', formatted_item_title).replace('%m', '<span class="content_product_meta">' + formatted_item_meta + '</span>');
}
formatted_contents = formatted_contents + '<span class="content_bundled_product_title content_product_title">' + formatted_item_title + '</span>';
}
});
return formatted_contents;
};
Thanks!