VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Security (https) / Performance / SEO/ SEF issues VM 1.1 => Topic started by: pikefisher on August 11, 2008, 18:17:02 pm

Title: Add to cart not working
Post by: pikefisher on August 11, 2008, 18:17:02 pm
Having some trouble with a new site set up using the following.

Joomla 1.5.5, -  Virtuemart 1.1.2 - sh404sef -1.0.11_Beta - build_147 - Joomla 1.5.x

With sh404sef - rewriting mode - 'with .htaccess (mod_rewrite)' enabled, 'add to cart' button fails to work in all cart pages.

With sh404sef 'by component' set to 'skip' the add to cart button works as normal.

There have been a couple of listings of a similar problems with 'add to cart', but with ssl enabled, anyone have a suggestion if this is a settings issue that I am missing?

Thanks in advance for any guidance or tips.
Title: Re: Add to cart not working
Post by: Yannick on August 16, 2008, 12:57:55 pm
hi, do you found a solution? I have the same problem
Title: Re: Add to cart not working
Post by: mylearningspace on August 29, 2008, 02:27:41 am
ajax add to cart bug is (still) a known issue on product pages with sh404SEF integration. workaround is this...

+go to virtuemart admin/configuration/site tab
+click 'configuration' link for chosen vm theme
+set 'use Ajax to add, update or delete products from the cart?' = No

Cheers,
Chad

J! 1.5.4
vm 1.1.2
sh404SEF 1.0.11.b147
Title: Re: Add to cart not working
Post by: Preston Moore on September 01, 2008, 07:50:36 am
Since the Ajax add-to-cart is one of the coolest things about VM and convenient for shoppers wanting different variations of products, the "workaround" is a poor option.

How about a fix for this from someone?  This has to be a semi-important bug to work out.

Aravot mentions that this is fixed in VM 1.1.2 in this thread - http://forum.virtuemart.net/index.php?topic=39006.0 (http://forum.virtuemart.net/index.php?topic=39006.0)...but it's not.  I'm using VM 1.1.2 and sh404 - add to cart doesn't work with sh404 enabled.
Title: Re: Add to cart not working
Post by: bcnstony on June 27, 2009, 12:32:41 pm
I too am having the same problem - with Virtuemart 1.1.3 and sh404SEF 1.0.20_Beta - build_237.

So I uninstalled sh404SEF and turned of SEF URL's in the Global Configuration - and the problem is still there!

The first time you click "add to cart" it works great and the Ajax window pops up. The second time the mini-cart updates, but no Ajax window!

Any suggestions? Thanks
Title: Re: Add to cart not working
Post by: sgoldsmithqc on December 10, 2009, 04:11:41 am
hi all,

I work for an Apple Reseller and our websites 'add to cart' buttons no longer work.  Therefore any help that may be offered would be greatly appreciated.  www.pentagon.net.au


Sam
Title: Re: Add to cart not working
Post by: murphe on January 07, 2010, 07:11:16 am
I fixed it! I hope this works for everyone, it worked for me. You must install and enable SH404SEF before you install virtuemart and cart.

If you have already setup products you can export your Tables in SQL with Drop table via the MySQL Admin and import them after uninstalling Virtuemart and enabling the SH404SEF Mod. You will still have to add pictures to each product but it is a small price to pay for a working cart. I spent many hours on this testing every scenario, going over 12 different joomla websites I've set up in the past. I guess the order really never occurred to me until I was at my wits end.

On many of my sites I set it up, show the user how to enter articles and get them indexing ASAP with the SEF mod enabled. Then I go back and add the Virtuemart and cart and get the background things going. This time I was setting everything up  for the client and they wanted me to enter the articles, hence the switch in order of installing add-ons. To top it off AJAX is working too!

Please reply if this helped you out!  ;D

brandon@getmobiletech.com
Become a fan!
http://www.facebook.com/pages/Springfield-MO/Brandon-Barnhart-GetMobileTechcom/110344017025
Title: Re: Add to cart not working
Post by: maheshrtl on January 22, 2010, 10:07:24 am
thanks
Title: Re: Add to cart not working
Post by: aninka on February 11, 2010, 11:21:52 am
Don't drop you tables or database it is not necessary.  THe problem is easily solved with just adding your website to the configuration file and to your store see http://support.mozilla.com/en-US/forum/1/424773 for details.  The problem exists only when you use Mozilla Firefox and should not be ther with IE, however this fix will work for all browsers.

It is very irresponsible for murphe to suggest to uninstall and rebuild your entire site when the fix is so simple.
Title: Re: Add to cart not working
Post by: ccraciun on April 13, 2010, 11:51:13 am
Good point aninka.

I had the same issue, after redirecting non-www to www for my site. Everything was ok, except "add to cart" functionality and access to virtuemart component.

In backend, go to Components | Virtuemart | Admin | Configuration | Security and add www to your Site URL and Secure URL. This solved my problem!
Title: Re: Add to cart not working
Post by: ccraciun on April 13, 2010, 11:54:44 am
One more thing. The problem was related also on browser type:
- when click to "add to cart" using Firefox, nothing happened
- when click to "add to cart" using Opera, i was redirected to Homepage.

Now it's solved! :) See the above post.
Title: Re: Add to cart not working
Post by: Forrest on April 13, 2010, 20:28:18 pm
If you're going to use www solution, you'll want to use .htaccess to force non www links to www.

You can use either non www for both URL settings in VM, or www with both. For some reason, using www seems to work better, but you might find your NON www links now do not add to cart. (just try yoursite.com instead of www.yoursite.com... you might find your add to cart doesn't work with that now... or your basket gets lost in checkout).

If so, make sure you apply this in .htaccess:
http://forum.virtuemart.net/index.php?topic=64548.msg215735#msg215735
Title: Re: Add to cart not working
Post by: efishant on May 07, 2010, 08:43:59 am
Good point aninka.

I had the same issue, after redirecting non-www to www for my site. Everything was ok, except "add to cart" functionality and access to virtuemart component.

In backend, go to Components | Virtuemart | Admin | Configuration | Security and add www to your Site URL and Secure URL. This solved my problem!

Thank you ccraciun! worked for me. It was also keeping the description/images from changing when a new attribute was chosen.

All good now.

[N]
Title: Re: Add to cart not working
Post by: murphe on July 22, 2010, 06:41:46 am

It is very irresponsible for murphe to suggest to uninstall and rebuild your entire site when the fix is so simple.


It may not be necessary to backup your data before doing the work I did - but it's certainly not irresponsible to backup my client's data.  The Mozilla fix IS indeed MUCH more elegant - but my fix worked for me and the backup I performed certainly was NOT irresponsible.  I have NEVER regretted backing up data before working on any system.

Title: Re: Add to cart not working
Post by: njanszen on February 27, 2011, 13:27:00 pm
For everyone who still has problems with the Add-to-Cart button in Virtuemart:
- A common problem is that Virtuemart recognizes the domain with OR without www in front of it. You can check this by testing the button on www.yourdomain.com and yourdomain.com. If you see a difference here, try making a ReWrite in .htaccess.

How?
After RewriteEngine On, paste these rows and edit them correctly:

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

That's it.
And don't forget to backup this (hidden) file.
You can find it on your FTP server and select under View > Show hidden items.

Good luck.
Title: Re: Add to cart not working
Post by: Forrest on March 10, 2011, 02:43:25 am
See my post above, as using the rewrite rule njanszen posted will not work for SSL.
Title: Re: Add to cart not working
Post by: Siddharth on March 11, 2011, 13:07:23 pm
Hi ALL,
due to the problem of add to cart button , I have disabled the Ajax from there . Now , The button is working in every browser .
But I am facing a new a problem , i.e. when you click the ADD TO CART Button , the quantity of the product is updated . It is happening not all the time , But it after some time , it works like this ..................................................................

Can nyone help me with this issue ??????????????? plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ????????????
Title: Re: Add to cart not working
Post by: erik88 on April 11, 2011, 00:15:31 am
Thanks njanszen!

Your reply was helpful for me!
Title: Re: Add to cart not working
Post by: nolin11 on April 27, 2011, 23:39:09 pm
Hi,
It's my first post (in reality I just registered to write solution, and I probably won't visit this page again for some time...)

The problem for not working "add to cart" is really simple with mod_rewrite turned on, and it is "relative script paths" and solution for this is very simple too. To do this there is need to only add slash in JavaScript file in function which is called when form is submitted.

To be precise in line when is created Ajax object witch send query.

Some example :), this is no good line ( file theme.js in com_virtuemart theme dir):
Code: [Select]
new Ajax('index2.php?ajax_request=1', opt).request();
I have corrected this to (and other places where the shlash was missing):
Code: [Select]
new Ajax('/index2.php?ajax_request=1', opt).request();And that solved problem not working Add to cart button.

Ofc I have corrected this in all js files I found in theme.


Ps. sorry for my English
Title: Re: Add to cart not working
Post by: yanivs on May 27, 2011, 05:17:53 am
Hi,
Wow, thanks so much, I just could not finger why it happens on some comuputer and on some dont... simply I always loaded the site from the address bar history, and each computer saved it differently - some with www, some without. amazing:) thanks!

One question - for me it only works without www. I know I can make a rewrite rule for it, but I prefer my site with WWW. Is there a way I can change it so it will work with www and not without?
thanks :)
Title: Re: Add to cart not working
Post by: marympemps on July 14, 2011, 13:25:20 pm
I had the same problem. The add to cart button did not work in mozilla, but it did in iexplorer. I have not redirected my site to www because I like it without www! The solution was to click NO in the use of Ajax for the cart from the backend administration options in virtuemart. Now it works.