Last active
June 21, 2025 02:02
-
-
Save rajeshsingh520/fabc1f001508f78086c3c48b1de8668a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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