• Resolved Mohsin Rasool

    (@mohsinrasool)


    I am encountering a weird issue, at least it seems weird to me, it might be a woocommerce functionality. I added a woocommerce products, changed to variable product, added an attribute “Design” with two values “Paradise|Hope”, generated variations and set up their pricing. When viewed this product on frontend, the dropdown had both variations but as soon as page stopped loading, they removed by the javascript.

    I worked on woocommerce/assets/js/frontend/add-to-cart-variation.min.js, in a hope to disable the cross check functionality, I commented out some part of the code. That did the trick, it started to show up but when selected and added to cart, I get the error “Please select the product variation”.

    Right now, I have original WooCommerce files and variations setup. On product page, I am getting JS error “Sorry, no product matched your selection. Please select different product”. I am kinda newbie at WooCommerce, I may have missed a step or not getting the workflow properly. Please enlighten me what else can I try to fix?

    I have also tried disabling all other plugins and upgrading to latest version. Product page can be viewed here http://tinyurl.com/gp8fazn

    Thanks

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    It definitely sounds like you have a conflict of some sort occurring.

    First, replace your WooCommerce plugin folder with a freshly downloaded copy that hasn’t been tampered with.

    Then try temporarily switching back to the WordPress Twenty Sixteen Theme, or Storefront, and disable all plugins except for WooCommerce and test again. If that resolves the issue, then slowly re-enable features until you find the one that’s causing the conflict.

    Thread Starter Mohsin Rasool

    (@mohsinrasool)

    Thanks Caleb for your input. I have already tried above suggestions. None worked.

    I figure out that the variation values are same as the label. In the same add-to-cart-variation.min.js, there are two places where variation values needs to be fixed.

    Line # 381: “attached” class added to variations. I added attr_val = attr_val.replace( / /g, '-' ).toLowerCase(); just below the attr_val = attr_val.replace( /"/g, '\\\"' );

    Line # 438: It is a variations_match function. To fix this I added val1 = val1.replace( / /g, '-' ).toLowerCase(); just below the val1 = val1.replace( /"/g, '\\\"' );

    Above two changes fixed my issue. I have no idea why variation values were not changing to slugs. But this fixed the issue.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Product variations dropdown get empty after load’ is closed to new replies.