Hi, {{first_name|friend}}. 👋

Welcome to Issue #182 of Loop WP!

Last week, it was about a new Address AutoComplete feature in WooCommerce 10.3, and I had a go at extending it!

This week, it’s a quick WooCommerce tutorial on a common feature I use for my Shopify clients, plus some bonus code!

Let’s go! 👇

Checkout Summit 2026

Checkout Summit is the independent WooCommerce conference where developers, agencies, and product builders gather to share insights, innovations, and strategies.

Attend, and you won’t leave without ideas, connections, and tactics that can earn back your investment, fast.

Setting the Context

🫠 Shopify has accordions as standard for PDPs (“Product Detail Pages”), and WordPress core is finally getting them.

The cool thing about these accordions in Shopify is that you can hook up dynamic data and use them on all product pages (with a single template), and some JavaScript to conditionally hide the accordion rows that don’t contain any data.

You don’t want PDPs with accordion rows and no data; that’s a poor user experience, so hide them.

You can do the same with WooCommerce as I recently had to do for a client. 👇

Product Accordions for WooCommerce

💡 The free version of ACF was used to create field groups for the dynamic data and add them to the product admin screen for this client.

The client uses Elementor on their website, so we use the Elementor Nested Accordion widget for the PDPs. **

This widget is great, as you can put pretty much anything in it, including videos, which look great in accordions.

** (You need the Pro version to use dynamic data from custom fields and post types. If you are not using dynamic data, you should be able to use the free version of Elementor.)

Hiding Empty Accordion Rows

This is the crucial bit! We then use this code snippet to hide any accordion rows that contain no content.

Why is that important?

  • It means you could reduce the number of product templates (or even use just one) based on the needs of your WooCommerce PDPs.

  • Users get a better experience because empty accordion rows are hidden, preventing customers from getting confused by empty or “missing” content.

  • As a store owner, you can easily add different content to different products and know that only the relevant data is displayed on the frontend.

💡 The code can be added using the Elementor Code Editor (if you are using the Pro version of Elementor), a custom mu-plugin, the functions.php file or a free plugin like Code Snippets.

🚨 You don’t have to use Elementor; there are plenty of WordPress accordion solutions, including page builders and plugins, but you will need to tweak the original code.

The ACF Field Groups

I’ve included the ACF JSON file in the Gist. I’ve designed the Field Groups to be as compact in the backend as possible.

The toggles allow the content editors to be hidden by default, taking up as little space as possible in the WooCommerce product admin.

🚨 A quirk I discovered along the way is the structure of ACF fields and how Elementor can’t see supported fields if they are not “flat”.

Instead of toggles, I wanted a tabbed layout in the Product admin screen, but Elementor was having none of it! 🫠

For Elementor compatibility, you can’t wrap your flat fields inside a true ACF Group or Tab layout (because Elementor loses visibility to subfields in ACF Free).

Feedback

I hope you found this tutorial/code helpful, {{first_name|friend}}, and I’d love to get your feedback for future content. 👇

Do you want more Custom Code & Tutorials?

Let me know if you want more or less newsletter like this.

Login or Subscribe to participate

🐌 It’s been a long time since I’ve made a tutorial for WooCommerce.

The last time was when this newsletter was called “WordPress Wednesdays”, and I coded a solution to make “Featured Products” sortable in the Product Admin screen.

That was back on May 31st, 2023, wow! If you don’t want to read about the code and why I created it (along with another solution), you can jump straight to the code (it still works).

Before You Go

WooCommerce is now seeking testers for the WooCommerce MCP Beta. You can find out more information on the developer blog, and make sure you check out the video below. 👇

That’s it for this week! 👋

Sponsorship Opportunities

🚨 The Google Doc contains all the details if you’re interested in sponsoring the Loop WP Newsletter.

Free, private email that puts your privacy first

Proton Mail’s free plan keeps your inbox private and secure—no ads, no data mining. Built by privacy experts, it gives you real protection with no strings attached.

Classifieds

Kinsta, a reliable hosting partner for your WordPress sites. Everything you need: edge caching, CDN, WAF, 24/7 support, free migrations and much more.

Weekly WordPress News & Tips

This week's excellent and insightful WordPress News & Tips:

  • Let’s Talk - Email Marketing & eCommerce with Simon Harper (me)! (WPTuts)

  • Plugin Check - WordPress Plugins Team Rolls Out Automatic Security Scans for All Plugin Updates. (The Repository)

  • Fundamental Shift - Understanding the Interactivity API-driven future for WooCommerce Blocks. (WooCommerce)

  • What About Focused? - Your design system probably has buttons in several different states: default, hover, active, and disabled. (Natalie MacLees)

  • Melapress Role Editor - A free WordPress user roles editor plugin designed for everyone. (melapress)

  • Now…only “Systems” - Optimising for the surfaceless web. (Jono Alderson)

  • Updated! - How to hide WooCommerce block patterns. (Brian Coords)

  • Combatting Link Rot - Wayback Machine Joint. (Automattic)

  • WP SQLite - A desktop application for viewing and editing SQLite databases in WordPress Studio installations. Built with Electron and React. (Jonathan Bossenger)

  • Instant Checkout - OpenAI and PayPal Team Up to Power Instant Checkout and Agentic Commerce in ChatGPT. (Open AI & Paypal)

  • Without Sacrificing Privacy - Block Unwanted Content on Any Website. (Perishable Press)

  • Annual Keynote - State of the Word 2025 Set for San Francisco, Coinciding With WordPress 6.9 Release. (The Repository)

  • Incredible - This website is insane (Lando Norris stack explained). (Wes Bos)

  • WordPress 6.9 Beta 3 - is now ready for testing! (WordPress)

  • New - Patchstack Web Host Integration Unlocks Proactive Website Security with Industry-Leading Upsell Conversions. (Patchstack)

  • AI Experiments in WordPress - A plugin search engine, customer support bots, and Block Editor integration. (WP Builds)

  • Optimising & Fixing Websites - AI-Powered Troubleshooting for Websites. (WP Tavern & Arnas Donauskas)

  • Webmasters FM - Optimizing Woo Checkout for Black Friday ft. Ian Misner. (Brian Coords & Ian Misner)

  • Accessibility for Everyone - Why accessibility is good for people and businesses. (Progress Planner)

  • Pricing Choice - Kinsta Launches Bandwidth-Based Pricing to Give Website Owners and Developers More Hosting Control. (Kinsta)

  • A Goodbye - Five years at Automattic. (Tom Cafferkey)

  • WordCamp Tools - WordPress Community Team Calls for Contributors to Rebuild WordCamp Tooling. (The Repository)

  • Dot Release - WooCommerce 10.3.4 (WooCommerce)

If you have a question about this email or WordPress, please reply, and I will respond as soon as possible.

👋 Until next time,

This image is an original illustration created for editorial use. The WooCommerce name and logo are trademarks of Automattic Inc. All trademarks, logos, and brand names are used here for illustrative and commentary purposes only. No affiliation or endorsement is implied.

Keep Reading

No posts found