-

·
How to add a metabox to the orders screen in WooCommerce
Adding a metabox to the WooCommerce orders screen is a bit different High Performance Order Storage (HPOS). If you want to support both HPOS and the legacy order system, here’s how to do it. Link to code on GitHub: https://gist.github.com/devinsays/0988711df0a43d7911693c8c4b2dc1d7
-

·
Address Autocomplete Improved Conversions by 1.5%
We implemented address autocomplete for on the checkout page at Universal Yums a couple years ago, but had never A/B tested its impact on conversions until recently. It makes intuitive sense that address autocomplete would reduce friction as it enables customers to complete checkout faster. It has also been implemented by a number of large…
-

·
WooCommerce Subscriptions at Scale
At Universal Yums we process a large amount of subscription renewals on the 1st of every month. We generally process at a rate of ~10k-20k renewals per hour until all the renewal are complete. If you’re looking to run a WooCommerce Subscriptions site at scale, here’s some tips. Optimize Your Hosting Plan We host with…
-

·
WooCommerce Subscriptions Performance: get_related_order_ids
If you ever find yourself in a situation where your subscription order id cache (_subscription_renewal_order_ids_cache) is not building properly, it could be because the database is timing out. If you haven’t yet made the transition to the High-Performance Order Storage, WordPress needs to do a very taxing meta query in `get_related_order_ids` in order to rebuild…
-

·
Preventing Coupon Abuse and Fraud in WooCommerce
Coupon abuse is when a customer intentionally uses a coupon in a way it wasn’t intended. For example, a customer might create a new user account or use a different email address to evade coupon usage limits. When you’re creating coupons, first make sure they are targeted for the customer you want to promote to.…
-

·
Reducing Database Size in WooCommerce
As the number of orders in your WooCommerce site grows, so will the database size. At Universal Yums, our database size is 120GB and still growing! The three tables that tend to be the largest are postmeta, comments (order notes), and woocommerce_order_itemmeta.
-

·
WP CLI Script to Schedule Sales in WooCommerce
If you have a lot of products, scheduling a sale for all of them can. be a pain. This WP CLI scripts prompts you for the dates of your sale, the percentage discount, and then schedules it for all your products. View the script on GitHub. This WP CLI script can schedule the product sale…
-

·
WP CLI Script to Duplicate WooCommerce Coupons
I love writing WP CLI scripts to accomplish tasks in WooCommerce. Recently we needed to generate hundreds of coupons that had a standard prefix + a unique code. We also needed to update the coupon meta for _wc_url_coupons_unique_url to use the unique code since our coupons apply via links. There were a few no-code solutions…