[wcj_product_stock_quantity]

Display WooCommerce product stock quantity

Description

[wcj_product_stock_quantity] shortcode displays WooCommerce product stock quantity. Shortcode has no required attributes, optional attributes are listed below.

Args

product_id
(optional) The integer ID for a product.

Default: The current product ID, if exists
before
(optional) Text to place before the content. If content is empty this argument is ignored.

Default: None
after
(optional) Text to place after the content. If content is empty this argument is ignored.

Default: None
visibility
(optional) User visibility. Possible values are WordPress user roles (including custom), e.g. administrator, shop_manager, customer, guest etc.

Default: all
location
(optional) Make shortcode results visible only to customers from specific country (by user IP). Value is two letter country code.

Default: all
site_visibility
(optional) Restrict shortcode output to some pages only. Possible values: single, page, archive.

Default: None
wpml_language
(optional) Restrict shortcode output to certain WPML language only. Possible values are two letter language codes. Can be comma separated list.

Default: None
not_wpml_language
(optional) Restrict shortcode output to exclude certain WPML languages. Possible values are two letter language codes. Can be comma separated list.

Default: None

Examples

[wcj_product_stock_quantity before="Product stock quantity: "]
Recommended for WooCommerce Product Info module
Accessible through:
  • [wcj_product_stock_quantity]
Tested on WooCommerce 3.6.4 and WordPress 5.2.2
Plugin can be downloaded here. If there are any locked fields in the module, you will need to get Booster Plus to unlock them.

Leave a Reply

Comments

2 Comments

  1. splaquet May 9, 2019 at 6:55 pm #

    is there a method of displaying the [wcj_product_stock_quantity] for each line item on a picking list? it’s an easy way for us to quickly catch and adjust any product inventory that’s off.

    I’ve tried a few combinations, but cannot seem to figure out how to insert it into a column on wcj_order_items_table packing slip template.

    could you shoot me over any advice on how i might be able to make that happen?

    [wcj_order_items_table table_class="pdf_invoice_items_table"
    columns="wcj_product_stock_quantity product_id="item_sku"|item_number|item_sku|product_attribute=pa_record-label|product_attribute=pa_record-number|product_categories|item_quantity|item_name|line_total_tax_excl"
    columns_titles="STK|#|BRO|Record Label|Rec Num|Media|Qty|Title|Total"
    columns_styles="width:25px;text-align:center;|width:25px;text-align:center;|width:7%;text-align:center;|width:15%;text-align:center;|width:13%;text-align:center;|width:40px;text-align:center;|width:28px;text-align:center;|width: auto;white-space: nowrap!important;overflow: hidden!important;min-width: 0;wrap-inside: avoid!important;|width:7%;text-align:right;"]

    Reply to thread

    Avatar
    • RokasJ May 9, 2019 at 7:48 pm #

      Hi,

      Unfortunately it’s not possible to use shortcodes in order_items_table – only columns from https://booster.io/shortcodes/wcj_order_items_table/, and stock is not one of them yet but we have added it to our todo list.

      I’m not sure what you are referring to as picking list but if you are talking about products page (backend), you can use this shortcode in “Admin Products List”. This will show product stock as a column on that page.

      Best regards,
      Rokas – Support Team

      Avatar