WooCommerce: Get Product Data (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 Data (ID, SKU, $) From $product Object

WooCommerce: 25 Developers You Should Follow

Due to hyper growth & increasing reach of the internet (more precisely 1 million new users each day), more brick and mortar stores are now open to the idea of opening their own online store. Reaching bigger demographics and ability to sell 24 hours outweighs everything.

Since WordPress is affordable & easy to use and manage, a lot of people (27% of all websites are powered by WordPress) builds their website with WordPress. And if they aspire to run a full fledged ecommerce store on WordPress, there is no better alternative available than WordPress default ecommerce plugin, WooCommerce.

WooCommerce is the best free ecommerce plugin for WordPress. Every day thousands of aspiring business owners install WordPress & WooCommerce to fulfill their dream & reach to a new height. There is no indication that this growth will stop anytime soon.

So if you consider yourself a WordPress developer, it’s better to get your hands dirty in WooCommerce development. And here are some of the best developer blogs for learning how to customize WooCommerce.

We’ll kick off the list with the “WooCommerce Developer Blog”, of course. This is the number one blog your should subscribe to because, you know, it’s the official one!

Enjoy!

Continue reading WooCommerce: 25 Developers You Should Follow

WooCommerce: What is it? Is it Free?

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

It is one of the best WordPress ecommerce solutions for building and growing an online business.

It became hugely popular due to its flexibility and simplicity, as well as the variety of free and premium add-ons and a massive developer community. It is a dominating force in the global ecommerce world and accounts for over 20% of the total market share as of 2023.

In this post, we’ll take a look at the WooCommerce history, as well as its pros and cons as an ecommerce software.

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

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: Display Different Widgets Based On Product Category

Using Widget Logic, you can easily set what widget you want to display based on what WooCommerce product categories users are browsing.

For example, you can set what widgets users will see when he will land to the “Book” product category page. These widgets will not be visible in other pages, it will be only shown to a user when he lands to that exact category.

Continue reading WooCommerce: Display Different Widgets Based On Product Category

WooCommerce: How To Change Product Image Sizes

WooCommerce lets you resize the product images on Single Product and Shop pages from Appearance > Customize > WooCommerce > Product Images.

Besides, you don’t have to manually regenerate the images after resizing them with an additional plugin, as WooCommerce can crop, resize and automatically regenerate image sizes out of the box.

Despite this seems easy enough, it often happens that themes or plugins may override the “Customizer” settings, and even hide them entirely, which causes a lot of confusion.

In this post, we’ll take a look at the default WooCommerce image settings, and finally with a list of FAQ we’ll try to cover all possible scenarios in case you can’t find a solution. Got a question? Feel free to use the comment area!

Continue reading WooCommerce: How To Change Product Image Sizes

WooCommerce: Custom Add to Cart URLs – The Ultimate Guide

In WooCommerce you can add a product to the cart via a custom link. You just need to use the “add-to-cart” URL parameter followed by the product ID.

This tutorial will show you how to create custom URLs to add simple, variable and grouped products to the cart – as well as defining the add to cart quantity and an optional redirect.

You will be able to see each possible scenario, and also copy/paste the custom URLs so that you only need to replace product IDs and quantities.

I strongly recommend you read through all the post comments in case you’re not sure about something – many people have asked the same questions over and over again e.g. “Is it possible to add more than 1 product to the cart?” (to which the answer is “no”, unless you install a custom plugin) or “Why does my product get added twice?

With this guide it’s much easier to place WooCommerce add to cart buttons on custom landing pages, pricing tables, blog posts, external websites, and so on. Enjoy!

Continue reading WooCommerce: Custom Add to Cart URLs – The Ultimate Guide

WooCommerce: How to Fix the “Cart is Empty” Issue

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

WooCommerce: How to Export/Import Products

Maybe you don’t know that, but WooCommerce has an inbuilt functionality for importing and exporting products from CSV/XML files. Therefore, most of the times, you don’t need a premium import/export plugin.

Simply go to WordPress Dashboard > Products > All Products and click on Import (or Export) and follow the instructions. That’s it!

This is a new functionality introduced since WooCommerce 3.0 and it’s working like a charm.

For more advanced import/export, automatic updates from server and more complex functionalities, take a look at WP All Import + WooCommerce Add-On