News:

Support the VirtueMart project and become a member

Main Menu

Help me please ! Problem with add to cart button

Started by zifou57, October 03, 2019, 00:39:39 AM

Previous topic - Next topic

zifou57

Hello All,

In advance thank you for your help.

Firstly my versions :
- Virtuemart 3.6.2 (latest)
- Joomla : 3.9.12 (latest)

I have upgrade my virtuemart from 3.4.3 to 3.6.2, since in the front page user cannot click on add to cart button, and there is an error on the console :
vmprices.js?vmver=f4a26974:95 Uncaught TypeError: Cannot read property 'showActivity' of undefined
    at Object.Virtuemart.cartEffect (vmprices.js?vmver=f4a26974:95)
    at Object.Virtuemart.sendtocart (vmprices.js?vmver=f4a26974:83)
    at HTMLInputElement.Virtuemart.addtocart (vmprices.js?vmver=f4a26974:216)
    at HTMLInputElement.dispatch (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
    at HTMLInputElement.v.handle (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
Virtuemart.cartEffect @ vmprices.js?vmver=f4a26974:95
Virtuemart.sendtocart @ vmprices.js?vmver=f4a26974:83
Virtuemart.addtocart @ vmprices.js?vmver=f4a26974:216
dispatch @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
v.handle @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2


But in mobile mode no problem.

Here my parameter on virtuemart :

  • Utilisez une Fancybox (recommandé) : Checked
  • Use the VirtueMart CSS : not Checked
  • Use Joomla jQuery framework in FE : Checked
  • Use VirtueMart jQuery UI scripts : not Checked
  • Use the product scripts : Checked
  • Use the script ajax Countries / Regions : Checked
  • Utiliser jQuery pour les listes déroulantes sur le site : not Checked
  • Utiliser AJAX pour la description des produitsChecked :
  • Use external Google jQuery library (deprecated)Checked :

The template is : https://www.virtuemarttemplates.net/virtuemart-templates/axxen-virtuemart-template.html

Can someone explain me what's the problem, it seems vmprice don't find a variable, but I have see that jQuery is loaded once and before.

Thank you for your help.



GJC Web Design

showActivity is only related to the fancybox

Virtuemart.cartEffect = function(form) {

var dat = form.serialize();

if(usefancy){
jQuery.fancybox.showActivity();
}


is /components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js being loaded?

as a test try the the standard template or uncheck fancybox
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

zifou57

Thank for your reply, I don't have jquery.fancybox-1.3.4.pack.js loaded.

- First, I uncheck fancy box support, and there is my error :
vmprices.js?vmver=f4a26974:129 Uncaught TypeError: jQuery.facebox is not a function
    at Object.<anonymous> (vmprices.js?vmver=f4a26974:129)
    at u (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
    at Object.fireWith [as resolveWith] (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
    at C (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
    at XMLHttpRequest.n (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
(anonymous) @ vmprices.js?vmver=f4a26974:129
u @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
fireWith @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
C @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
n @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
XMLHttpRequest.send (async)
send @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
ajax @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
Virtuemart.cartEffect @ vmprices.js?vmver=f4a26974:98
Virtuemart.sendtocart @ vmprices.js?vmver=f4a26974:83
Virtuemart.addtocart @ vmprices.js?vmver=f4a26974:216
dispatch @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
v.handle @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2


- Next I Add to the header the javascript to be loaded and is loaded correctly, but I have this error :
jquery.fancybox-1.3.4.pack.js:25 Uncaught TypeError: d.onCleanup is not a function
    at Q (jquery.fancybox-1.3.4.pack.js:25)
    at F (jquery.fancybox-1.3.4.pack.js:25)
    at I (jquery.fancybox-1.3.4.pack.js:21)
    at Function.b.fancybox (jquery.fancybox-1.3.4.pack.js:38)
    at Object.<anonymous> (vmprices.js?vmver=f4a26974:117)
    at u (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
    at Object.fireWith [as resolveWith] (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
    at C (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
    at XMLHttpRequest.n (jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2)
Q @ jquery.fancybox-1.3.4.pack.js:25
F @ jquery.fancybox-1.3.4.pack.js:25
I @ jquery.fancybox-1.3.4.pack.js:21
b.fancybox @ jquery.fancybox-1.3.4.pack.js:38
(anonymous) @ vmprices.js?vmver=f4a26974:117
u @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
fireWith @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
C @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
n @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
XMLHttpRequest.send (async)
send @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
ajax @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
Virtuemart.cartEffect @ vmprices.js?vmver=f4a26974:98
Virtuemart.sendtocart @ vmprices.js?vmver=f4a26974:83
Virtuemart.addtocart @ vmprices.js?vmver=f4a26974:216
dispatch @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2
v.handle @ jquery.min.js?0b96b12cbaf778e094b4c1309ee06d35:2


Any other solution to try ?

Thank you.

GJC Web Design

try with the standard Beez template .. if it works then get your template supplier to fix their template
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

zifou57

When I select the beez template, I can't see the different button, but I will contact the company to have an update.

Thank you for your help !!

beny.rfg

Hello Zifou57, I have the same issue with the same template, have you fixed?

Thanks, Petr


Gingerweb

Hi i have the same issue with same template company - was there a fix please?

Studio 42

I do not know the fix.
Butt the problem occurs when you use (load) 2 different fancybox releases
A bad, but working fix, should be removing of this line
   if(usefancy){
      jQuery.fancybox.showActivity();
   }

Gingerweb

#8
Many thanks - could you point me to where I might find that line please?
it doesn't appear to be in my version of /components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js

GJC Web Design

components\com_virtuemart\assets\js\vmprices.js
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

Gingerweb

Many thanks

- i have removed that part and cleared cache but the same error is happening when you click the Add to cart button. I have also disabled fancybox in the config (tried with it on and off)
this is a page with the error: https://armouryantiques.com/armoury-antiques-militaria/antique-and-military-curios

Gingerweb

Thanks for the suggestion.
i have for the time being fixed the issue with installing JQuery Easy.
at least the cart is working so I can go from there now.
cheers