How you doing?
It’s a weird Wednesday here in Sicily, and officially our 44th day of lockdown in Italy. Things will gradually reopen on May 4th, but the upcoming “phase 2” will be quite long. Summer is at risk, and Italy pretty much relies on the summer holidays.
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.
New WooCommerce Tips
WooCommerce: View Product Hidden Custom Fields (“Protected Meta”)
I was working on a WooCommerce project recently and I didn’t want to waste time searching through all the hidden product post meta. Post meta are basically product custom fields that are added via the update_post_meta() WordPress function by WooCommerce itself, a custom plugin, a snippet, a theme. For example, “total_sales” is a default WooCommerce product custom field that updates every time the product is purchased. If the product custom field “meta key” starts with an underscore (“_”), however, this won’t be visible in the “Custom Fields” section of the edit product page screen. Which is a bummer. So, today, I’ll show you a quick trick so you can always know what the values for product meta keys are without having to mess with print_r() or error_log() in your PHP functions. Enjoy: https://businessbloomer.com/woocommerce-view-product-hidden-custom-fields-protected-meta/
Revised WooCommerce Articles
WooCommerce: Hide Products Based on IP Address / Geolocation
There are many plugins that would allow you to do this in bulk or that would give you advanced features… but what if you just need to hide one product ID for users who are visiting your WooCommerce website from a specific country code? This is also called “geolocation” – remember this won’t work unless you’ve enabled geolocation inside the WooCommerce general settings. Enjoy: https://businessbloomer.com/woocommerce-hide-product-based-on-ip-address-geolocation/
WooCommerce: Hide Shipping Rate if Shipping Class @ Cart
Our goal is to check if a Product with a specific Shipping Class is in the Cart, and consequently disabling a shipping rate such as Free Shipping if this is true. This is super useful when there are multiple items in the cart and you don’t want to give free shipping for certain orders for example: https://businessbloomer.com/woocommerce-disable-free-shipping-if-cart-has-shipping-class/
WooCommerce: Show Video Instead of Product Images
This week’s snippet is a very easy – yet helpful – one. Many ecommerce entrepreneurs prefer to display a YouTube video instead of a static, boring, featured image and product gallery. Of course, not all products are created equal. So, let’s see how to make this work for a specific product ID only. Enjoy: https://businessbloomer.com/woocommerce-show-video-instead-featured-image/









