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

SpencerKarnovski
SpencerKarnovski used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2004

Commented:
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?
Panagiotis Sweb developer - designer

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

try to disable some to see the effect

Author

Commented:
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.
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Top Expert 2004

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

Author

Commented:
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
Panagiotis Sweb developer - designer

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

try to disable some to see the effect
Top Expert 2004

Commented:
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)?

Author

Commented:
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.

Author

Commented:
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.  

><
Top Expert 2004

Commented:
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?

Author

Commented:
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.
Top Expert 2004

Commented:
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.

Author

Commented:
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.

Author

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

Author

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

><
Top Expert 2004

Commented:
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?

Author

Commented:
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
Top Expert 2004

Commented:
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)?

Author

Commented:
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 :)  
Top Expert 2004
Commented:
Turning it off would be easiest, if you believe you don't need it.

It is very odd, because the dialog insists on staying open for me in FF4. Strange mysteries.

Regarding your IE question, nothing is being called twice, but the problem is that your updateMiniCarts() function looks for .vmCartModule elements, of which there is two, one under the <div> with class art-header and one under the <div> with class art-nostyle.

Author

Commented:
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.
Top Expert 2004

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

Author

Commented:
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.

Author

Commented:
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.

Author

Commented:
Helped a lot - great response time, great feedback.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial