Home WooCommerce Tutorials Standard Post

Standard Post

WooCommerce Product Stock Settings and Methods to Display Stock Quantity

When building foreign trade websites, we usually use WooCommerce to sell products. Since sales are involved, we need to use inventory information. This article from Naiba will introduce how to set product inventory in WooCommerce and how to display the stock quantity on the product purchase page. How to set inventory First, after entering the website...

Posted on August 23, 2020 About 2 minutes read
WooCommerce商品库存设置和显示库存数量的方法

WeForeign Trade Website BuildingWhen building a foreign trade independent website, WooCommerce is typically used to sell products. Since sales are involved, stock information becomes necessary. This article by Naiba introduces how to set product stock in WooCommerce and how to display the stock quantity on the product purchase page.

How to Set Stock

WooCommerce库存管理设置

First, go to the website backend, find WooCommerce settings, switch to the product settings page, and then find the inventory settings.

Check Enable stock management, then set the stock holding period, and save the settings.

WooCommerce库存管理设置

Then, go to the product settings page, find the product's inventory settings tab, and check Manage stock.

Fill in the stock quantity below.

After this operation, WooCommerce inventory is set up. Next, let's see how to display inventory data on the website product page.

Display Stock Information on Product Page

After setting up the stock, you may also want to display the product stock on the Frontend so users can know the remaining quantity. This can be achieved through either a plugin or code.

Method 1: Using the Woocommerce Show Stock Plugin

WooCommerce库存显示

You can search for Woocommerce Show Stock directly from the website backend plugin section and install it.

After installation, go to WooCommerce's inventory settings interface. At the bottom, there is a stock display information setting. After enabling stock display, set the display position and save.

Download Link

Method 2: Adding via Code

产品分类页显示库存信息

Add the following code snippet to your Theme's functions.php file to display stock information on product archive pages.

add_action( 'woocommerce_after_shop_loop_item', 'bbloomer_show_stock_shop', 10 );

function bbloomer_show_stock_shop() {
global $product;
echo wc_get_stock_html( $product );
}

Source: https://businessbloomer.com/woocommerce-add-stock-quantity-on-shop-page/

1.3/5 - (3 votes)
Previous WooCommerce Premium E-commerce Theme: Porto v6.6.0 Cracked Version Download Continue reading content around the same timeline. Next Remove the „Downloads“ Page from WooCommerce „My Account“ View the next related tutorial or experience.

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: