WP + ACF How to retrieve data in front end product page
-
Hi there,
As it said in the title I’m trying to retrieve the data from my ACF’s fields.
Better than an explanation, please see the following screenshot:
So as you can see I’ve created under my attribute ‘*pa_size*’ the 2 following text fields: **uk-size** and **us-size**.
Which is giving the following result in my Products->attributes backend:
Until there, everything’s ok but the next step is to retrieve these data to the following single-product **(variable)** screen:
I tried with this documentation from ACF to do it but impossible. I also tried to place different part of code under */public_html/wp-content/themes/atelier-child/woocommerce/single-product/add-to-cart/variable.php* but no way to figure it out. It’s been days I am struggling on it and it’s driving me super crazy.
I would like if I click on “UK” or “US” to display sizes like on this link.
If anyone could help even just a little bit, I would be really grateful!!
Thanks in advance guys.
[1]: https://i.stack.imgur.com/rJ5ja.jpg
[2]: https://i.stack.imgur.com/qqxci.jpg
[3]: https://i.stack.imgur.com/24f6T.jpg
[4]: https://www.advancedcustomfields.com/resources/code-examples/
[5]: https://www.sneakersnstuff.com/en/product/26308/nike-air-zoom-talaria-mid-fk-premium
- The topic ‘WP + ACF How to retrieve data in front end product page’ is closed to new replies.