Home Forums WoodMart support forum Bug in Products (grid or carousel)

Bug in Products (grid or carousel)

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #53203

    MoeMauphie
    Participant

    Hi there,

    I’m using “Products (grid or carousel)” element to display products from a certain category (ex. Racquets) and a certain brand (ex. Wilson). But When I chose the two taxonomies, it doesn’t pull the right products based on them. In case of my examples, I don’t get Wilson racquets when I choose the category of “racquets” and the “Wilson” brand.

    Thanks

    #53219

    MoeMauphie
    Participant

    Sorry, I really need this feature, would you think it can be solved? Or I need to think of other solutions?

    Thanks,

    #53269

    Artem Temos
    Keymaster

    Hi,

    We tested this function on our development website and it works correctly. Could you please provide us a page where you added it and your admin access so we can check it?

    Thank you

    #53274

    MoeMauphie
    Participant

    Thanks for your reply,

    Actually it’s a logical issue, if you choose multiple taxonomies, by default, it combines them using “OR”, which is not always helpful. As for my example, I want to show products that belong to a specific category (Racquets) “AND” a specific brand (Wilson).

    Thanks

    #53278

    Artem Temos
    Keymaster

    You can edit the file woodmart/inc/shortcodes/products.php

    and change this line

    if( count( $terms ) > 1 ) $args['tax_query']['categories'] = array( 'relation' => 'OR' );

    to this

    if( count( $terms ) > 1 ) $args['tax_query']['categories'] = array( 'relation' => 'AND' );

    #53284

    MoeMauphie
    Participant

    Thanks a lot, it worked like a charm.

    By the way, that would be great if we could have a feature in your future updates to define logical operators for taxonomies.

    Many thanks,

    #53292

    Artem Temos
    Keymaster

    We will consider adding some options for this in the future.

Viewing 7 posts - 1 through 7 (of 7 total)