News:

Looking for documentation? Take a look on our wiki

Main Menu

Add to Cart Pop UP - How to deactivate

Started by wemblystiggs, August 08, 2012, 16:09:04 PM

Previous topic - Next topic

wemblystiggs

Hi All

Our site is nearly up and running, however I have a niggle and it is the add to cart pop up!

I want to remove it, we have a nice cart drop down at the top of the page that shows how many items and total value passively and drops down to show the actual product when you hover over it, as well as a nice effect where the product zooms up to it when you click add to cart, so we don't really see a need for this pop up, it only gets in the way and creates another unnessesary click of the mouse.

I have checked in configuration and the add to cart pop up check box is unchecked

Its a facebox pop up I believe from looking through firebug.

Any  Ideas on its removal?

Using VM 2.0.6 and Joomla 2.5.4

I have tried searching but the only thread that came up was a 1.X question and I already checked the above mentioned fix.

Thanks

Wembly!

ivus

Hi wemblystiggs,

What you want to do is a core hack. Be aware that any changes here may get overwritten when you do an automatic update.

Your solution: file "/components/com_virtuemart/assets/js/vmprices.js"

the function you want to remove can be found in the sub-function of "cartEffect : function(form) {}" @ line 58

Here's the original code:



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"));
}
});



Change it to this:



function(datas, textStatus) {
if(datas.stat ==1){
//var value = form.find('.quantity-input').val() ;
var txt = form.find(".pname").val()+' '+vmCartText;
} else if(datas.stat ==2){
var value = form.find('.quantity-input').val() ;
var txt = form.find(".pname").val();
}
if ($(".vmCartModule")[0]) {
Virtuemart.productUpdate($(".vmCartModule"));
}
});



The pop-up will now be gone, but all other cart functions will remain. To test, you should b able to see your cart box info updating without any JS errors.

I hope this helps.  ;D

wemblystiggs

Thank you! You are a star! will try this when I get home tonight :)

wemblystiggs

Have done this, worked really well, now looks uber slick when I add a product to the cart, thanks :)

;D ;D ;D ;D ;D ;D