Avatar of SpencerKarnovski
SpencerKarnovski

asked on 

Increasing the duration of the AJAX product notification - accessing the correct file, but this changes nothing.

Hi there.

I'm trying to increase the duration of the AJAX notification when adding a product to my cart.
Following the instructions from these posts:

http://forum.virtuemart.net/index.php?topic=61786.0

However, doing this has no effect on my notification box.  I can even delete the file, and still nothing changes.   I increase the duration to say 30s, again - has no effect.

Any ideas?  Is there another location for this file/function.

Thanks.
JoomlaE-CommerceJavaScript

Avatar of undefined
Last Comment
SpencerKarnovski
Avatar of Zyloch
Zyloch
Flag of United States of America image

I do not know if you received my message in the other question you just closed, but I would like to help you figure this out. Perhaps you are using a different theme, so the relevant js file is in a different folder?
Avatar of Panagiotis S
Panagiotis S
Flag of Greece image

propably its a conflict with other component,modules that use jquery or mootools

try to disable some to see the effect
Avatar of SpencerKarnovski
SpencerKarnovski

ASKER

Hi Zyloch - sorry, thought i'd better start a new question - as you did answer the main point of the last.

I am using the default VM theme.   I'm having other issues now.  AJAX is not working - I have it activated, no files have been changed.  But there is no AJAX working on my site.

Very strange.
Avatar of Zyloch
Zyloch
Flag of United States of America image

This is odd indeed. Did the AJAX stop working after you deleted the file, or only after your removed the setTimeout()?
Avatar of SpencerKarnovski

ASKER

No, it was working as intended.   Which is very strange - you would have throught, if it was calling that file, it would have thrown an error.

I even replaced the files from a back (made this morning before any changes to the theme.js were made) - and AJAX is still not working even though its activated.

www.shop.trainatbulks.com
Avatar of Panagiotis S
Panagiotis S
Flag of Greece image

propably its a conflict with other component,modules that use jquery or mootools

try to disable some to see the effect
Avatar of Zyloch
Zyloch
Flag of United States of America image

For lack of a better idea, see if panagiotiss is correct in that you've enabled some component that is creating a conflict. Also, what is the AJAX supposed to do on that page (the quantity updated message, or something else)?
Avatar of SpencerKarnovski

ASKER

AJAX will just add the product to the top right and let the user stay on the same page, as opposed to taking the user to the shopping cart each time they add a product.

I have not added, edited any modules.  I must have done something though - just installed a local copy of the site - the backup mentioned above, and AJAX is working.  

I have replaced all the default AJAX (theme.js) files with the local copy files and still working working.
Avatar of SpencerKarnovski

ASKER

Ok - so AJAX works when you add a product that does not have an Add to Cart button on the display page.  So, if you go to Bulks All in One and add the product - choosing a flavour, AJAX works.  

><
Avatar of Zyloch
Zyloch
Flag of United States of America image

So it is working now, which is good? In that case, are we now back to working out how to make the dialog box stay open longer?
Avatar of SpencerKarnovski

ASKER

Hi Zyloch - hah!  Its not working properly.  It only updates the mini cart (top right) when you add a product from the flypage (product details page) and not from the category display page.

I cannot think why it does not work from the Category page, but does from the individual product pages.  

But still - its 1/2 working - so yes, lets try and answer my original question.  How to make the notification last longer.

		document.boxB = new MooPrompt(notice_lbl, responseText, {
				buttons: 2,
				width:400,
				height:150,
				overlay: false,
				button1: ok_lbl,
				button2: cart_title,
				onButton2: 	handleGoToCart
			});
			
		setTimeout( 'document.boxB.close()', 30000 );
	}

Open in new window


As you can see here, I have set the duration to 30 seconds.  But it only lasts 3 seconds, which leads me to think that this file is not being called.  I can even delete this file and it does nothing.  
I'm using the default theme.

Thanks.
Avatar of Zyloch
Zyloch
Flag of United States of America image

I guess Virtuemart is not using that file in this case then. Would you be able to walk me through how to reproduce this on your site (do I need a login for that)? Or would you rather me try and walk you through the process of debugging this, e.g. through Firebug.
Avatar of SpencerKarnovski

ASKER

Hi - you do not need to register.

If you go;

http://www.shop.trainatbulks.com/index.php/Supplements/View-all-products.html (supplements category page)

And add Power Burn Capsules - you will be taken directly to the cart.  This is not using AJAX.

If then go;
http://www.shop.trainatbulks.com/index.php/Supplements/Power-Burn-capsules/flypage.tpl.html (power burn product details page)

And add Power burn capsules to the cart - here you will not be taken to the cart, you will see the brief notification (3s) and you will also see your product being added to the mini cart top right.

So, AJAX is not working (all of a sudden) on the category page.

Thanks for your help.
Avatar of SpencerKarnovski

ASKER

Image showing directory location of theme.js file.  Just need to figure out why this file is not being called.
Dir.jpg
Avatar of SpencerKarnovski

ASKER

Figure it out.  Its a problem with FF.  It works fine in IE.

><
Avatar of Zyloch
Zyloch
Flag of United States of America image

Oh, did you figure out the problem with FF? I am seeing it too, the AJAX not working that is. It must be because something is happening in handleAddCart() that is giving a silent error. For sure then it means theme.js is being seen, and in fact in both IE and FF when I test the dialog does not disappear after 3 seconds. Does that not happen for you?
Avatar of SpencerKarnovski

ASKER

The diag box stays in IE - but produces a visual error (hah!) see image.  Its blurred, like there's x2 sets of text.

The diag box does not appear FF on the Cat page.
The diag box appears in the products details page - but does not stay longer than 3s.

I have adblock turned off.  I have disablled NoScript.

Hah..  I think its probably best (even though I really don't want to do this!) is just turn AJAX off and have the users going to the cart whenever they add a product.  This removes the FF issue with the cat page not showing the product.  This will remove the double text effect from IE.

Its just strange that there are many different issues, on both browsers.  I have not changed any setting on FF.

Do you think thats acceptable - having the users going to the cart page each time they add a product.  Bear in mind, this site will not be very busy.

Thanks for you help, been very good.
IE.jpg
Avatar of Zyloch
Zyloch
Flag of United States of America image

In the end it will have to be your decision. I have not yet puzzled out why FF category page does not handle AJAX well. However, for me the dialog box stays open for more than three seconds in Firefox. I am using FF4, if that makes a difference. You may also want to try refreshing your Firefox page with Ctrl+F5 to make sure it is not a caching issue. The IE double text occurs because in your markup you have two .vmCartModule elements inside which you display the same mini cart information. I am not sure why that would be the case (some sort of VirtueMart module configuration detail)?
Avatar of SpencerKarnovski

ASKER

Hi

I have cleared out my cache - Joomla cache is turned off.  I'm using FF4.

When I turn off AJAX, there is no corruption in IE.  Additionally, when I refresh the page, the visual display corrects itself.  It only happens when you use AJAX.  Obviously refreshing the page still does not 1) activate AJAX on FF products page, and 2) increase the duration of AJAX on FF in products flypage.

And if it was being called twice, would it not always been corrupted in IE?  It only happens when you first add a product, soon as you refresh the page - it looks correct.

Probably best if I just turn it off :)  
ASKER CERTIFIED SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of SpencerKarnovski

ASKER

Ok - I found the offending .VM element - I had create a module postion using the XML file and added custom CSS - but yesterday, change this module.

So it looks fine now in IE.  Thanks for pointing that out.
So its all working find in IE.   If I could just get AJAX working for the category products in FF.  Going to try it on my other workstation.
Avatar of Zyloch
Zyloch
Flag of United States of America image

Try commenting out portions of code in handleAddToCart() to see if a problem is occurring there (possibly with conflicts between scripts).
Avatar of SpencerKarnovski

ASKER

Also, there is a problem with AJAX not adding products to the cart - hah!  But this only happens sometimes. For example I can add power capsules and creatine to the cart.  Then delete these go back and add creatine and try to add power capsules, and nothing happens.  The cart does not update with power capsules.  Strange.  It works one minute, then not the next.

If I disable AJAX each item gets added correctly.   So, thanks for all your help.
Avatar of SpencerKarnovski

ASKER

Thanks for your help Zyloch - defintaly worth the points.  But, as there will only be a 10 people at most, at any one time, using the site they will just have to go back and forth from the cart.

I will try to get this working at a later date though.

Thanks.
Avatar of SpencerKarnovski

ASKER

Helped a lot - great response time, great feedback.
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo