[etheme_products] for Tags - by Royalty - on WordPress WooCommerce support

This topic has 4 replies, 2 voices, and was last updated 6 years, 7 months ago ago by Rose Tyler

  • Avatar: Royalty
    Royalty
    Participant
    September 21, 2017 at 13:31

    Hello,
    with theme version3.0.2.1, I was using the [etheme_products] shortcode to filter products that had a specific tag like so:
    [etheme_products categories=”38,39,40″] while 38,39 and 40 where Tag IDs, not Category IDs.

    With version 3.1. this doesnt work anymore. The shortcode only works for categories and not for tags. What can I do in order to make it work for tags too like it was before?

    Many thanks in advance and best wishes!

    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 21, 2017 at 14:51

    Hello,

    I suppose it will be added in new theme update, so you may change this code
    http://prntscr.com/gnxa4a to http://prntscr.com/gnxab8 in framework/shortcode.php file of your parent theme

    $args['tax_query'][] = array(
        'relation' => 'OR',
        array(
           'taxonomy' => 'product_tag',
           'terms' => $categories,
           'operator' => 'IN',
           ),
        array(
           'taxonomy' => 'product_cat',
           'terms' => $categories,
           'operator' => 'IN',
           )
       );

    Regards

    Avatar: Royalty
    Royalty
    Participant
    September 21, 2017 at 17:43

    Yay that did the trick, thank you so much!
    Could you imagine to include the provided code in the next update?

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 22, 2017 at 07:50

    Hello,

    You’re welcome!
    Yes, it will be added in next theme update.

    Regards

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.