Documentation for the Related Categories for WooCommerce plugin.

Related Categories for WooCommerce

Author: WPFactory PluginsVersion: 1.9.6Updated: 5 months ago
Requires WordPress version: 4.7Tested up to WordPress version: 6.3

Settings

 

Related Categories for WooCommerce plugin lets you add “Related categories” section (similar to standard “Related products” section) to single product page and/or archives page in WooCommerce.

Related Categories for WooCommerce - Frontend Example
Related categories on frontend.

Main Features

  • Automatically add “related categories” section to the single product pages and/or to shop pages.
  • Set categories limit (i.e. number of categories).
  • Set number of columns.
  • Sort categories by name, ID, random, count, etc.
  • Automatically relate categories by siblings, parents, children, etc.
  • Set position for the “related categories” section.
  • Customize templates, e.g. set header, footer and item HTML templates.
  • Optionally display related categories with a widget and/or with a shortcode.
  • Manually relate categories on per product, per product category, per product tag and/or per product custom taxonomy (e.g. product brands) basis.
  • And more…

Plugin settings are located in “WooCommerce > Settings > Related Categories”.

General Options

Related Categories for WooCommerce - General Options

Display on Single Product Page/Archives Page
Enables/disables “Single” and “Archives” sections.
Default: Single: yes; Archives: no
Limit
The number of categories to display.
Default: 4
Columns
The number of columns to display.
Default: 4
Hide empty
Hide/show empty categories.
Default: yes
Order by
If you want to order by the ids you specified then you can use “None”. “Count” option will sort categories as when sorted by the “Count” column in “Products > Categories”. Possible values: Name; ID; Slug; Menu order; None; Random; Count.
Default: Name
Order
States whether the category ordering is ascending or descending, using the method set in “Order by”. Possible values: Ascending; Descending.
Default: Ascending

Relate Options

Related Categories for WooCommerce - Relate Options

Siblings
Enable this if you would like to display all categories with the same parents (i.e. siblings).
Default: yes
Siblings: Include grandparents
Enable this if you would like to include category grandparents’ children as well.
Default: yes
Siblings: Include top-level
Enable this if you would like to include top-level (i.e. zero) category in (grand)parents.
Default: no
Siblings: Include grandchildren
Enable this if you would like to include (grand)parents’ grandchildren as well.
Default: yes
Parents
Enable this if you would like to display all the parent categories.
Default: yes
Parents: Include grandparents
Enable this if you would like to include category grandparents as well. If disabled will always show single parent category only.
Default: yes
Children
Enable this if you would like to display all the child categories.
Default: yes
Children: Include grandchildren
Enable this if you would like to include category grandchildren as well.
Default: yes
Current
Enable this if you would like to display all the current categories.
Default: no
Per category
This will add “Related categories” settings section to each category edit page (in “Products > Categories > Edit category”).
Default: no
Per tag
This will add “Related categories” settings section to each tag edit page (in “Products > Tags > Edit tag”).
Default: no
Per custom taxonomy
This will add “Related categories” settings section to each custom taxonomy edit page. Set as comma separated taxonomy slug list, e.g.: product_brand,product_color.
Default: None
Per product
This will add “Related categories” meta box to each product edit page (in “Products > Edit product”). This option is available in “Single” section only.
Default: no
Per product: Override
Choose if you want categories to be overridden by “Per product” settings or merged with them.
Default: yes

Related Categories for WooCommerce - Per Product Options

Position Options

Related Categories for WooCommerce - Position Options

Position
Possible values in Single: Inside single product summary; Before single product summary; After single product summary; Disable. Possible values on Archives: Before main content; Before shop loop; After shop loop; After main content; Disable. “Disable” position can be set if you are going to use [alg_wc_related_categories_single] or [alg_wc_related_categories_loop] shortcode instead.
Default: Single: After single product summary; Archives: After shop loop
Position order (i.e. priority)
Moves section inside the “Position”.
Default: Single: 21; Archives: 9
Widget
This will add “Related Categories: Single Product Page” or “Related Categories: Archives” widget to “Appearance > Widgets”.
Default: no
To place related categories section on single product page before the standard related products section, select “After single product summary” for “Position” and “19” for “Position order”. To place it after the related products section, set “21” for “Position order”.

Here is the table of standard position on single product page priorities in WooCommerce:

Position Existing/known WC hooks and priorities
Before single product summary
Show product sale flash 10
Show product images 20
Inside single product summary
Title 5
Rating 10
Price 10
Excerpt 20
Add to cart 30
Meta 40
Sharing 50
After single product summary
Output product data tabs 10
Upsell display 15
Output related products 20

Template Options

Related Categories for WooCommerce - Template Options

Header
Frontend header template.
Default:

</pre>
<section class="related categories">
<h2><strong>Related categories</strong></h2>
<p>

Footer
Frontend footer template.
Default:

</pre>
<p>
Template type
Possible values: Default; Custom.
Default: Default
Template type: Custom
Ignored, unless “Template type” option is set to “Custom”. Available placeholders:

  • %category_name%,
  • %category_description%,
  • %category_count%,
  • %category_link%,
  • %category_image_link%,
  • %column_nr%,
  • %category_id%,
  • %category_slug%,
  • %category_image_id%.

Default: None
Template type: Custom: Glue
Ignored, unless “Template type” option is set to “Custom”.
Default: None

Custom template example (with “Glue” set to | ):

<a title="%category_name%" href="%category_link%">%category_name%</a>
You can use HTML and/or shortcodes in Templates. For example, if you need to translate section heading for the WPML or Polylang, you can use [alg_wc_related_categories_translate] shortcode, e.g.:

[alg_wc_related_categories_translate lang="DE" lang_text="Verwandte Kategorien" not_lang_text="Related categories"]

or in more complex form:

[alg_wc_related_categories_translate lang="DE"]Verwandte Kategorien[/alg_wc_related_categories_translate][alg_wc_related_categories_translate not_lang="DE"]Related categories[/alg_wc_related_categories_translate]

Image Options

Related Categories for WooCommerce - Image Options

Image size
Registered image size name.
Default: woocommerce_thumbnail
Placeholder image
Enter attachment ID or URL to an image. Categories with no image will use this. Ignored if empty, i.e. default placeholder image will be used.
Default: None
Remove image
Ignored, unless “Template Options > Template type” option is set to “Default”.
Default: no

Advanced Options

Related Categories for WooCommerce - Advanced Options

Hide "Related products"
Hides standard WooCommerce “Related products” section on single product pages.
Default: no

Multi-language Options

Related Categories for WooCommerce - Multi-language Options

Multi-language
Use the default language product/term ID instead of the translated one. Affects “Per category”, “Per tag”, “Per custom taxonomy” and “Per product” settings. Possible values: Disabled; WPML; Polylang.
Default: Disabled