Hello L&L Community,
I’m working on a WooCommerce single product page and I’m trying to dynamically display both WooCommerce product attributes (taxonomies) and some custom fields (ACF fields) using Loops and Logic. I’ve been following the documentation, but I’m running into an issue where the data isn’t being pulled correctly.
What I’m Trying to Achieve:
- Display WooCommerce product attributes like Vehicle Type, Body Style, Fuel Type, and Warranty (these are custom attributes stored as taxonomies like pa_vehicle_type, pa_fuel_type, etc.).
- Display ACF fields like Model Name, Top Speed (km/h and mph), and others.
- Display the brand (stored in a custom taxonomy “brand-product”).
Here’s a screenshot showing the static content that I’m trying to replace with dynamic fields from Loops and Logic:
And here’s the URL of the specific product page I’m working on:
The Code I’m Using:
The Issue:
- None of the fields or attributes are displaying on the product page.
- I’ve used post=“current” in the loop to target the current product, but it doesn’t seem to work.
- I’m unsure if I’m calling the WooCommerce attributes (like pa_vehicle_type, pa_fuel_type) or custom taxonomies (like brand-product) correctly in Loops and Logic.
What I Need Help With:
- How do I properly query and display WooCommerce product attributes (which are taxonomies like pa_vehicle_type) using Loops and Logic?
- Is there a better way to ensure the loop is targeting the current product on a WooCommerce single product page?
- How do I correctly display custom taxonomies like brand-product within the loop?
Any assistance or insights would be greatly appreciated.
Thanks in advance,
Matt