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.
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…
Related Categories Options
Plugin settings are located in “WooCommerce > Settings > Related Categories”.
- General Options
- Relate Options
- Position Options
- Template Options
- Image Options
- Advanced Options
- Multi-language Options
General Options
- Display on Single Product Page/Archives Page
- Enables/disables “Single” and “Archives” sections.
- Default:
Single: yes; Archives: no
- Default:
- Limit
- The number of categories to display.
- Default:
4
- Default:
- Columns
- The number of columns to display.
- Default:
4
- Default:
- Hide empty
- Hide/show empty categories.
- Default:
yes
- Default:
- 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
- Default:
- Order
- States whether the category ordering is ascending or descending, using the method set in “Order by”. Possible values: Ascending; Descending.
- Default:
Ascending
- Default:
Relate Options
- Siblings
- Enable this if you would like to display all categories with the same parents (i.e. siblings).
- Default:
yes
- Default:
- Siblings: Include grandparents
- Enable this if you would like to include category grandparents’ children as well.
- Default:
yes
- Default:
- Siblings: Include top-level
- Enable this if you would like to include top-level (i.e. zero) category in (grand)parents.
- Default:
no
- Default:
- Siblings: Include grandchildren
- Enable this if you would like to include (grand)parents’ grandchildren as well.
- Default:
yes
- Default:
- Parents
- Enable this if you would like to display all the parent categories.
- Default:
yes
- Default:
- 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
- Default:
- Children
- Enable this if you would like to display all the child categories.
- Default:
yes
- Default:
- Children: Include grandchildren
- Enable this if you would like to include category grandchildren as well.
- Default:
yes
- Default:
- Current
- Enable this if you would like to display all the current categories.
- Default:
no
- Default:
- Per category
- This will add “Related categories” settings section to each category edit page (in “Products > Categories > Edit category”).
- Default:
no
- Default:
- Per tag
- This will add “Related categories” settings section to each tag edit page (in “Products > Tags > Edit tag”).
- Default:
no
- Default:
- 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
- Default:
- Per product: Override
- Choose if you want categories to be overridden by “Per product” settings or merged with them.
- Default:
yes
- Default:
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
- Default:
- Position order (i.e. priority)
- Moves section inside the “Position”.
- Default:
Single: 21; Archives: 9
- Default:
- Widget
- This will add “Related Categories: Single Product Page” or “Related Categories: Archives” widget to “Appearance > Widgets”.
- Default:
no
- Default:
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 |
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Inside single product summary |
|
||||||||||||||
After single product summary |
|
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
- 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
- Image size
- Registered image size name.
- Default:
woocommerce_thumbnail
- Default:
- 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
- Default:
Advanced Options
- Hide "Related products"
- Hides standard WooCommerce “Related products” section on single product pages.
- Default:
no
- Default:
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
- Default: