We already saw how to check if a product category is in the cart, if a product ID is in the cart, and if a product ID is in the order… now it’s time to complete the series with the latest addition!
For this client, the scope was to do something on the “Thank You” page if a certain product category was purchased. For example, echo a “Thank you for becoming a member!” image in case the category “membership” was in the order.
Here’s the snippet, together with PHP comments so that you can understand how this is done. Enjoy! Continue reading WooCommerce: Check if Product Category is in the Order
In the past, WooCommerce cart and checkout pages used to show “$0.00” beside each free shipping rate. But given that many freelance clients requested this customization, today we’re bringing this back to life with just a few lines of PHP 🙂 Continue reading WooCommerce: Display $0.00 Amount For Free Shipping Rates
A freelance client sells two distinct products on the same website: a membership and an online course. Two different audiences, different formats and… different Terms & Conditions.
The goal was therefore to display the “Terms & Conditions” checkbox on the Checkout page based on the product in the cart. Once again, we’re going to use Conditional Logic. With that, the snippet is pretty easy to code! Continue reading WooCommerce: Display Product-Specific T&C @ Checkout
Recently I was on a coaching call with a client and the “Free Sample” challenge came up. Client has 400+ products on the website and had no intention of adding a free variation to each product manually.
So, I promised to myself I was going to study a different approach. And today you get it completely free. Needless to say, a comment and a social media share are much appreciated 🙂 Continue reading WooCommerce: Order a “Free Sample” @ Single Product Page
A freelance client hired me a while ago to display a “Continue Shopping” button on the Single Product Page, next to the Add to Cart. A simple way to send their users back to where they were coming from without clicking the “previous” button on the browser 🙂
Here’s how it’s done, featuring an awesome WordPress function called “wp_get_referer()”! Continue reading WooCommerce: “Continue Shopping” Button @ Single Product Page
I’ve been wanting to publish this guide for a long while. As a freelancer, every day I repeat many operations that make me waste time – and one of them is indeed “How to get ____ if I have the $product variable/object?”.
For example, “How can I get the product SKU”? Or “How can I get the product short description”? Or maybe the product stock level, shipping class, tax class, price, regular price, sale price, and so on… hopefully this article will save you time 🙂 Continue reading WooCommerce: Easily Get Product Info (ID, SKU, $) from $product Object
Let’s talk about checkout UX: if a user is willing to pick up the item in store, why should there be a shipping form on the checkout?
Well, let’s see how we can hide this dynamically with a bit of PHP and JS! Continue reading WooCommerce: Hide Shipping If Local Pickup Is Selected
WooCommerce.com is dropping its 50% extension renewals, and moving to a 100% renewal business model.
I found this out at WCEU 2017 and then via WP Tavern. Unfortunately, this announcement is not on WooCommerce blog, on its social media channels or even Automattic.
And yes, this is retroactive – we are now all paying 100% renewals. So, let’s see what I think about this “still not official” news. Continue reading My Take on WooCommerce.com Switching to 100% Renewals
Interesting, isn’t it? This has been on my to-write list for ages, so today I want to show you my first attempt at turning the Shop page into a list/table of products.
Let’s see how I did this – I will try to comment my PHP as much as possible so you can understand my strategy. Continue reading WooCommerce: Display All Products in a Table / List
This has been on my to-write list for a looooooong while! You might want to show a “POA” or “Call for Price” when you have a product with no price. Many businesses require this, mostly real estate and wholesalers. So let’s see how it’s done 🙂 Continue reading WooCommerce: POA / Call for Price Button @ Single Product Page
Case scenario: if you add a product to cart with a specific SKU, you need another product automatically added to cart and a 100% coupon discount applied to it as well.
So here follows the PHP snippet of course! Continue reading WooCommerce: “Buy One Get One” (Without a Plugin!)
A client asked to show a “Product Inquiry” button on the Single Product Page which would display, upon click, a Contact Form with an automatically populated subject (Contact Form 7 plugin must be installed of course). Here’s how I did it! Continue reading WooCommerce: Product Enquiry Form @ Single Product Page (CF7)
Woo 2.6 introduced Shipping Zones – and with that we can play with simple PHP to accomplish lots of “advanced” shipping rules, such as shipping by weight.
With many of Business Bloomer fans always asking for this sort of customization, today we’ll see how to do just that. Without the need of just another plugin 🙂 Continue reading WooCommerce: Shipping by Weight (Without a Plugin!)
The new shipping zone management that was introduced with Woo 2.6 gives us the chance to add flat rate, free shipping and local pick-up methods by default.
But what if a client requires 3 different rates depending on the order amount (tiered shipping)? For example: “For orders up to $100, shipping = $5; for orders up to $250, shipping = $2; for orders above $500, shipping = free”.
Is this possible without using a plugin? Well, the answer, as usual, is absolutely yes! Continue reading WooCommerce: How to Setup Tiered Shipping Rates by Order Amount
I invoice clients via WooCommerce, and then send them the “Invoice Email”, which takes them to the “Order Pay” page. Of course, I want to give them the option to pay via “Bank Transfer” (bacs), but I don’t want this to be visible on the default checkout page.
We’ve seen in the past how to disable payment gateways given certain conditions… but how do we “enable” one? Here’s a snippet for that – enjoy! Continue reading WooCommerce: Enable Payment Gateway Only for “Order Pay Checkout”
A WooCommerce freelance client had a special request for their online store. And sometimes, just like physical stores, your WooCommerce website need to go on holiday! This means disabling cart, checkout and show a little notice on every WooCommerce page. Continue reading WooCommerce: Holiday/Pause/Closed Mode
The conditional tags of WooCommerce and WordPress (also “WooCommerce and WordPress Conditional Logic”) can be used in your functions.php to display content based on certain conditions. For example, you could display different content for different categories within a single PHP function. Continue reading WooCommerce Conditional Logic – Tags, Examples & PHP
We’ve all been there… WooPanic! What do I need to do? What on earth is happening? Is my website going to break?
First of all, relax 🙂 Not much to worry about.
In this post, we’ll see why that notice appears, what problems it could cause and what you can do to fix it. Continue reading Fixing “Outdated Copies of WooCommerce Templates”
WooCommerce Customizers: the Visual Hook Guide is back 🙂
Here’s a visual HTML hook guide for the WooCommerce Emails. This visual guide belongs to my “Visual Hook Guide Series“, that I’ve put together so that you can find WooCommerce hooks quickly and easily by seeing their actual locations.
Let me know in the comments if this resource it’s helpful and how! Also, if you’re eager to learn how to use this guide, how to customize emails AND how to make sure your customization only affects one email type (e.g. only the Customer Processing email), take a look at this free video lesson.
Continue reading WooCommerce Visual Hook Guide: Emails
A client of mine runs online courses for acupuncturists via Sensei LMS. US Law requires an “Acupuncture Registration Number” in order for students to get the final online certificate. So, this task was a little bit more complex than usual as it had two major issues:
1) This new checkout field does not belong to billing or shipping (order information), but instead it’s a unique user field that needs to be saved and retrieved multiple times if necessary
2) This field does need to be shown at checkout only if a certain product category is in the cart (“online courses”, as opposed to e.g. “books”)
So, here’s how you do it – hope it helps you understand that anything is possible via PHP! Continue reading WooCommerce: How to Add a Custom Checkout Field (PHP)