VirtueMart Forum

VirtueMart 2 + 3 => Administration & Configuration => Topic started by: martin.g on August 29, 2011, 16:03:37 pm

Title: Problems with cart: Products not added and cart below starting page
Post by: martin.g on August 29, 2011, 16:03:37 pm
Hello,

I have two problems with the cart. Maybe they are depending.
A click on "Cart" in my menu redirects me to:
http://www.example.org/joomla/index.php/warenkorb -> That is fine, although I don´t know why there has to be the index.php in it, but okay. Perhaps this depends on SEO.

When I click on "Add to cart", I get redirected to
http://www.example.org/joomla/index.php/shop/myCategory/myProduct/index.php -> This shows the starting page and below the starting content the cart is displayed. Additionally the cart is still empty and in the cart table no product is added.
Perhaps it depends on this error message:
Warning: mysqli_close() [function.mysqli-close]: Couldn't fetch mysqli in /www/example.org/web/joomla/libraries/joomla/database/database/mysqli.php on line 148
I found this message only appearing in context of the cart.

Can you tell me what to do? The only post with this problem on VM2 I found, was this one:
http://forum.virtuemart.net/index.php?topic=89641
And the answer was not quite helpful.

Thanky you and best regards
Martin

Edit: Sorry, I did not want to post this into Administration & Configuration as Milbo said it was wrong in this forum. It was a mistake, although I think this would be a configurable item.
And I use Joomla 1.7 with VM 1.9.8_RC2e
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: jenkinhill on August 29, 2011, 16:56:09 pm
If you are using PHP5.3 then don't use MySQLi - http://forum.virtuemart.net/index.php?topic=90380.msg296347#msg296347
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: martin.g on August 29, 2011, 17:05:46 pm
Thank you for the answer. I use PHP 5.2.13
I got got neither an error with installing 1.9.8d nor upgrading to 1.9.8e. But I also get to Error 404 when I click comvirtuemartallinone or comvm-all-in-one in adminmenu. I have both entries and got no error while installation. Is this related to the problem? I didn´t know I could configure anything about the allinone modules and thaught the admin entry was fake.
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: martin.g on August 29, 2011, 17:17:25 pm
Well, I tried to switch from MySQLi to MySQL. The only difference is the missing error message :-)
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: Milbo on August 30, 2011, 10:17:28 am
Yes  the admin entry of the aio is a fake. The new version shows a page with "here is nothing to see uninstall me" lol.

look on the field of your session table of joomla. The field data should be text. in the other case your session field is to short and cannot hold the cart completly.
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: martin.g on August 30, 2011, 17:37:52 pm
Okay, then I will ignore the admin entries. Thank you.
The field type of "data" in "_session" is even "longtext".
Do you have any other suggestions?
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: Milbo on August 30, 2011, 17:51:25 pm
Does the F version makes a difference? Does it help to disable SEO?
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: martin.g on August 30, 2011, 18:41:36 pm
Ah, I didn´t get, there is a new version. So I upgraded now, but nothing changed in behaviour.

When I disable SEO (in Joomla and VM) the error still persists. I get redirected to http://www.example.org/joomla/index.php and the cart shows below the index page and no products are in the cart.
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: martin.g on August 30, 2011, 19:19:24 pm
Well, I´m a little desperated now. I cleared the table and installed the demo data and the behaviour still is the same :-(
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: martin.g on August 30, 2011, 19:52:32 pm
I suppose the reason is a javascript error on the site. I did a new demo installation on a fresh joomla with demo data and now I know how it should look/work. Didn´t know there was a popup layer with question how to proceed. I guess the JS error prevents the JS function that opens this window from being started.
The message (from Firebug) is:
jQuery(".product").product is not a function
in
components/com_virtuemart/asses/js/vmprices.js Line 109

Do you know the reason of this error? Parallel I will try to find out the reason on my own, but I don´t know much about JS on Jommla
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: Studio 42 on August 30, 2011, 21:37:34 pm
I suppose the reason is a javascript error on the site. I did a new demo installation on a fresh joomla with demo data and now I know how it should look/work. Didn´t know there was a popup layer with question how to proceed. I guess the JS error prevents the JS function that opens this window from being started.
The message (from Firebug) is:
jQuery(".product").product is not a function
in
components/com_virtuemart/asses/js/vmprices.js Line 109

Do you know the reason of this error? Parallel I will try to find out the reason on my own, but I don´t know much about JS on Jommla
Hello,
We use the google Jquery api from "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" , is this loaded ?

Can you test on the defaut template (BEEZ-20)to know if it's not a js/css conflict with a template ?
Try to remove/disable all none Virtuemart 2 modules.

jQuery(".product").product is not a function is typical a mootools  conflict or non existing jQuery library

Title: Re: Problems with cart: Products not added and cart below starting page
Post by: martin.g on August 31, 2011, 10:11:16 am
Yes the google jQuery is loaded. Template BEEZ-20 couldn´t be found. I copied from my fresh installation, didn´t change anything.
But I found the solution. After loading the VM skripts the company doing the webdesign loads jquery-1.4.2 .... So jQuery Version is overwritten with an old one. Perhaps I should have changed the complete Joomla Template to BEEZ-20, buit I didn´t realize.
Well guys, thank you for pushing me to solution! I know on the difficulty to assist while not sitting in front of the problem.

Best regards
Martin
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: Eric Brown on September 12, 2011, 19:56:34 pm
Martin.  I am getting this error too.  Please explain where to go to fix this.  I read your post, but am not quite sure where to fix it.

Thanks!

Eric
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: Milbo on September 12, 2011, 20:40:27 pm
load your page, use firebug or simular,... search for jQuery, ensure that only the virtuemart version is loaded.
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: Eric Brown on September 12, 2011, 20:53:01 pm
Actually.  I got it by setting the database to MySQL instead of MySQLi...weird...

thanks so much!
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: PRO on September 12, 2011, 22:17:55 pm
I also had problems with mysqli ONLY on xampp 1.7 though


Title: Re: Problems with cart: Products not added and cart below starting page
Post by: pinjosi on September 13, 2011, 08:44:44 am
ITS your SEF. Put of plugin SEF and Joomla Configuration SEF off and your problem is gone. i had the same problem here
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: ptykamikaze on September 14, 2011, 18:58:41 pm
Hello,

Im having the same problem as described. I used Firebug to detect a conflict between declaration of jquery-min.js in template index.php and virtuemart/config.php. I used a factory template (bez50) and virtuemart was adding products to the cart normally. I decided to add some jquery functionality to the homepage which is not related with virtuemart so it was necessary the code <script>bla bla bla </script> to the template/index.php. After that the new functionality was working but the virtuemart "add to cart" button neither the plus and minus buttons.

I saw that this new wanted functionality was working when ever a virtuemart module was called without including the <script>bla bla bla </script> in the template/index.php

PLEASE HELP
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: msgm26 on October 05, 2011, 17:16:47 pm
I had the same problem too. In my template style I have an option to optimize all JS-files. When I have switched this option from "join & minify & compress" to "no", the problem is resolved.
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: imat on January 12, 2012, 08:06:29 am
Setting 'Optimize JS' = 'no' in template also worked for me.

What is the practical effect of setting this to no?

Thanks
Title: Re: Problems with cart: Products not added and cart below starting page
Post by: PRO on January 12, 2012, 15:28:42 pm
Setting 'Optimize JS' = 'no' in template also worked for me.

What is the practical effect of setting this to no?

Thanks

yes, its right here in the FAQS
http://forum.virtuemart.net/index.php?topic=95979.msg315424#msg315424