so, i have fields in the products i want to show on the site.
The problem is that I have to use jQurry because of the dynamic display.
I tried to test in the console like this first, but I can’t get the values
function action_wc_before_single_variation() {
?>
<script type="text/javascript">
(function($){
$('form.variations_form').on('show_variation', function(event, data){
console.log( data.variation_id ); // The variation Id <=== <===
console.log( data.variation_description ); // The variation description <=== <===
var field = acf.getField('fork_model');
console.log( $field );
});
})(jQuery);
</script>
<?php
}
Am I wrong somewhere?
Hi,
How do I display this fields on a website? When the customer selects his variation (size, color …) to display those fields for that variation?