Support » Plugin: WooCommerce » I want to filter products by attributes with AND logic

  • Resolved bigdropgr

    (@bigdropgr)


    All my products are sandals and bags and all of them are variable products. For example a sandal have variations: Color, Texture, Style, Heel Type and Size.
    When I filter products on the shop page I use for example Color: Red and Texture: Fabric. As a result I get all the products that might have Red color Or Fabric. I need this to work with AND logic.

    Let me give you a more detailed example.
    Product name: Sandal Apollo
    Colors: Red, Natural and Black
    Texture: Leather and Fabric
    Size: 44,45,46
    It has variations like this:
    Red – Leather – Any size
    Natural – Leather – Any size
    Black – Fabric – Any size

    If I search for Red sandals with Fabric (texture), I will get in result the above example sandal also. This is wrong since Red and Fabric are not in the same variation.

    How to make this work properly?

    Below I have pasted the status report.

    
    ### WordPress Environment ###
    
    WordPress address (URL): http://sandals.tsite.eu
    Site address (URL): http://sandals.tsite.eu
    WC Version: 3.8.1
    REST API Version: ✔ 1.0.2
    Log Directory Writable: ✔
    WP Version: ❌ 5.3 - There is a newer version of WordPress available (5.3.2)
    WP Multisite: –
    WP Memory Limit: 2 GB
    WP Debug Mode: –
    WP Cron: ✔
    Language: en_US
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: LiteSpeed
    PHP Version: 7.3.12
    PHP Post Max Size: 28 MB
    PHP Time Limit: 3000
    PHP Max Input Vars: 10000
    cURL Version: 7.67.0
    OpenSSL/1.0.2t
    
    SUHOSIN Installed: –
    MySQL Version: 5.7.28
    Max Upload Size: 28 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    WC Database Version: 3.8.1
    WC Database Prefix: wp_
    MaxMind GeoIP Database: ✔
    Total Database Size: 42.08MB
    Database Data Size: 33.32MB
    Database Index Size: 8.76MB
    wp_woocommerce_sessions: Data: 1.22MB + Index: 0.07MB + Engine MyISAM
    wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_order_items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_order_itemmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_commentmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_comments: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_duplicator_packages: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_icl_content_status: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_core_status: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_flags: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_languages: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_icl_languages_translations: Data: 0.11MB + Index: 0.11MB + Engine MyISAM
    wp_icl_locale_map: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_message_status: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_mo_files_domains: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_node: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_reminders: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_strings: Data: 3.18MB + Index: 2.55MB + Engine MyISAM
    wp_icl_string_packages: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp_icl_string_pages: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_icl_string_positions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_string_status: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_string_translations: Data: 1.90MB + Index: 0.56MB + Engine MyISAM
    wp_icl_string_urls: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_icl_translate: Data: 0.82MB + Index: 0.15MB + Engine MyISAM
    wp_icl_translate_job: Data: 0.01MB + Index: 0.01MB + Engine MyISAM
    wp_icl_translations: Data: 0.37MB + Index: 0.71MB + Engine MyISAM
    wp_icl_translation_batches: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_icl_translation_downloads: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_icl_translation_status: Data: 1.93MB + Index: 0.11MB + Engine MyISAM
    wp_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_options: Data: 4.43MB + Index: 0.15MB + Engine MyISAM
    wp_postmeta: Data: 12.29MB + Index: 2.59MB + Engine MyISAM
    wp_posts: Data: 4.36MB + Index: 0.71MB + Engine MyISAM
    wp_revslider_css: Data: 0.09MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_css_bkp: Data: 0.09MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_layer_animations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_layer_animations_bkp: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_navigations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_navigations_bkp: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_sliders: Data: 0.08MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_sliders_bkp: Data: 0.08MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_slides: Data: 0.82MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_slides_bkp: Data: 0.88MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_static_slides: Data: 0.02MB + Index: 0.00MB + Engine MyISAM
    wp_revslider_static_slides_bkp: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_termmeta: Data: 0.08MB + Index: 0.08MB + Engine MyISAM
    wp_terms: Data: 0.08MB + Index: 0.16MB + Engine MyISAM
    wp_term_relationships: Data: 0.17MB + Index: 0.38MB + Engine MyISAM
    wp_term_taxonomy: Data: 0.06MB + Index: 0.10MB + Engine MyISAM
    wp_usermeta: Data: 0.03MB + Index: 0.03MB + Engine MyISAM
    wp_users: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wc_product_meta_lookup: Data: 0.04MB + Index: 0.09MB + Engine MyISAM
    wp_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woodmart_wishlists: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woodmart_wishlist_products: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woos_search_trends: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_yith_wcwl: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_yith_wcwl_lists: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_yoast_seo_links: Data: 0.03MB + Index: 0.02MB + Engine MyISAM
    wp_yoast_seo_meta: Data: 0.04MB + Index: 0.04MB + Engine MyISAM
    
    ### Security ###
    
    Secure connection (HTTPS): ❌
    					Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
    Hide errors from visitors: ✔
    
    ### Active Plugins (24) ###
    
    WPML Multilingual CMS: by OnTheGoSystems – 4.3.5
    Yoast SEO Multilingual: by OnTheGoSystems – 1.0.3
    CMB2: by CMB2 team – 2.6.0
    Contact Form 7: by Takayuki Miyoshi – 5.1.6
    Duplicator: by Snap Creek – 1.3.24
    PayPal Express Checkout Payment Gateway for WooCommerce ( Basic ): by WebToffee – 1.4.1
    WPBakery Page Builder: by Michael M - WPBakery.com – 6.0.5
    MC4WP: Mailchimp for WordPress: by ibericode – 4.7.4
    Slider Revolution: by ThemePunch – 6.1.5
    Safe SVG: by Daryll Doyle – 1.9.6
    Greeklish Slugs: by Kostas Charalampidis – 1.1.3
    Transients Manager: by Pippin Williamson – 1.8
    WooCommerce Bulk Edit Product Variations: by matterico_themes – 2.7 – Not tested with the active version of WooCommerce
    WooCommerce Country Restrictions - Advanced Pro: by WP Super Admins – 1.7.0.1 – Not tested with the active version of WooCommerce
    WooCommerce Bulk Discount: by Rene Puchinger – 2.4.5 – Not tested with the active version of WooCommerce
    WooCommerce Multi Currency Premium: by VillaTheme – 2.1.7 – Not tested with the active version of WooCommerce
    WooCommerce Multilingual: by OnTheGoSystems – 4.7.5
    WooCommerce: by Automattic – 3.8.1
    Woodmart Core: by  – 1.0.20
    Yoast SEO Premium: by Team Yoast – 12.5
    WPML Media: by OnTheGoSystems – 2.5.5
    WPML String Translation: by OnTheGoSystems – 3.0.5
    WPML Translation Management: by OnTheGoSystems – 2.9.3
    YITH WooCommerce Wishlist: by YITH – 3.0.1
    
    ### Inactive Plugins (0) ###
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: EUR (€)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    
    ### WC Pages ###
    
    Shop base: #10 - /shop/
    Cart: #11 - /cart/
    Checkout: #12 - /checkout/
    My account: #13 - /my-account/
    Terms and conditions: #1629 - /privacy-policy/
    
    ### Theme ###
    
    Name: Woodmart Child
    Version: 1.0.0
    Author URL: http://xtemos.com
    Child Theme: ✔
    Parent Theme Name: Woodmart
    Parent Theme Version: 4.3.0
    Parent Theme Author URL: http://themeforest.net/user/xtemos
    WooCommerce Support: ✔
    
    ### Templates ###
    
    Overrides: woodmart/woocommerce/archive-product.php
    woodmart/woocommerce/cart/cart-item-data.php
    woodmart/woocommerce/cart/cart.php
    woodmart/woocommerce/cart/cross-sells.php
    woodmart/woocommerce/cart/mini-cart.php
    woodmart/woocommerce/checkout/form-checkout.php
    woodmart/woocommerce/checkout/thankyou.php
    woodmart/woocommerce/content-product.php
    woodmart/woocommerce/content-product_cat.php
    woodmart/woocommerce/content-single-product.php
    woodmart/woocommerce/content-widget-product.php
    woodmart/woocommerce/global/breadcrumb.php
    woodmart/woocommerce/global/form-login.php
    woodmart/woocommerce/global/quantity-input.php
    woodmart/woocommerce/loop/add-to-cart.php
    woodmart/woocommerce/loop/loop-end.php
    woodmart/woocommerce/loop/loop-start.php
    woodmart/woocommerce/loop/no-products-found.php
    woodmart-child/woocommerce/loop/orderby.php
    woodmart/woocommerce/loop/pagination.php
    woodmart/woocommerce/loop/sale-flash.php
    woodmart/woocommerce/myaccount/form-login.php
    woodmart/woocommerce/product-searchform.php
    woodmart/woocommerce/single-product/add-to-cart/grouped.php
    woodmart/woocommerce/single-product/add-to-cart/variable.php
    woodmart/woocommerce/single-product/meta.php
    woodmart/woocommerce/single-product/product-image.php
    woodmart/woocommerce/single-product/product-thumbnails.php
    woodmart/woocommerce/single-product/rating.php
    woodmart/woocommerce/single-product/related.php
    woodmart/woocommerce/single-product/sale-flash.php
    woodmart/woocommerce/single-product/tabs/tabs.php
    woodmart/woocommerce/single-product/title.php
    woodmart/woocommerce/single-product/up-sells.php
    woodmart/woocommerce/single-product.php
    
    ### Action Scheduler ###
    
    Complete: 5
    Oldest: 2019-11-19 19:28:29 +0000
    Newest: 2019-12-17 20:30:49 +0000
    
    Pending: 1
    Oldest: 2019-12-24 20:30:49 +0000
    Newest: 2019-12-24 20:30:49 +0000
    
    Canceled: 0
    Oldest: –
    Newest: –
    
    In-progress: 0
    Oldest: –
    Newest: –
    
    Failed: 0
    Oldest: –
    Newest: –
    
    

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Grigorij S. a11n

    (@grigaswp)

    Hi there,

    Thank you for reaching out!

    I understand that you’re using the “Product Filters – Attribute” widget but when certain attributes are selected, the search result displays the whole product including variations which do not have the attributes you’re searching for.

    Indeed, with WooCommerce by default, the search and filtering results display variable products as a whole and not as separate variations. Since this particular product has the attributes you’re looking for – the whole product is displayed, and changing this will require an additional plugin or some custom coding.

    You could use a plugin like this one in order to only view particular variations instead of whole variable products:

    https://woocommerce.com/products/products-by-attributes-variations-for-woocommerce/

    Here’s the documentation of this plugin:

    https://docs.woocommerce.com/document/products-by-attributes-variations/

    There must be other plugins capable of such functionality.

    I hope this helps!

    Thread Starter bigdropgr

    (@bigdropgr)

    Hi,

    Thank you for your reply. This plugin that you recommend shows the variations as different products.
    This is not what I want. I need the search function to work properly.

    Please check this image https://ibb.co/tx0cRRK

    I have 5 variations, like this:
    Metallic Gold – Leather – Platform – Back Strap – Any Women Size
    Pink – Nubuck – Flat – Back Strap – Any Women Size
    Ochra – Nubuck – Flat – Back Strap – Any Women Size
    Beige – Nubuck – Flat – Back Strap – Any Women Size
    Lilac – Nubuck – Flat – Back Strap – Any Women Size

    Now if I search for “Metallic Gold” & “Nubuck” it will show the above product in the results. This is wrong, because none of the variations has the to attributes at the same time. There is no variation with color “Metallic Pink” and texture “Nubuck”.

    I have set the search widget “Filter Products by Attribute” and Query type to “AND” but is still shows all the products.

    Plugin Support Tseten D a11n

    (@tibetanitech)

    Hi @bigdropgr,

    You can check this plugin: https://wordpress.org/plugins/woocommerce-ajax-filters/

    It looks like this will do the job in their pro version. They also have a demo site to test the admin backend: https://berocket.com/product/woocommerce-ajax-products-filter?utm_source=wordpress_org&utm_medium=admin_demo&utm_campaign=ajax_filters#try-admin

    Please note that we are unable to help provide support for 3rd party plugins here, so if you have any questions regarding, it is best if you contact the plugin developer.

    Thread Starter bigdropgr

    (@bigdropgr)

    I am a bit confuse.
    Attributes are “part” of woocommerce.
    Wocommerce also provide the “filter products by attribute” functionality.
    But in order to use this I need to pay a third party plugin?
    So, if it is now working and we need a third party plugin, why there is the “filter products by attribute” option in widgets?

    Plugin Support Tseten D a11n

    (@tibetanitech)

    Hi @bigdropgr,

    I understand you are not sure why we are recommending another plugin to achieve your requirements by using WooCommerce core “Filter products by attributes” functionality to filter based on “AND” and “Attributes”.

    When using WooCommerce core filter: when you search for “Metallic Gold” & “Nubuck” attributes, it will display products that have attribute “Metallic Gold” and as well as those products that have the “Nubuck” attribute.

    I hope this clears your confusion.

    Plugin Support Tseten D a11n

    (@tibetanitech)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘I want to filter products by attributes with AND logic’ is closed to new replies.