News:

Support the VirtueMart project and become a member

Main Menu

Add-to-cart pop-up auto-close

Started by peizamo, August 29, 2012, 20:01:05 PM

Previous topic - Next topic

peizamo

Not sure if this is the correct area for this topic but here it is anyway.

Where should I modify the Add to cart -code to automatically close the add-to-cart pop-up after few seconds? I think it's just one more useless click for the customer to close the pop up.

Any help appreciated!

:)

scorp2000

one way is to disable popup... from admin side..

if this way is not a way for then .. here is a cheap way  ;)

go to
components->com_virtuemart->assests->css
at line 3 change z-index to -100

#facebox {
  position: absolute;
  z-index: -100;
  text-align: left;
}
then goto line 70 change z-index to -100

#facebox_overlay {
  z-index: -100;
  position: fixed;
  top: 0px;
  left: 0px;
  height:100%;
  width:100%;
}

cheers



peizamo

Quote from: scorp2000 on September 03, 2012, 23:35:18 PM
one way is to disable popup... from admin side..

if this way is not a way for then .. here is a cheap way  ;)

go to
components->com_virtuemart->assests->css
at line 3 change z-index to -100

#facebox {
  position: absolute;
  z-index: -100;
  text-align: left;
}
then goto line 70 change z-index to -100

#facebox_overlay {
  z-index: -100;
  position: fixed;
  top: 0px;
  left: 0px;
  height:100%;
  width:100%;
}

cheers

Maybe I wasn't clear enought with my question. I _want_ the pop-up to be displayed but after being visible for few seconds, I want to hide it.

So my guess is to play with JavaScripts setTimeout()-function but I have no idea where should I put it.

Any answers appreciated!  :)

maria

#3
Hi
To auto-close the popup after you click the add-to-cart button, I've done the following (VM 2.0.8)
Edit the file facebox.js in /components/com_virtuemart/assets/js/
after the line

   $.facebox.loading()

add:
setTimeout($.facebox.close, 3000);



Regards

sarguvlad

Quote from: maria on September 27, 2012, 15:10:37 PM
Hi
To auto-close the popup after you click the add-to-cart button, I've done the following (VM 2.0.8)
Edit the file facebox.js in /components/com_virtuemart/assets/js/
after the line

   $.facebox.loading()

add:
setTimeout($.facebox.close, 3000);



Regards

THANK YOU MAN!!!!!!!!!!! It solved my problem!!

cromcrom

Hello,

thank you for the great fix! It works very well.

Unfortunately my cart does not update quantity on the fly anymore - I have to refresh the page to see the new additions.
If you/anybody has any ideas for a solution I would appreciate the help!

Joomla 2.5
VM 2.0.8

Limonbay

It works flawlwssly for me. And it updates the cart with every use.

Thanks
Piercings y complementos
http://www.limonbay.com
Joomla 2.5.14
Virtuemart 2.0.24

Kans

It works, but it also makes other pop-up autoclose, such as the ask a question about this product-button and the conditions in the check out.
How can I make only the cart pop-up autoclose?

AH

If you are using the new fancybox and want the much loved "auto close"

Edit

components\com_virtuemart\assets\js\vmprices.js

At around line 75

replace

  if(usefancy){
                        $.fancybox({
                                "titlePosition" : "inside",
                                "transitionIn" : "elastic",
                                "transitionOut" : "elastic",
                                "type" : "html",
                                "autoCenter"    :   true,
                                "closeBtn"      :   false,
                                "closeClick"    :   false,
                                "content"       :   txt
                            }
                        );


with this

if(usefancy){
                        $.fancybox({
                                "titlePosition" : "inside",
                                "transitionIn" : "elastic",
                                "transitionOut" : "elastic",
                                "type" : "html",
                                "autoCenter"    :   true,
                                "closeBtn"      :   false,
                                "closeClick"    :   false,
                                "onComplete"    : function(){
                                    setTimeout( function() {$.fancybox.close(); },3500); // 3000 = 3 secs
                                },
                                "content"       :   txt
                            }
                        );


Adjust the timeout as required 3500 = 3.5 secs

This should not affect any other fancybox popups  8)
Regards
A

Joomla 3.10.11
php 8.0

zakgr

#9
I have joomla 3.65 and vm 3.018 and this is not working

here is my vmprice.js

##edit code removed as a base file in VM no need to repost if not changed from original

AH

For 3.xx

if(usefancy){
         jQuery.fancybox({

and edit so it looks like this:-

if(usefancy){
jQuery.fancybox({
                "titlePosition" : "inside",
                "transitionIn" : "fade",
                "transitionOut" : "fade",
                "changeFade"    :   "fast",
                "type"          : "html",
                "autoCenter"    : true,
                "closeBtn"      : false,
                "closeClick"    : false,
                "content"       : txt,
                "autoDimensions": false,
                "width"         : 320,
                "height"        : 'auto',
                "onComplete"    : function () {
                    setTimeout(function () {
                        jQuery.fancybox.close();
                    }, 400); // 300 = 3 secs
                }
            });
Regards
A

Joomla 3.10.11
php 8.0