Home › Forums › ACF PRO › ACF in jQuery function › Reply To: ACF in jQuery function
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?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.