• Resolved Martin Freisinger

    (@martyshka)


    Hi,

    I was checking the shortcode reference for to exclude product categories or restrict to certain product categories but could not find it.
    Could you please advise me how to do it?

    I am currently displaying in A-Z only products, but products of certain product categories should not be included.

    Thank you very much!

    Best regards
    Martin

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ethan Lin

    (@eslin87)

    The shortcode attribute for excluding particular product categories is exclude-terms. It accepts a comma-separated list of category term IDs, not category slugs.

    If you are using WooCommerce, product categories use the taxonomy slug product_cat. For example, to exclude product-category term IDs 123 and 456, use:

    [alphalisting display="posts" post-type="product" taxonomy="product_cat" exclude-terms="123,456"]

    You can find a product category’s term ID in Products → Categories in WordPress admin. Edit the category and look for tag_ID=123 in the page URL.

    If instead you want to display products from only certain product categories, use terms, which accepts term IDs or slugs:

    [alphalisting display="posts" post-type="product" taxonomy="product_cat" terms="shirts,hats"]

    The full list of supported attributes is available in the AlphaListing Shortcode Reference.

    Thread Starter Martin Freisinger

    (@martyshka)

    Hello,

    thank you very much, worked!

    Best regards

    Martin

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.