WooCommerce: Get Product Info (ID, SKU, $) From $product Object

I’ve been wanting to publish this guide for a long while. As a WooCommerce development 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.

Of course, not always you have access to the $product global – but you may know the $product_id. In this case, you can use the wc_get_product WooCommerce function to calculate the $product object – you find this case scenario below.

Other examples might be the order or the cart page. Once again, in here you don’t really have a $product available, so you have to loop through the order/cart items and “get” it. After that, you can then calculate and get any piece of information you require out of $product. Enjoy!

Continue reading WooCommerce: Get Product Info (ID, SKU, $) From $product Object

WooCommerce: My Take on WooCommerce.com Switching to 100% Renewals

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 WooCommerce: My Take on WooCommerce.com Switching to 100% Renewals

WooCommerce: Product List View @ Shop

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 as opposed to the default grid.

This is especially suitable to B2B WooCommerce shops, or for those websites where customers don’t really need to see huge product images and are used to order “from a product form”.

Let’s see how I did this – I will try to comment my PHP as much as possible so you can understand my strategy. Enjoy!

Continue reading WooCommerce: Product List View @ Shop

WooCommerce Checkout Fields Customization Guide

Checkout page plays a huge role in your eCommerce success. It is one of the most important part of your conversion funnel. This is the page that brings revenue.

It doesn’t matter how many people are visiting your website if no one makes any purchase. Complicated checkout process is one of the main reason of high shopping cart abandonment.

You should always look for ways to make your checkout process as simple as possible. If you are using WooCommerce as your eCommerce solution you can easily change the checkout page design, remove or change the existing checkout fields order.

Continue reading WooCommerce Checkout Fields Customization Guide

WooCommerce: “Buy One Get One” (Without a Plugin!)

Case scenario: if you add a product ID to cart with a specific, you want another product automatically added to cart (Buy One Get One, or “BOGO”).

This second product should have price = 0 if you wish to completely give it away, or maybe a set sale price. It should also be set to “hidden” because maybe you want to hide this free product from the shop and only gift it when the first one is added to Cart.

Also, if you remove product 1, the gifted product should go away from the Cart too. So here follows the PHP snippet of course!

Continue reading WooCommerce: “Buy One Get One” (Without a Plugin!)

WooCommerce: What is it? Is it Free?

WooCommerce is a free WordPress plugin that allows WordPress users to sell products or services from their website.

It is one of the best WordPress eCommerce plugin for building and growing an online business. Upon launching it became hugely popular due to its flexibility and simplicity.

It is a dominating force in the global eCommerce platform and accounts for 42% of the total market share. That means over 42% of all online shop uses WooCommerce to run their business.

Continue reading WooCommerce: What is it? Is it Free?

WooCommerce: Shipping Rates by Order Amount

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! Enjoy!

Continue reading WooCommerce: Shipping Rates by Order Amount

WooCommerce: Enable Payment Gateway Only for “Order Pay Checkout”

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”

WooCommerce: 85 Free Plugins for Every Challenge

free woocommerce plugins

WooCommerce is one of the most popular WordPress plugin for adding eCommerce or cart functionality to a WordPress website. According to recent research by aheadWorks, WooCommerce now accounts for 26.5% of the total eCommerce market share. And recent acquisition by Automattic indicates that it has a great future ahead.

WooCommerce is well known for its huge flexibility and vast customization options. There are hundreds of WooCommerce plugins or Extensions available for extending the functionality. If you want some recommendations in this direction, check out some of the best free WooCommerce plugins (sorted by number of active install).

Continue reading WooCommerce: 85 Free Plugins for Every Challenge

WooCommerce: Enable Holiday / Pause / Vacation Mode

Sometimes, just like physical stores, your WooCommerce website may need a few days off!

Nothing special there, as long as online customers are aware of the fact you will be reopening soon.

In WooCommerce words, this means hiding the add to cart buttons (one line of code) and also show a little notice on every WooCommerce page (one simple setting).

Enjoy!

Continue reading WooCommerce: Enable Holiday / Pause / Vacation Mode

WooCommerce Visual Hook Guide: Emails

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! Enjoy 🙂

Continue reading WooCommerce Visual Hook Guide: Emails

WooCommerce: Limit Shipping to Only One State

Today’s snippet has been widely requested by many readers, clients and WooCommerce fans. We already saw in the past how to Limit State Dropdowns to One State Only (for both Shipping & Billing) and How to Sell to one State only (Billing).

However, we never covered a much more common setting: what happens when Billing is allowed to every state but Shipping is limited?

In order to get a little help, I’ve reached out to Diego Zanella, a WooCommerce genius who is also the author of the Aelia Currency Switcher plugin for WooCommerce.

Continue reading WooCommerce: Limit Shipping to Only One State

Storefront Theme Visual Hook Guide

Here’s a visual hook guide for Storefront Theme by WooCommerce.

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. Also, you can copy & paste in seconds and speed up your customization time.

Let me know in the comments what you think about this resource! Enjoy!

Continue reading Storefront Theme Visual Hook Guide