Change-Woocommerce-sold-individually-product-setting-Programmatically

Change Woocommerce sold individually product setting Programmatically

  • August 21, 2022

Let’s assume you have a product inventory of 1000s of product and you want to sell your all product individually, what will you?

Well you need to change the product setting one by one to sell individually but, is this a right solution?

No,

I have come here with a tricky solution, you just need to add a single line of code in your active theme’s functions.php file.

/**
 * @snippet       Change Woocommerce sold individually product setting 




 */
 
add_filter( 'woocommerce_is_sold_individually', '__return_true' );

This snippet will overwrite your all products “sold individual” setting to true.

Related Post

Change-in-stock-out-stock-text-in-Woocommerce-single-product-page

Change “in stock” / “out stock” text in Woocommerce single product page

In this tutorial you will learn how we can change “in stock” / “out stock” text with the custom. We will use custom snippet for this. Just copy the above snippet and paste in your […]

Change-product-price-in-cart-programmatically

Change product price in cart programmatically

Here we will learn, how we can change product price in cart programmatically. Add below code in your theme’s functions.php file

Remove-Added-to-Cart-Message-in-Woocommerce

Remove Added to Cart Message in Woocommerce

If you are looking a way to hide “added to cart message” with easy method? Then you are in right place. To we will learn how to remove the “added to cart message” without using […]