It’s a rainy Wednesday here in Sicily – farmers are happy because we finally get some water after 2 months of drought. This dry winter will cause several problems to olive oil and local wine production this year – let’s hope all is gonna be alright though!
Anyway, welcome back to our WooCommerce Weekly appointment – here comes a series of WooCommerce tutorials put together by yours truly so that you can learn something new.
Revised WooCommerce Tutorials
This week I’ve revised so many articles that it made no sense to publish new ones. In the same way WordPress plugins are updated, my WooCommerce snippets require a bit of TLC sometimes. Here’s the full list:
WooCommerce: Hide Categories From Product Cat Widget
A client asked me to customize the Product Categories Widget that comes included with WooCommerce. In this case, they wanted to show ALL categories but the current one (when looking at a category page of course). We’ll make use of the “woocommerce_product_categories_widget_args” filter and provide a list of product categories to exclude. Enjoy: https://businessbloomer.com/woocommerce-hide-non-current-categories-product-categories-widget/
WooCommerce: Add First & Last Name to My Account Register Form
Here’s another useful PHP snippet that adds the Billing First Name and Billing Last Name to the Registration Form on the WooCommerce My Account page. Enjoy: https://businessbloomer.com/woocommerce-add-first-last-name-account-register-form/
WooCommerce: Remove Shipping Labels @ Cart (e.g. “Flat Rate”)
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, and many clients have asked me to remove it completely. So, here’s how you do it: https://businessbloomer.com/woocommerce-remove-shipping-labels-cart-checkout-page-e-g-flat-rate/
WooCommerce: Check if Product ID is in the Cart
I found out about a magic WooCommerce function: “find_product_in_cart()”. Which means finding a product in the Cart doesn’t require custom loops or complex PHP… it’s just a “one liner”. Enjoy: https://businessbloomer.com/woocommerce-easily-check-product-id-cart/
WooCommerce: Add Product to Cart On Visit Programmatically
Quite an interesting functionality! A WooCommerce client wanted their Cart pre-filled with one product as soon as their customers accessed the website. So, let’s see how this snippet works: https://businessbloomer.com/woocommerce-add-item-to-cart-programmatically/
WooCommerce: Disable Tracking if Order Failed @ Thank You Page
The “woocommerce_thankyou” hook fires on the Thank You page once an order is placed. Problem is – it’s ALSO called if an order fails. We need to find a way NOT to run “woocommerce_thankyou” if an order fails. So here you go: https://businessbloomer.com/woocommerce-disable-tracking-if-order-failed-thank-you-page/
WooCommerce: Display Height, Length, Width @ Shop Page
How do we show the product dimensions (height, width, length) in the shop / category / tag / loop pages? This could be a handy trick for shops that calculate shipping rates based on volume. Either way, enjoy: https://businessbloomer.com/woocommerce-display-product-height-length-width-shop-page/
WooCommerce: Display Total Weight @ Cart & Checkout
You might want to show what is the current Total Weight on the cart and checkout page in case this is useful to your customers. So here you go – enjoy: https://businessbloomer.com/woocommerce-display-weight-cart-checkout/









