Skip to content

Instantly share code, notes, and snippets.

@rajeshsingh520
Last active June 21, 2025 02:02
Show Gist options
  • Save rajeshsingh520/fabc1f001508f78086c3c48b1de8668a to your computer and use it in GitHub Desktop.
Save rajeshsingh520/fabc1f001508f78086c3c48b1de8668a to your computer and use it in GitHub Desktop.
add_filter('pisol_enq_show_variation_for_simple', '__return_true');
add_action( 'wp_enqueue_scripts', function () {
$js = "
jQuery(document).on('pi_add_to_enquiry_data', function(e, data) {
if (jQuery('.woosb-products').length == 0) return;
jQuery('.woosb-products .woosb-item-product').each(function() {
var name = jQuery(this).data('name');
var val = jQuery('select', this).val();
if(jQuery('select', this).length > 0){
if(val){
data['variation_detail'][name] = val;
}
}else{
if(!val) val = ' ';
data['variation_detail'][name] = val;
}
})
});
";
wp_add_inline_script('jquery', $js, 'after');
}, 100 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment