WooCommerce – Page 5

Bulk Copy and Update Products between WooCommerce Stores

Just another tutorial by your requests guys.

In this one we are about to create a bulk action like on the screenshot below which allows to sync products between two (or multiple) WooCommerce stores.

WooCommerce Copy Products and Products data from one site to another
If a product has already been published on Store 2, then we just update its product data.

Get Product Stock Quantity

In this tutorial I will not only show you how to get stock quantity in WooCommerce (of a product or a product variation by the way) but we will also display it on the shop page. Like this:

displaying only one left in stock on WooCommerce shop page

Creating MetaMask Payment Gateway for WooCommerce

Recently I really enjoyed creating a tutorial about signing in to WordPress with MetaMask, so I decided to continue with this topic and today I will show you how you can create a payment gateway for WooCommerce that allows to pay with MetaMask extension.

I also would like to remind that I already have a complete payment gateway tutorial and additionally a tutorial about paying with crypto. So you can check them out as well.

And this how it is going to work on our WooCommerce store:

MetaMask Payment Gateway for WooCommerce
This is what happens when you click Connect wallet (Place order) button on your WooCommerce checkout page.

WooCommerce REST API: Create Product with Images

I am starting to have more and more tutorials about REST API on my blog which is for sure because I am doing some work with my crossposting plugin.

Today is another one where I am going to share with you a simple code example how you can add Product image and Product gallery images when creating a product with REST API.

Just in case I mean these things:

WooCommerce product image and gallery images
You can find this if you go and edit any WooCommerce product.

Multisite Product Sync for WooCommerce

In this tutorial I am going to show you two ways how you can sync your WooCommerce products between stores within a single WordPress multisite network.

Under two ways I mean this:

  1. In code with the help of the woocommerce_update_product action hook, the switch_to_blog() function and CRUD layers (in case we’re working not with a multisite network but with standalone WooCommerce stores, then we need to use REST API, there is a separate tutorial about that).
  2. With the plugin (just install and here we go).

Below is an example of how it can be implemented on your store with my plugin:

WooCommerce multisite product sync
Just select some of the connected WooCommerce stores you would like to sync this specific product with.

How to Create Product Variations Programmatically

There is also a tutorial on my blog about creating products programmatically where I slightly cover the product variations.

But there are still a couple moments I would like to discuss more thoroughly, I came to them when I was doing the variable products crossposting for my multisite crossposting plugin.

Get Product (or Variation) by SKU

In this tutorial I will show you how to get a product or a product variation object in WooCommerce if you only know its SKU. It is easy-peasy when we get a product object by ID, we just have to use wc_get_product() function, but we can not pass SKU to that function.

So I am going to show you three different ways how you can obtain a product object from SKU, we are going to do it both WooCommerce-way (with WP_Product_Query and with wc_get_product_id_by_sku() function) and WordPress-way (with WP_Query).