News:

Looking for documentation? Take a look on our wiki

Main Menu

Lost Ajax Add To Cart Product Added Pop Up and Cart Update

Started by saviB, March 20, 2013, 19:07:26 PM

Previous topic - Next topic

saviB

Could use a hand. I was working on some optimizing today and messed about with jbetolo. It doesn't play nice with my site so after some extensive testing, I just disabled it. After, I checked add to cart - and Darn It! The pop up no longer works and neither does the auto cart update. SO, I scoured the forums and found a bunch of people in the same boat. I have:

Checked and re-checked the settings in admin/components/vm/configuration/templates
Checked and re-checked for javascript errors in Firefox Firebug and error console. No JS conflicts exist.
Disabled any plugin that is less than two months in use.
Contacted jproven to see if there plugin can permanently change Jquerry or Mootools - or some setting that persists even after disabling the plugin. No reply yet.

I'm out of ideas. Any help at all will be greatly appreciated.

I'm not showing a URL as the cart function is for members only. I know, I know - but again, any ideas would be greatly appreciated.  8)

PHP Built On    Linux
Database Version    5.5.28-29.3-log
Database Collation    utf8_general_ci
PHP Version    5.3.22
Web Server    Apache
WebServer to PHP Interface    cgi-fcgi
Joomla! Version    Joomla! 2.5.8 Stable [ Ember ] 8-November-2012 14:00 GMT
Joomla! Platform Version    Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT
User Agent    Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0

cybersholt

Add a link to the site or debug with the dev tools on modern browsers.

jenkinhill

@saviB  looks like you need to revert to the backup you made before testing - there are comments elsewhere in the forum advising against js compression.

I presume you cleared browser & Joomla caches.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

saviB

I did, thank you. Its the strangest thing. The day after, the functionality came back. However, it chooses to work intermittently. I wonder if there is a js conflict somewhere - but I've found none...

Thanks for the replies.

saviB

Well, hell. Its now happening on another site using the same host Siteground. I've been working on optimization, using Cloudfare, Akeeba, etc. Something does not play nice and does not revert after disabled. /site removed/ Add to cart does nothing! Any ideas?

jenkinhill

On opening the page http://www.jujuartjewelry.com/shop-home/earrings/pearl-collection2012-09-13-07-43-47_/y1001a-18-solid-brass-detail.html  IE10's debugger throws up the following errors:

HTML1524: Invalid DOCTYPE. The shortest valid doctype is "<!DOCTYPE html>".
y1001a-18-solid-brass-detail.html, line 1 character 1
HTML1508: Unmatched end tag.
y1001a-18-solid-brass-detail.html, line 701 character 1
HTML1519: Invalid nesting. An "<a>" tag should not be placed within another "<a>".
y1001a-18-solid-brass-detail.html, line 898 character 17
HTML1523: Overlapping end tag. Tags should be structured like "<b><i></i></b>" instead of "<b><i></b></i>".
y1001a-18-solid-brass-detail.html, line 898 character 17
HTML1512: Unmatched end tag.
y1001a-18-solid-brass-detail.html, line 908 character 18
SEC7118: XMLHttpRequest for http://jujuartjewelry.com/index.php?option=com_virtuemart&nosef=1&view=productdetails&task=recalculate&virtuemart_product_id=852&format=json&amp;lang=en&field%255B0%255D%255Bcustom_value%255D%3D%252Fshop-home%252Fearrings%252Fpearl-collection2012-09-13-07-43-47_%252Fy1001a-18-solid-brass-detail.html%26quantity%255B%255D%3D3%26option%3Dcom_virtuemart%26virtuemart_product_id%255B%255D%3D852 required Cross Origin Resource Sharing (CORS).
y1001a-18-solid-brass-detail.html
SEC7127: Redirect was blocked for CORS request.
y1001a-18-solid-brass-detail.html
SCRIPT7002: XMLHttpRequest: Network Error 0x2ef1, Could not complete the operation due to error 00002ef1.
y1001a-18-solid-brass-detail.html

And when add to cart is hit this error is repeated:

SCRIPT7002: XMLHttpRequest: Network Error 0x2ef1, Could not complete the operation due to error 00002ef1.
y1001a-18-solid-brass-detail.html

I have no idea what it means, but it is server/host related  - try installing an Akkeeba backup copy on localhost to see if it works there.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

saviB

Thanks Jenkinhill - this is great. I'm checking with my host now to see if they recognize the error. I'll post their reply.

Do you happen to know how (or if its possible) to find these errors in Firebug or Chrome?

saviB

GOT IT! Ok, Siteground has a wonderful service called Cloudfare. It is software that increase page speed. To use it, it requires the use of www. After agreeing to this, Coudfare sets this automatically. IF you do not use www in your config file - you will loose the ability to add to cart - regardless of if you have Cloudefare active or disabled - which made it hard to determine that it was the problem. Put www back in and viola - it works.

Thanks again Jenkinhill - your help lead me to the answer.  :)

jenkinhill

I'll try to remember that one, although I disagree with hosts who make so called enhancements without making sure all clients understand the implications. But I almost always force www. urls with the use of .htaccess in any case.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

saviB

I agree. I had to emergency shut down Google PageSpeed service on two sites because it completely wrecks the sites in IE. And, yes, I too now only use www. I've learned its very important to SEO results.

What line do you use to force www through .htaccess?

saviB

One last note for you SiteGround users. If you do use CloudFare, its cache is TENACIOUS. Not knowing it had its own purge cache function, I spent an hour trying to figure out why the edits I made to a template.css file weren't taking place. So, if you are editing the styles, be sure to first set CloudFare to develop Mode and purge the cache. I hope that helps someone.

jenkinhill

#11
To direct to www. I include this in .htaccess

RewriteCond %{HTTP_HOST} !^(.*)\.sitename\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.sitename.co.uk/$1 [L,R=301]

Sounds like Cloudflare is a way of stacking more sites onto a server without the resulting speed slowdown showing up. No good for developers at all.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

saviB

Never thought of that. I do notice a decrease in load time using it though.

Thanks for the htaccess bit. Works like a charm. For those not familiar, in the US it should look like

RewriteCond %{HTTP_HOST} !^(.*)\.yoursite\.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]


saviB

jenkinhill - if you are around, this problem is persisting. However, the new wrinkle is that the AJAX add to cart function works - but ONLY on products that have attributes (sorry, custom fields). All products that have no options, on Add To Cart Click, does nothing visible. The products are added - but its only noticeable after refresh or navigating to a new page.

The products are wholesale only and behind login - so a URL is no useful. If you would be willing to have a quick look - I can PM you access.