News:

Support the VirtueMart project and become a member

Main Menu

Add to cart and quantity buttons doesn't work?

Started by alexzien, September 23, 2015, 10:12:31 AM

Previous topic - Next topic

alexzien

On the product details page "Add to cart" directly sends you to the shopping cart page without adding the product in the cart. The modal popup windows don't open at all. I also can't change the quantity with the + and - buttons. Look at this page: http://goo.gl/kLZ8bw.

All this works though on the first page of Virtuemart, here: http://goo.gl/TmqiX0.

I have looked if I got multiple jQuery scripts loaded, but can't figure out if I have it or not. I have tried plugins such as jqueryeasy and JB Library, but it still doesn't work.
I have also searched the forum and found similar problems and tried pretty much all solutions I have found. Nothing works for me.

Any other suggestion?

VM 3.0.9
J 3.2.7 (I can't upgrade since PHP version on server is too low).

jenkinhill

JavaScript error:  TypeError: jQuery(...).chosen is not a function

Maybe because you are loading an old version of jQuery.  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>

Currently VirtueMart  uses jQuery v1.11.3

By old version of PHP do you mean before PHP 5.3.10?  I'm not sure if current VM works properly on older PHP versions.
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

alexzien

#2
Thank you for your answer.

I have now changed to later version of jQuery, but the issue still remain. It's really weird that the popup works in "Latest products" in Virtuemart but not in the product details.
The server use PHP 5.3.3 and can't be changed unfortunately.

Edit: I have made a migration now and have the latest version of Joomla and a later version of PHP on another server with the same website. But the issue is still there.

jimleeder123

We recently updated our server to the latest PHP level. Good thing is you can set it to use a certain PHP level on specific domains (if you use Plesk like us) so it won't bugger up other websites.
Web Developer and blogger

Joomla 3.4.8  (2.5 on some)
VM 3.0.12
PHP 5.6 (5.4 on websites with Joomla 2.5)

http://jimleeder.co.uk

GJC Web Design

Your Jquery is still too old and your still not loading chosen.js

TypeError: jQuery(...).chosen is not a function

plenty of posts on here about using jqueryeasy to fix this
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alexzien

#5
Quote from: GJC Web Design on September 26, 2015, 13:49:39 PM
Your Jquery is still too old and your still not loading chosen.js

TypeError: jQuery(...).chosen is not a function

plenty of posts on here about using jqueryeasy to fix this
I have installed Jqueryeasy but that plugin crashes the other "Add to cart" buttons aswell. Now no one of the "Add to cart" works. I have the plugin activated and use jQuery 1.11 in it. I have also tried all of the settings for it, without solving the problem.

GJC Web Design

Now your not loading any jquery at all!!!!!!!

dozens of js errors in the console

read the docs on how to set up jqueryeasy and use the console to check for errors
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alexzien

Quote from: GJC Web Design on September 29, 2015, 10:34:10 AM
Now your not loading any jquery at all!!!!!!!

dozens of js errors in the console

read the docs on how to set up jqueryeasy and use the console to check for errors
Sorry, I'm not that good at jQuery and such.

I have fixed the loading of jQuery now but it still doesn't work.

GJC Web Design

which takes you straight back to

TypeError: jQuery(...).chosen is not a function
   
});

you are still not loading chosen.js - google on here.. this has been mentioned a lot
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alexzien

#9
I have now added the url to chosen.js in the field "Add script" in Jqueryeasy plugin.

When I look in the console now it says:

Uncaught TypeError: jQuery(...).live is not a function
(anonymous function)   @   allt-i-ett-detail:466
m.Callbacks.j   @   jquery.js:3148
m.Callbacks.k.fireWith   @   jquery.js:3260
m.extend.ready   @   jquery.js:3472
J   @   jquery.js:3503

Thank you for helping me btw, it's very much appreciated.

GJC Web Design

is your AIO up to date  update both to 3.0.10

that script
<script type="text/javascript" id="vm.CartModule.UpdateModule_js">//<![CDATA[
jQuery(document).ready(function(){
    jQuery("body").live("updateVirtueMartCartModule", function(e) {
        jQuery("#vmCartModule").updateVirtueMartCartModule();
    });
}); //]]>
</script>

doesn't exist in VM3.0.10
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alexzien

I have updated to version 3.0.10 for both AIO and VM now, but still same error.

GJC Web Design

well .. that inline script is not on a fresh VM install - remove any vm cart over rides
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alexzien

FINALLY. I found what caused it. When I selected to show prices again in Configuration -> Pricing it started to work! It wasn't a JS problem at all...

So, now my question is why this happen when you don't want to show prices? I don't want customers to be able to see the price, but still order the products.