Support » Plugin: WP eCommerce » error on "Empty your cart" from sidebar widget

  • I have the Shopping Cart widget in the sidebar and after I’ve added products to the cart and then click on “Empty your cart” I get the following error message:

    {“widget_output”:”\n\t
    Your shopping cart is empty<\/p>\n\t

    \n\t Visit the shop<\/a>\n\t<\/p>\n\n”,”core_images_url”:”http:\/\/www.goodgossiping.com\/justbcosmetics\/wp-content\/plugins\/wp-e-commerce\/wpsc-core\/images”,”sliding_cart_state”:”hide”}

    http://wordpress.org/plugins/wp-e-commerce/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Mihai Joldis

    (@misulicus)

    What WPEC version are you using ?
    Can you test in the default 2010 theme to rule out a theme issue ?
    Regards
    Mihai

    I just upgraded to Version 3.8.13.3.

    I will try to test in the 2010 soon and let you know.

    Just tested with 2010 and got the same error.

    Just guessing, but that text looks like what is returned in the AJAX JSON response from the empty cart function.

    If you have google chrome can you open up the “inspect” panel and empty the cart? I am curious if there is a javascript error being thrown that prevents the response from being interpreted? If there is such an error it may display in the chrome console.

    I opened the “inspect” panel, went to the console tab then emptied cart and no errors were displayed.

    Plugin Author Mihai Joldis

    (@misulicus)

    Ok so did some test on your website. Problem is indeed in your theme.
    I looked at the codes in your theme and on my local setup with the default 2010 them enabled. And there are some differences.

    Your site has something like this:

    <form action="" method="post" class="wpsc_empty_the_cart">
    		<input type="hidden" name="wpsc_ajax_action" value="empty_cart">
    		<span class="emptycart">
    			<a target="_parent" href="/justbcosmetics/wp-admin/admin-ajax.php?wpsc_ajax_action=empty_cart">Empty your cart</a>
    		</span>
    	</form>

    Default theme has:

    <form action="" method="post" class="wpsc_empty_the_cart">
    						<input type="hidden" name="wpsc_ajax_action" value="empty_cart">
    							<a target="_parent" href="/testwp/wp-admin/admin-ajax.php?wpsc_ajax_action=empty_cart" class="emptycart" title="Empty Your Cart">Clear cart</a>
    					</form>

    `

    See the differences ?
    In your code if you remove the span and add to the href link: class=”emptycart” then your widget will work. I believe the theme is altering the html of the widget or you have made changes to the theme file yourself.

    Regards
    Mihai

    Thank you so much! I’ll give that a shot and let you know what happens. Not sure I’ll do it today but definitely by Monday. Thanks again!

    Just now checking on this code and it’s not coming from my theme files. It appears to be coming from the plugin files, specifically this one, wpsc-cart_widget.php. I can try removing the span you mentioned but won’t it just come back on the next upgrade of the plugin?

    I removed the span and I’m still getting the error:
    {“widget_output”:”\r\n\t
    Your shopping cart is empty<\/p>\r\n\t

    \r\n\t Visit the shop<\/a>\r\n\t<\/p>\r\n\r\n”,”core_images_url”:”http:\/\/www.goodgossiping.com\/justbcosmetics\/wp-content\/plugins\/wp-e-commerce\/wpsc-core\/images”,”sliding_cart_state”:”hide”}

    I don’t write php code but could it be in this code of the wpsc-cart_widget.php file?

    <?php else: ?>
    <p class=”empty”><?php echo __(‘Your shopping cart is empty’, ‘wpsc’); ?></p>
    <p class=”visitshop”>
    “><?php echo __(‘Visit the shop’, ‘wpsc’); ?>
    </p>
    <?php endif; ?>

    Plugin Author Mihai Joldis

    (@misulicus)

    That is different. As you can see there is an if clause there.
    You can try posting a premium support topic on getshopped.org and have the guys look at it.
    Regards
    Mihai

    Maybe there was some confusion. The error in question is not different. I just copied part of the plugin widget code for a suggestion as to where the error might be coming from. Are there any other sites you know of that are using your sidebar widget that I could try?

    Thought reinstalling the widget might fix it but it doesn’t. Same issue. “add to the href link: class=”emptycart” then your widget will work” works but how can this class be missing from the widget link? Where is this file so I can modify it?

    I tried reinstalling the widget also, but it didn’t fix the issue. I’m glad to know I’m not the only one getting this error as the plugin author doesn’t think he has a problem that needs fixing.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘error on "Empty your cart" from sidebar widget’ is closed to new replies.