[wcj_product_categories]

Display WooCommerce product categories

Description

[wcj_product_categories] shortcode displays WooCommerce product categories. 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_categories before="Product categories: "]
Recommended for WooCommerce Product Info module
Accessible through:
  • [wcj_product_categories]
Tested on WooCommerce 3.5.2 and WordPress 5.0
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

4 Comments

  1. Tarmo July 19, 2018 at 10:29 am #

    Hi,

    I need the gategory to be printed with parent gategory. Im using [wcj_product_categories_names] shortcode, but its not showing the parent. How can i achive that?

    Reply to thread

    • RokasJ July 19, 2018 at 1:27 pm #

      Hi Tarmo,

      The parent categories will be shown if they are selected in addition to subcategories in the product edit page. If only subcategory is selected at the moment, please select the parent category as well.

      Best regards,
      Rokas – Support Team

    • Tarmo July 24, 2018 at 8:28 am #

      Hi,

      Selecting parent category is not a solution for my setup. I need to receive categories the same way as woocommerce native product export does (Parent > Child). Is there a possibilty for that?

      -Tarmo.

    • RokasJ July 24, 2018 at 9:36 am #

      Hi Tarmo,

      Unfortunately it’s not possible yet but we have added it to our todo list.

      Best regards,
      Rokas – Support Team