Empty Cart Button not working in shopping cart widget view


I've added the "show shopping cart" function in my customized files of mp_store like this:


Everything works very well except for the "Empty Cart" button. When I click on the button it turned into the loading image, but then nothing happens. Shouldn't it automatically refresh the page and show an empty cart?

I know that some parts of the function is working because when I manually hit the refresh button of the browser, the shopping cart becomes empty.

Does anyone encounter this problem? Any help would be really appreciated!


  • littlemkv


    Some further problems I discovered are that actually AJAX is not working on the site. I believe the empty cart has something to do with AJAX. Other than that, I realize my shopping cart item # is not updating real-time as well. When I hit "Add to Cart" on the product page, my cart that I display by using mp_show_cart('widget'); is not updating. I also use the code <?php echo mp_items_count_in_cart(); ?> to show the # of items currently in the cart but that's not updating real-time as well...

    I'm using the Simple Market Theme as a parent theme.

    Any help on this problem please?

    Thank you!

  • digitsoft

    Based on what you just said it sounds as though the base install is NOT working.
    You need to start from a working environment before adding child themes and custom coding....

    1. Save your custom files and backup your database
    2. Deactivate the plugin, delete it, download a fresh copy, upload it, and then activate it.
    3. Activate a basic theme like Twenty Eleven or Ten for testing.

    Once you have a fully functional base system then you can start using parent/child themes and writing custom code.

    If you don't want to figure out how to code a custom theme, I suggest posting a job here:

  • littlemkv

    Hi digitsoft,

    Thank you for your suggestions. After a clean installation of the Simple Market Theme as my parent theme, I was still not able to solve to problem.

    But after I investigated some more, I got the Add Item and Empty Cart to work by using the "Shopping Cart" widget instead of using the mp_show_cart('widget'); code. It seems kind of weird to me because I thought they are pretty much the same.

    Still no luck with the mp_items_count_in_cart. The number is not updating real-time. I'm suspecting it may be a bug in the theme itself, because when I put mp_items_count_in_cart in the sidebar.php file in a clean Simple Market Theme it doesn't work either.

  • littlemkv


    Thank you all for your help. I'm really suspecting whether it is a theme issue now.

    Here are what I've done:
    I was troubleshooting the issue by changing different themes. Both simplemarket and twenty eleven doesn't work, BUT the FrameMarket with child theme GridMarket DOES.

    I've installed on my localhost a clean WordPress 3.3.1 with default Twenty Eleven theme, then install the clean Markpress 2.5.9 (the latest) and activate it. Created a product, put the shopping cart widget in the footer sidebar and have put the code mp_items_count_in_cart in the sidebar-footer.php. Then on the site, I go to the product page and click 'add to cart'. The shopping cart works perfectly (updating instantly when I click empty cart, add to cart again.) But the number on mp_items_count_in_cart is still not working.

    So I'm thinking is there something in the FrameMarket/GridMarket theme that I need? Because it seems like all other themes can't get that to work.

    I really appreciate all of your help and prompt replies! :slight_smile:

  • aecnu

    Greetings littlemkv,

    I've installed on my localhost a clean WordPress 3.3.1

    Why did you not install WP 3.3.2 which has been out for quite awhile?

    This is in fact the version of WordPress that you should be running :slight_smile:

    But the number on mp_items_count_in_cart is still not working.

    I have confirmed this bug and report to the lead developer that it is indeed still occurring with the last version being 2.5.9

    I've installed on my localhost

    Just out of my own curiosity and possibly not related to some of the issues you are having, but how come you have not taken the leap to a live server?

    The reason why I ask this is that there are so many people on here that have tried the localhost thing and the moment they went live their installation worked fine and indeed the opposite, they develop on their localhost and when they go live their site completely fails?

    Why bother when you can get REAL hosting for $4 a month? I just don't get it and would appreciate some insight into this phenomenon.

    Looking forward to helping to get these issues resolved.

    Please advise.

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.