VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: alesbennetti on January 02, 2012, 08:04:25 AM

Title: Cannot add products to cart
Post by: alesbennetti on January 02, 2012, 08:04:25 AM
Having installed version 2.0.0, Latest version 2.0.0, Latest release date 2011-12-19, and added all my products to the categories, I decide to check the frontend to see how the shop would function, but alas, try to add products to the cart and nothing is added. 
Title: Re: Cannot add products to cart
Post by: jenkinhill on January 02, 2012, 12:11:06 PM
Most likely cause of that is a JavaScript conflict. See http://dev.virtuemart.net/projects/virtuemart/wiki/General_JS-Problems_with_templates_and_jQuery
Title: Re: Cannot add products to cart
Post by: ethosws on January 06, 2012, 17:18:34 PM
I am having this same problem and when I emptied the table _virtuemart_adminmenuentries the side VM menu in the administration area disappeared. The Add to cart is still not working. Before I did this when I clicked on the add to cart the site did nothing, now when I click on it the cart shows up on the page but it still is empty.

This is on two fresh intalls one with default template no sample information and one with all default sample data and VirtueMart sample data installed
Title: Re: Cannot add products to cart
Post by: jenkinhill on January 06, 2012, 23:58:54 PM
Why empty that table? That is for VM BE administration - nothing to do with the Add to Cart function. You must look for JS conflicts in FE template, menu or modules.
Title: Re: Cannot add products to cart
Post by: ethosws on January 07, 2012, 00:09:37 AM
OK I have a new install Joomla 1.7.3 with everything default (no added modules or templates) I then installed VirtueMart 2.0 latest stable version. Setup as per install and added three categories and one product. When I click ADD TO CART nothing happens. I uncheck "Using the Virtuemart jQuery" and click ADD TO CART it goes to the cart with no products in the cart.

With firebug on firefox I see this.

jQuery is not defined
[Break On This Error] })(jQuery)
vmsite.js (line 92)

jQuery is not defined
[Break On This Error] })(jQuery);
facebox.js (line 320)

jQuery is not defined
[Break On This Error] })(jQuery);
vmprices.js (line 111)

jQuery is not defined
[Break On This Error] jQuery( function($) {
index.php (line 23)

Again this is a basic install with default templates - no modules except VirtuaMart.

Thanks in advance
Title: Re: Cannot add products to cart
Post by: jenkinhill on January 07, 2012, 13:17:03 PM
Did you load VM with the default sample products?

url?
Title: Re: Cannot add products to cart
Post by: ethosws on January 08, 2012, 06:58:58 AM
I have tried a couple different installs with and without sample data. I will send you a URL with admin login in a private message that way you can see what is on and off.
Title: Re: Cannot add products to cart
Post by: ethosws on January 09, 2012, 21:52:16 PM
any clue what could be wrong? basic install with sample data installed. - http://ethoswebservices.com/shop/index.php/store/handtools/hand-shovel-detail
Title: Re: Cannot add products to cart
Post by: PRO on January 10, 2012, 02:47:54 AM
If jquery is not defined. Its not loaded, turn on vmart jquery
Title: Re: Cannot add products to cart
Post by: ethosws on January 10, 2012, 03:34:40 AM
OK now don't get any error and it still does not work.

Lost?
Title: Re: Cannot add products to cart
Post by: PRO on January 10, 2012, 13:18:28 PM
turn on virtuemart product scripts
Title: Re: Cannot add products to cart
Post by: ethosws on January 20, 2012, 04:59:42 AM
I believe I have everything on but I am still having problems. Anyone have any ideas?
Title: Re: Cannot add products to cart
Post by: ethosws on January 20, 2012, 05:29:07 AM
I am now getting this error

"NetworkError: 406 Not Acceptable - http://ethoswebservices.com/shop/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&quantity%255B%255D%3D1%26option%3Dcom_virtuemart%26view%3Dcart%26virtuemart_product_id%255B%255D%3D6%26virtuemart_manufacturer_id%3D1%26virtuemart_category_id%255B%255D%3D1&_=1327033322537"
Title: Re: Cannot add products to cart
Post by: edv on January 20, 2012, 17:16:35 PM
Thats my problem too. Your server denies the access with DoubleEncoded special chars. I hav'nt an answer jet myself.
Somehow you have to alow this in your web-server-config or your firewall-config.

In Windows IIS its somewhat about "allowDoubleEscaping"

Hope this can help find the problem.

EDV
see my thread: http://forum.virtuemart.net/index.php?topic=96639.0 (http://forum.virtuemart.net/index.php?topic=96639.0)

Edit: if you are on iis6 and have a M$ firewall try to configure the HTTP policy with "verify normalization" -> "off"
Title: Re: Cannot add products to cart
Post by: ethosws on January 22, 2012, 08:24:48 AM
Any ideas?
Title: Re: Cannot add products to cart
Post by: jenkinhill on January 22, 2012, 13:07:35 PM
ethosws, it is a server problem with ModSecurity. See http://www.modsecurity.org/documentation/modsecurity-apache/1.9.3/html-multipage/03-configuration.html

If you are using Apache you may be able to turn off ModSec in .htaccess but be careful about doing that. It is usually installed on the server for a reason!  See http://www.tipsandtricks-hq.com/apache-mod-security-update-how-to-fix-error-406-or-not-acceptable-issue-259
Alternatively, if it is your server you can modify conf/modsecurity.conf - or ask the host to is you show them the problem.
Title: Re: Cannot add products to cart
Post by: Kschuler on January 22, 2012, 21:42:01 PM
J1.7
VM2.0
I am still having problems with my add to cart button.  jenkinhill, I have seen you reference the same link for this problem, but it does not seem to help me.  In another post someone told me that my slider was using javascript and so was virtuemart so it wouldn't work.  I have found out how to disable jquery in virtuemart, according to jenkinhill's link but that didn't help my problems with my cart acting bad.  I can't see how to turn off jquery for the slider.  Do I have to delete some files?  Do I have to add something in to a file somewhere? and if I do then where?  What file?  Every template that I see it has a slider.  I like the image sliders and would like to have both to show products that are on a weekly sale. 

I am having such a hard time with this.  Any suggestions greatly appreciated.  Here is the site www.thegrowshopllc.com
Title: Re: Cannot add products to cart
Post by: PRO on January 23, 2012, 02:41:48 AM
Kschuler, if you want people to help you have to post a url.

With things like these it could be 1, out of 10,000 things. Nobody is going to post that many times. But it can be spotted within 2 minutes of looking at the site.
Title: Re: Cannot add products to cart
Post by: jenkinhill on January 23, 2012, 09:38:54 AM
Kschuler, please do not add your issue to this thread when it is already being discussed in another.
Title: Re: Cannot add products to cart
Post by: edv on January 23, 2012, 17:24:58 PM
ethosws, can you give us information about your server/system? It could help to find a solution to the "NetworkError: 406"
Windows IIS 6 / 7, Linux Apache, Mac OSX Apache ... maybe firewall system?

Regards

Title: Re: Cannot add products to cart
Post by: millermulti on February 07, 2012, 16:47:51 PM
Same problem here. As soon as I view a product description page I get the 406 error which in turn stops the Add from Cart button from working.
System: Linux, PHP 5.2.11, Apache 1.3.41
Joomla 1.7.4, VirtueMart 2.0.0
SEF Disabled, All straight install, no modifications, no sample data, no Javascript errors, jQuery from Google is loaded.
Error on GET index.php?option=com_virtuemart&nosef=1&view=productdetails&task=recalculate&format=json&customPrice%255B0%255D%255B7%255D%3D10%26quantity%255B%255D%3D1%26option%3Dcom_virtuemart%26view%3Dcart%26virtuemart_product_id%255B%255D%3D1%26virtuemart_manufacturer_id%3D2%26virtuemart_category_id%255B%255D%3D1
Title: Re: Cannot add products to cart
Post by: jenkinhill on February 08, 2012, 10:49:47 AM
millermulti J1.7 requires a minimum PHP5.2.4 and Apaache 2.x  ( http://www.joomla.org/technical-requirements.html )
Title: Re: Cannot add products to cart
Post by: millermulti on February 09, 2012, 17:43:11 PM
jenkinhill, thanks for pointing that out. Talked with the server admin last night and they updated all server software. Apache 2.2.21, PHP 5.3.10
I'm still getting the error. Tried the htaccess option with no luck. I'll see if the system admin can look at the security settings and see if there is someway around this.
Title: Re: Cannot add products to cart
Post by: PRO on February 09, 2012, 19:57:32 PM
millermulti, how can someone help without a url?
Title: Re: Cannot add products to cart
Post by: millermulti on February 09, 2012, 20:49:06 PM
BanquetTables.pro, If the site had a public domain, I would share it. The site is under development and not public yet. This is why I am sharing as much information in regards to the issue as possible. I am pursuing jenkinhills suggestion on looking at the ModSecurity on the server. I'll post when I have results.
Title: Re: Cannot add products to cart
Post by: chocovo on February 10, 2012, 18:21:51 PM
Hello,

I'm using Joomla 1.5.25 and Virtuemart 2.0.

I have the same problem, when clic on "add to cart", nothing happen but in my case I know where is the problem.

In my case it is due sh404Sef. If I turn off this component "add to cart" work again.

Some Idea to have friend urls with virtuemart?

Regards.
Title: Re: Cannot add products to cart
Post by: PRO on February 10, 2012, 18:56:02 PM
Quote from: chocovo on February 10, 2012, 18:21:51 PM
Hello,

I'm using Joomla 1.5.25 and Virtuemart 2.0.

I have the same problem, when clic on "add to cart", nothing happen but in my case I know where is the problem.

In my case it is due sh404Sef. If I turn off this component "add to cart" work again.

Some Idea to have friend urls with virtuemart?

Regards.

yes, it works with standard joomla SEF.

NO reason at all to have another sef component
Title: Re: Cannot add products to cart
Post by: millermulti on March 05, 2012, 22:46:18 PM
OK, partially solved. I have been going back and forth with the system admin. They mentioned adding the following to the very top of the .htaccess file to disable mod_security, an Apache firewall module. I did with no luck.
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
I then found this posting in regards to the double encoding issue: http://forum.virtuemart.net/index.php?topic=95654.0
I edited components/com_virtuemart/assets/js/vmprices.js and replaced the two instances of ",encodeURIComponent(datas)," with ",data,"
I can now add items to my cart. The only downside so far is that when I first load a product page and look for errors with Firebug, I am seeing a 500 internal server error, on the upside this error is not causing the page to stop working.