• File: assets/js/frontend/add-to-cart-variation.js

    Bug Found:

    Attributes are case sensitive and the dropdown for variations doing the same thing. But following method is alerting

    “Sorry, no products matched your selection. Please choose a different combination.”

    <strong>wc_add_to_cart_variation_params.i18n_no_matching_variations_text</strong>

    Problem found in this method:
    wc_variation_form_matcher.variations_match( variation.attributes, settings )

    Its matching lowercase with capitalized values. Please fix it, else we have to enter all small values in attributes. Or alternatively you can give a tooltip for attributes textarea that keep all small.

    Thanks,
    Fahad

    https://wordpress.org/plugins/woocommerce/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Can you present a test case I can reproduce this error? I.e. tell me what variations and attributes you have setup. Screenshots helpful.

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    Yes sure, just use the attributes like

    Cool|Wow|Awesome

    So you will have variation dropdowns and keep Cool as default. Then on single product page you will notice that a popup alert will appear that

    “Sorry, no products matched your selection. Please choose a different combination.”

    Implemented here but fixed: http://www.tutorslohop.net/product/premium-sessions-experience/

    I used all small words as “cool|wow|awesome”. If i will use capitalize so the same error will appear. Check it, on your end and see that your JavaScript method is matching as case insensitive.

    Thanks,
    Fahad

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    Yes sure, just use the attributes like

    Cool|Wow|Awesome

    So you will have variation dropdowns and keep Cool as default. Then on single product page you will notice that a popup alert will appear that

    “Sorry, no products matched your selection. Please choose a different combination.”

    *Implemented here but fixed: http://www.tutorsloop.net/product/premium-sessions-experience/

    I used all small words as “cool|wow|awesome”. If i will use capitalize so the same error will appear. Check it, on your end and see that your JavaScript method is matching as case insensitive.

    Thanks,
    Fahad

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    No issue my side. WC does not make these lowercase in the source; they are used as-is. So ‘Cool’ will match the attribute.

    Maybe your theme is changing the options in the select element.

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    Hi Mike,

    I tested it carefully and then reported you. Even i inspected your javascript method. When it compares the default value with the valued available in attribute so case sensitivity create problem. My theme is doing nothing with the dropdown values. Anyways, for now i just managed with all attributes to lowercase.

    Yes, you are right that WC is not changing them to lowercase or capitalize. This is my point that when we use capitalize so WC try to compare the given value with the default selection. And your default selection dropdown is having lowercase. I will send you another example in future, for now i can’t revert the things back because its a live work.

    Thanks,
    Fahad

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    You did not share your status report so I don’t know if your theme has a custom version of the template, but look, uppercase:

    https://dl.dropboxusercontent.com/s/r573hz6fxpsuhz6/2016-06-13%20at%2011.03.png?dl=0

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    Hi,

    Have a look here: http://image.prntscr.com/image/b91ca74e648047389303da667b2fc230.png

    I doubt

    if ( wc_variation_form_matcher.variations_match( variation.attributes, settings ) ) {
    matching.push( variation );
    }

    WooCommerce Product Variations (Capitalized):
    http://image.prntscr.com/image/314de94760884bfa9df24fe425118ab6.png

    WooCommerce Product Variations (Lowercase):
    http://image.prntscr.com/image/8cc661d443c947c29b5b70dc066599a7.png

    Implemented here

    Thanks,
    Fahad

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    Ok, leave it for now. I will check it some other time and report you with a sandbox environment.

    Hi Fahad — did you get a fix to this problem?

    I’m facing the same problem: if an attribute contains an uppercase letter, a word space, or any symbol character, the dropdown on the product listing page just says “choose an option” and won’t let the user see or select options.

    Product 1 (test1 | test2 | test3): http://hopscotchlondon.com/product/test-variable-product-2/

    Product 2 (test 1 | test 2 | test 3): http://hopscotchlondon.com/product/test-variable-product-2/

    It’d be great to find a workaround for this, as it’s really tricky naming variations and avoiding the characters that don’t work!

    Thanks in advance for your help!

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    I just changed variations to lowercase on my end, couldn’t hear from the support team about this fix.

    Hello Fahad.

    I am facing the same issue as well I guess

    here is my URL to add in cart

    xyz.com/cart/?add-to-cart=883&variation_id=985&attribute_packages=pro

    in backend my attributes are Free | Pro
    this was working fine till now but after updating 3.0.8 its not working.

    I guess its case sensitive Issue as i can see following url with capitle ‘P’ works fine

    xyz.com/cart/?add-to-cart=883&variation_id=985&attribute_packages=Pro

    I dont find any solution to this yet and as we have more then 500 products i can change the atribute values 🙁

    any thoughts in this ?

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    They never replied to this important thread in positive way. How may i help you? Try the same fix which i did earlier.

    I can see problem is in the following line under woocommerce\includes\class-wc-form-handler.php

    // Allow if valid or show error.
    if ( ” === $valid_value || $valid_value === $value ) {

    condition return fasle for Pro === pro :p

    i dont want to change the core file but i dont find a way to make $valid_value lowercase in my chidtheme 🙂 😀

    It was working fine I dont know what happend in new update

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    Suggest something to the WooCommerce team this time, everybody cannot make these fixes to core.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Product Variation (Attributes) – Bug’ is closed to new replies.