WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-ecommerce] Variants cause $0.00 and add to cart animation to stick (9 posts)

  1. Rachel George
    Member
    Posted 2 years ago #

    Hi there,
    I've just published a wp-ecommerce website located here: http://www.soulsistercreations.ca

    All products work fine, I am able to add them to the cart with no issues, there is one product however, the only product with variations here: http://soulsistercreations.ca/products-page/handmade-jewelry/adjustable-wooden-ring-4/

    There are two problems with this product: The "related products" widget underneath, all prices are set to $0.00, and the "add to cart" plays and hangs indefinately.

    When removing the variations, this problem is resolved, however I wish to use the variations.

    What I've done to test it:
    Removed variations - tested = works fine
    Created a new test variation from scratch - tested = same problem
    Ensured all variations have a price = same problem

    If anyone has any experience with this issue, or may know what's causing it, any help would be greatly appreciated.

  2. gopal1035
    Member
    Posted 2 years ago #

    My project does not use variations, so cannot say about that.

    But the add to cart update animation is showing the same characteristics. It gets stuck, and during that the number of times you click the button, that quantity is updated in cart.

    I am doing search on it to find a solution.

  3. gopal1035
    Member
    Posted 2 years ago #

    Found a solution to the animation issue, with help from my senior.

    You need to comment out an eval function in wp-e-commerce.js file.

    Here's how to go about it:

    1. Open /wp-content/plugins/wp-e-commerce/wpsc-core/js folder in your WordPress.
    2. Open file wp-e-commerce.js
    3. Search for this code
      jQuery.post( 'index.php?ajax=true', form_values, function(returned_data)

      It should be around line no. 248.

    4. Comment out
      eval(returned_data);

      written just below it (say using // at the beginning of line)

    5. Check your site's output in browser.
    6. If it works, save it.

    Hopefully, this will save your time and efforts.

    If it works, post this solution to other users/forums who have similar issues.

    P.S.: Just to be sure, the eval in question is with surrounded by this code:

    jQuery.post( 'index.php?ajax=true', form_values, function(returned_data) {
       //eval(returned_data);
    jQuery('div.wpsc_loading_animation').css('visibility', 'hidden');
  4. gopal1035
    Member
    Posted 2 years ago #

    @Rachel George

    Checked out your site. The animation issue seems to have resolved. Maybe you could share how you managed.

    Also, the + button on checkout page is not increasing the quantity.

    Warm regards
    Gopal

  5. easel
    Member
    Posted 2 years ago #

    Hi there

    Just adding a bump to this topic as I am having the same issue regarding product variations.

    Any suggestions would be most appreciated.

  6. menryan
    Member
    Posted 2 years ago #

    @easel

    Have you found a solution?

    I think the problem is on the wpsc_the_product_price function, when checking if variations exist for the related product:

    if ( ! empty( $wpsc_variations->first_variations )

    I created a function:
    function wpsc_product_variation_list()
    {
    $product_id = get_the_ID();
    return wp_get_object_terms($product_id, 'wpsc-variation');
    }

    then added it to the wpsc_the_product_price function as:

    if ( ! empty( $wpsc_variations->first_variations ) && count(wpsc_product_variation_list()) > 0 ) {

    I havent tested it 100% yet

  7. igloobob
    Member
    Posted 1 year ago #

    hello,

    did you manage to fix this variations issue?

    struggling with it on a site I'm working on.

  8. sjustdoit
    Member
    Posted 1 year ago #

    Hello,

    I followed what @gopal1035 mentioned, The issue I noticed with that is, You need to refresh the page in order to see the cart data (if you have cart displaying on the same page). Instead I would suggest you do this. This fixed my problem.

    1. Open /wp-content/plugins/wp-e-commerce/wpsc-core/js folder in your WordPress.
    2. Open file wp-e-commerce.js
    3. Search for this code :
    jQuery.post( 'index.php?ajax=true', form_values,function(returned_data) {
    eval(returned_data);
    jQuery('div.wpsc_loading_animation').css('visibility', 'hidden');
    ...
    ...
    }
    this is what you see,
    Now change the code to this :
    jQuery.post( 'index.php?ajax=true', form_values, function(returned_data) {
    jQuery('div.wpsc_loading_animation').css('visibility', 'hidden');
    eval(returned_data);
    ...
    ...
    }

    We are just moving the eval function after we hide the animation. This should solve the issue.

  9. Mike Thone
    Member
    Posted 1 year ago #

    I had this same issue where prices on my WPEC price was displaying as:
    from $0.00.

    Turns out that the products displaying this misleading price had some variations left in the trash with 0 set for price. Even though they were in the trash the wpsc_the_product_price(); function was grabbing it as the lowest price.

    Fix: Empty the trash on the items in question.
    Worked for me.

Topic Closed

This topic has been closed to new replies.

About this Topic