News:

Looking for documentation? Take a look on our wiki

Main Menu

Add to cart and Continue shopping

Started by sumo49, October 16, 2012, 00:25:29 AM

Previous topic - Next topic

sumo49

Hello all,

I can't find any help in the french forums, so I try here (and hope I'll make myself understood :)
I'm using Joomla 2.5.7 and Virtuemart 2.0.10. (localhost)

The links "Add to cart" generally open a "Continue shopping / View cart" popup.
I removed this option in VM2, so I get redirected to the cart page each time I select a product.

What I'd like is to replace the "Add to cart" link by the "Continue shopping" one.
In short, when I select a product by clicking on the "Add to cart" button, I want the product to add in the mini-cart only (and me to stay on the same page to carry on selecting my products). I  want to be redirected to cart page only by clicking on the link "View cart" in the mini-cart.

It's somewhere in Components/com_virtuemart/controllers/cart.php OR Components/com_virtuemart/views/category/tmpl/default.php OR Components/com_virtuemart/views/cart/view.html.php... but I can't find it...

Could someone help me ?

Merci beaucoup !

Sumo49

peteritv

Hi there!

I had the same problem, and couldn't find the answer on this forum, so I decided to solve the problem myself:

You have to find and edit the javascript file : vmprices.js

Then replace
         cartEffect : function(form) {

               var $ = jQuery ;
               $.ajaxSetup({ cache: false })
               var datas = form.serialize();
               $.getJSON(vmSiteurl+'index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json'+vmLang,encodeURIComponent(datas),
               function(datas, textStatus) {
                  if(datas.stat ==1){
                     //var value = form.find('.quantity-input').val() ;
                     var txt = form.find(".pname").val()+' '+vmCartText;
                                       $.facebox.settings.closeImage = closeImage;
                                       $.facebox.settings.loadingImage = loadingImage;
                                       $.facebox.settings.faceboxHtml = faceboxHtml;
                     $.facebox({ text: datas.msg +"<H4>"+txt+"</H4>" }, 'my-groovy-style');
                  } else if(datas.stat ==2){
                     var value = form.find('.quantity-input').val() ;
                     var txt = form.find(".pname").val();
                                       $.facebox.settings.closeImage = closeImage;
                                       $.facebox.settings.loadingImage = loadingImage;
                                       $.facebox.settings.faceboxHtml = faceboxHtml;
                     $.facebox({ text: datas.msg +"<H4>"+txt+"</H4>" }, 'my-groovy-style');
                  } else {
                                       $.facebox.settings.closeImage = closeImage;
                                       $.facebox.settings.loadingImage = loadingImage;
                                       $.facebox.settings.faceboxHtml = faceboxHtml;
                     $.facebox({ text: "<H4>"+vmCartError+"</H4>"+datas.msg }, 'my-groovy-style');
                  }
                  if ($(".vmCartModule")[0]) {
                     Virtuemart.productUpdate($(".vmCartModule"));
                  }
               });
               $.ajaxSetup({ cache: true });
         },

by
         cartEffect : function(form) {

               var $ = jQuery ;
               $.ajaxSetup({ cache: false })
               var datas = form.serialize();
               $.getJSON(vmSiteurl+'index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json'+vmLang,encodeURIComponent(datas),
               function(datas, textStatus) {
                  if ($(".vmCartModule")[0]) {
                     Virtuemart.productUpdate($(".vmCartModule"));
                  }
               });
               $.ajaxSetup({ cache: true });
         },

This saves the data in the minicart, and prevents the popup from showing --> Mission Complete  :)

redlo

Good, but now I need to return to virtuemart or category virtuemart when I made a click. How can I do?

Thanks
Ayudo en todo lo que puedo, con tutoriales, traducciones, y alguna que otra extension, como modulos y plugins.