WooCommerce: How to Bulk Generate Coupons Without a Plugin
There are times when doing manual work – such as creating a WooCommerce coupon – is too time consuming. Imagine you need to bulk generate 1,000 coupon codes – sure you have 2,000 minutes at your disposal to do it all by hand?
Well, today, we’ll take a look at how to bulk generate coupon codes from the WordPress backend by using a simple PHP “for“. Once the function triggers, it will just be a matter of seconds!
Note: in order to trigger the function, you must go to any WordPress admin URL with the “bb-gen-coupons” URL parameter e.g. /wp-admin/admin.php?bb-gen-coupons. This will make sure the coupons are generated.
This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101
WooCommerce: Add Second Description @ Product Category Pages In terms of SEO, if you’re trying to rank your product category pages, you really need to make the most of the default WooCommerce product category “description” and “thumbnail”. Most themes, if compatible with WooCommerce, will show this content right below the product category name and above products. Nothing new so far. But what if […]
WooCommerce: Add Content to the Thank You Page A client of mine wanted to add some text to the thank you page, the page that customers see after they place an order via the default WooCommerce Checkout page. In this case scenario, they wanted to add a special coupon discount in order to entice buyers to go back to the website and buy […]
WooCommerce: Apply Coupon Programmatically if Product @ Cart Users can manually enter a coupon code, refresh the Cart and see their discount apply… or you can do that automatically (or “programmatically” as we say in the dark web) when a user adds a product to the WooCommerce Cart 🙂 All you’ve got to do is creating a coupon, and then a PHP function […]
WooCommerce: Add Column to Orders Table @ WP Dashboard The WooCommerce Orders Table, which can be found under WP Dashboard > WooCommerce > Orders, provides us with 7 default columns: Order – Date – Status – Billing – Ship to – Total – Actions. This is used by shop managers to have an overview of all orders, before eventually clicking on a specific one. […]
WooCommerce: Hide/Show The WP Admin Bar In previous WooCommerce versions, new customers could access the WP Admin black bar after purchase. Now this seems fixed. Still, what about other user roles, and what if you want to override this default behavior? Well, here’s a quick snippet for you – feel free to use it in your own WooCommerce site. Enjoy!
Business Bloomer Founder
Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli