Code Snippets

All posts filed under Code Snippets.

← Back to all posts
Code Snippets

WooCommerce Order Emails Reply to the Wrong Person

WooCommerce sets the Reply-To on admin order emails to the customer. Here is how to change it so replies go to your team instead.

February 26, 2026 · 4 min read
Code Snippets

Fixing Min/Max Rules Inside Product Bundles

I ran into a tricky case where Min/Max Quantities pushed its “Group of” rules onto bundled items, breaking the whole bundle flow. There was no UI switch to control it, so I traced both plugins’ code, found the right filters, and wrote a snippet that fixes the product page, cart, and Store API in one go. The bundle now works as expected without changing how the standalone products behave.

December 3, 2025 · 10 min read
Code Snippets

How I stopped Product Add-ons from bypassing Sold Individually in WooCommerce

When Product Add-ons is active, the Sold individually setting stops working because each add-on configuration creates a unique cart item. This code snippet ensures products can only be added once per order, regardless of the add-on options selected.

September 11, 2025 · 7 min read
Code Snippets

How to reset Variation Selections after adding to Cart in WooCommerce?

By default, WooCommerce doesn't reset selected variations after adding a product to the cart. Here's a simple snippet to automatically clear variation options for a smoother shopping experience.

September 3, 2025 · 5 min read
Code Snippets

How to change Read More to Add to Cart for Bookable products?

By default, WooCommerce Bookings shows Read More instead of Add to Cart. Here's a simple code snippet to change that while keeping the booking flow intact.

August 18, 2025 · 4 min read
Code Snippets

How to show Product Global ID in WooCommerce Order Details and Quick Preview?

WooCommerce doesn't show product GTIN/UPC/ISBN in order details or quick previews by default. Here's a simple snippet to show GTIN/UPC/ISBN alongside SKUs in the admin order page.

August 6, 2025 · 5 min read
Code Snippets

How I Skip the Cart and Send Customers Straight to Checkout in WooCommerce

A practical guide to skipping the WooCommerce cart page and redirecting customers straight to checkout, based on real project experience.

May 10, 2024 · 4 min read
Code Snippets

How to enable Products Revisions in WooCommerce? (So You Can Undo Mistakes)

How to enable product revisions in WooCommerce so you can track changes and restore older product versions when something goes wrong.

January 8, 2024 · 4 min read