It’s live. And it’s alive and kicking.
#CustomizeWoo, my flagship Advanced WooCommerce Online Course for designers and DIY store owners, is now live.
In this post, I’m about to show you why I invested 151hrs 39mins 1secs of my time to build #CustomizeWoo and another 50+ hours to publish the updated version in June 2019, who I’m willing to help, and what the course looks like from the “inside”.
So, here’s the story. Here’s why #CustomizeWoo was born. Continue reading CustomizeWoo: a WooCommerce Online Course for Aspiring Developers
Today we take a look at the WooCommerce Checkout page and specifically at how to add a Custom Extra Fee for Non-Continental US States.
You can do the exact same thing for a non-US State, as long as customers will feel comfortable in paying extra!
Continue reading WooCommerce: Add Shipping Fee for Non-Continental States
Today we take a look at the WooCommerce Checkout page and our goal is to disallow placing an order to customers that enter a PO BOX address. I don’t remember where I got this snippet from, but either way I’m glad to share it again!
Continue reading WooCommerce: Disallow Shipping to PO BOX Address
Today we take a look at the WooCommerce Minimum Order Amount. This snippet displays an error notification on the Cart Page and an error message @ Checkout Process if the order is below a set threshold.
Continue reading WooCommerce: Define a Minimum Order Amount
Today we take a look at the WooCommerce Checkout and specifically at how to disable a payment gateway (e.g. PayPal) if a specific product category is in the Cart.
There are two tasks to code in this case: (1) based on all the products in the Cart, calculate the list of product categories in the Cart and (2) disable a specific payment ID if the target product category is in the Cart.
May sound difficult but don’t worry – solution is right below. Enjoy!
Continue reading WooCommerce: Disable Payment Method If Product Category @ Cart
Today we take a look at the WooCommerce Checkout Page and specifically at how to disable a payment gateway (for example PayPal) when a specific shipping method is selected (e.g. “local_pickup”).
Specifically, you will learn how to “get” the selected shipping method on the go (thanks to “sessions”), and also how to “unset” a payment gateway. Enjoy!
Continue reading WooCommerce: Disable Payment Gateway For Specific Shipping Method
Quite an interesting functionality! A WooCommerce client wanted their Cart pre-filled with one product as soon as their customers accessed the website. I don’t remember the exact reason, but this could be useful when you want to give them a free product by default, or you want to send your visitors straight to checkout with a product already in the cart without letting them add anything first.
Adding an item to cart programmatically is the same as “automatically”. Basically, all users will have a default, non-empty Cart filled with an item of your choice. So, let’s see how this snippet works!
Continue reading WooCommerce: Add Product to Cart On Visit Programmatically
A WooCommerce Customization client wanted to add some text above the “Login” and “Register” boxes on the My Account page. Understandably, users may need a bit of an explanation before they take action. Here’s how you do it!
Continue reading WooCommerce: Add Content @ My Account Register / Login Page
I’ve put together a visual (yet, you can copy/paste!) hook guide for the WooCommerce Cart Page. If you like this and it is helpful to you, let me know in the comments and I’ll create another one for the checkout, single product page and my account page.
You can find WooCommerce Cart hooks quickly and easily by seeing their actual locations. Great thing is – all you need to do in your functions.php is “add_action(‘place-hook-here’,’your-PHP-function-here’);” and you can place your custom functions anywhere on the WooCommerce Cart Page. Enjoy!
Continue reading WooCommerce Visual Hook Guide: Cart Page
This is a workaround to Limit Shipping and Billing to One State Only. In two of my previous posts (Limit Shipping to One State Only and Limit Billing to One State Only) we’ve seen similar functionalities. In this case, let’s imagine we want to avoid that the user selects unwanted states. Continue reading WooCommerce: Limit State Dropdowns to One State Only
A client needed to disable all shipping methods but Local Pickup for a certain variation ID. This may come useful if you’re looping through the variations on the cart/checkout page (check if variation ID is in the cart for example), so here you go! Continue reading WooCommerce: Disable Shipping Rate if Variation ID @ Cart
Here’s yet another easy WooCommerce PHP snippet if you wish to completely remove / hide or translate / rename the SALE! badge on the homepage, shop page, category pages and single product pages.
Once again, with a few lines of code (and specifically, the “woocommerce_sale_flash” filter) you can achieve anything you want. Enjoy!
Continue reading WooCommerce: Remove or Rename SALE! Badge
Very similar to the “Limit shipping to one State only“, this time we want to limit the Billing to only one state. An Australian client asked me to limit their sales to the South Australia state, but the same can be applied to US, UK and all the other countries that have states.
Continue reading WooCommerce: Sell to One State Only
A client had several shipping rates on the cart page automatically generated by FedEx, USPS, UPS and similar plugins via their API. Problem was, they wanted to sort them by price as opposed to grouping them by provider.
Thankfully, with a simple “uasort” PHP function, it’s possible to take the shipping rates array and sort it by amount before returning it back to the screen. If you don’t know PHP, simply copy/paste!
Continue reading WooCommerce: Sort Shipping Costs from Low to High
I developed a custom payment gateway plugin for a client, who wanted to add a similar method to “cod” (cash on delivery). FYI, he wanted to add a method called “card on delivery”. I simply duplicated the code, added the PHP to a file, made a plugin and gave him the plugin zip file. And everything was working great… until he did a test checkout. Continue reading WooCommerce: Fixing Fatal error Call to undefined function wc_get_order()
When you have special shipping requirements, maybe you want checkout users to see the shipping form section visible on load.
Here’s how you do it. You’ll also find the opposite task in case you happen to have the shipping form opened by default and you want to hide it. Enjoy!
Continue reading WooCommerce: “Ship to a Different Address” Opened by Default
WooCommerce functions add the shipping method label on the Cart totals, on the left hand side of the price. This ruins the price amounts alignment (subtotal, shipping, taxes, total) and many clients have asked me to remove it completely. Also, it could be that sometimes you don’t want to show the name of a shipping rate on the front-end. So, here’s how you do it!
Continue reading WooCommerce: Remove Shipping Labels @ Cart (e.g. “Flat Rate”)
The cart totals table cell title “Shipping” or “Shipping and Handling” appears also on the checkout page. So, what if you wish to “translate” this string from English to “better” English or completely customize it? Thankfully there’s a quick 4 lines snippet for you. Enjoy!
Continue reading WooCommerce: Translate “Shipping” @ Cart Totals
Sometimes you may want to add a prefix or a suffix to your prices. It could be something like “From…”, “Only…”, “…tax free” and so on.
The first good news is this is very easy to do with a WooCommerce filter (remember, filters change the value of an existing variable, while actions add content). The second good news is that you don’t need to know PHP, just copy/paste my snippet or install a mini-plugin. Enjoy!
Continue reading WooCommerce: Add Prefix / Suffix to Product Prices
For some reason, sometimes you add products to cart but the cart page stays empty (even if you can clearly see the cart widget has products in it for example).
But don’t worry – it may just be a simple cache issue (and if you don’t know what cache is that’s no problem either) or a theme / plugin “conflict”.
The WooCommerce Cart page is extremely delicate; it displays dynamic content based on cookies and PHP sessions, is coded with PHP but also JS and Ajax, requires to be excluded from cache and is subject to problems in case of out of date software.
So, here’s your “Empty Cart” troubleshooting checklist you can follow without any technical knowledge.
I also recommend you read through the (many) comments, because many developers shared what worked for them too. Good luck!
Continue reading WooCommerce: How to Fix the “Cart is Empty” Issue