Add to cart - continue shopping stay on page with no reload. And a gap :)

Started by gripped, May 14, 2014, 10:43:08 AM

Previous topic - Next topic

gripped

I found the ajax add to cart frustrating. You add to cart without a reload. But continue shopping takes you away from the product page and reloads ?
If like me you've added 'add to cart' to the category list it reloads.
Plus there is no gap between Continue ShoppingShow Cart (like that) if its's the first of a product added.

With the help of this thread http://forum.virtuemart.net/index.php?topic=105390.0 I have solved both with the change of one line.

copy
components/com_virtuemart/views/cart/tmpl/padded.php
to
templates/YOURTEMPLATE/html/com_virtuemart/cart/padded.php

Change this line (line 23 as of 2.6.0a)
echo '<a class="continue" href="' . $this->continue_link . '" >' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
to
echo '<a class="continue" href="javascript:void(0);" onclick="jQuery.fancybox.close();" >' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>&nbsp;&nbsp;';

This is for fancybox but I'm sure it could be modified for facebox.

In my humble opinion this is how it should work as standard.

Seems to work fine but there may well be a better way.

Milbo

It makes not really sense to let the customer on the same product page, which he just put in the cart.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

gripped

 :)
I did say it's only my opinion. But it makes perfect sense for me and my shop. It doesn't make any-more sense to be returned to the first page of the category you were browsing
And there are a number of threads on the forum where people have sought help on the same thing.

As I said in the first post I have overidden components/com_virtuemart/views/category/tmpl/default.php to show add to cart (another thing that would be great as an option)
From here I think http://forum.virtuemart.net/index.php?topic=90961.150.
And when used in this way it makes even less sense to take the customer to the first page of the category.

Done like this is smoother. IMHO (especially when combined with VM AddToCart Effect CK)

The reason I made a new topic is the one I linked to in the FP was buried deep on my searches. But it was the simplest solution and the least hacky. I just changed it to prevent the page reload.

Let me take this opportunity to thank you, and all the other devs, for Virtuemart.  :)

craftyweb

I'd agree gripped. Having the continue shopping button simply closing the ajax add to cart popup. Is what I'd want also.

It may be that there are other variants, or related items, which the customer would like to add to the cart also. Personally I feel redirecting to another page is a waste of time and resources.
Joomla: 2.5.20
VirtueMart 2.0.26d

Milbo

So you can still be happy, becaus you can change it with a simple layout override. You have additionally the related products and categories.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Ruup

I've made this change also and it works fine.
But there's a problem: ''continue shopping'' and ''to shopping cart'' were buttons in my template style and they are gone now.  So the layout of that window is gone.
How can i fix this.