WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Error in line no.3 add-to-cart-variation.js (2 posts)

  1. oumz99
    Member
    Posted 11 months ago #

    When I started developing my custom theme Overriding the templates the Woocommerce version was 1.6.6 and now it is 2.0.9. So, I am not sure if this is a theme issue or a woocommerce bug, I have regularly updated all woocommerce template overriding files but I still get this js error.

    I get this error in product variations where I do not see the add to cart button & quantity selection.
    I was debugging and found that
    in line no 128 of add-to-cart-variation.js ,
    if you interchange two lines everything works correctly that is placing the last if condition first:

    if ( ! all_variations )
    						all_variations = window[ "product_variations_" + product_id ];

    making it to
    change lines 128 to 135

    // Fallback to window property if not set - backwards compat
                                            if ( ! all_variations )
    						all_variations = window[ "product_variations_" + product_id ];
    
    					if ( ! all_variations )
    						all_variations = window[ "product_variations" ][ product_id ];
    					if ( ! all_variations )
    						all_variations = window[ "product_variations" ];

    If above suggested solution is not right. Any ideas where I might be going wrong?

    http://wordpress.org/extend/plugins/woocommerce/

  2. oumz99
    Member
    Posted 11 months ago #

    Never mind.
    It is fixed I forgot to update the singleproduct -> Add to cart templates.

    Resolved.

Reply

You must log in to post.

About this Plugin

About this Topic