VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: zifou57 on October 03, 2019, 00:39:39 AM

Title: Help me please ! Problem with add to cart button
Post by: zifou57 on October 03, 2019, 00:39:39 AM
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 :

The template is : https://www.virtuemarttemplates.net/virtuemart-templates/axxen-virtuemart-template.html (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.


Title: Re: Help me please ! Problem with add to cart button
Post by: GJC Web Design on October 03, 2019, 09:29:16 AM
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
Title: Re: Help me please ! Problem with add to cart button
Post by: zifou57 on October 03, 2019, 20:57:05 PM
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.
Title: Re: Help me please ! Problem with add to cart button
Post by: GJC Web Design on October 03, 2019, 21:01:42 PM
try with the standard Beez template .. if it works then get your template supplier to fix their template
Title: Re: Help me please ! Problem with add to cart button
Post by: zifou57 on October 03, 2019, 21:12:45 PM
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 !!
Title: Re: Help me please ! Problem with add to cart button
Post by: beny.rfg on June 07, 2021, 21:52:52 PM
Hello Zifou57, I have the same issue with the same template, have you fixed?

Thanks, Petr

Title: Re: Help me please ! Problem with add to cart button
Post by: Gingerweb on April 27, 2022, 10:17:00 AM
Hi i have the same issue with same template company - was there a fix please?
Title: Re: Help me please ! Problem with add to cart button
Post by: Studio 42 on April 27, 2022, 10:27:48 AM
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();
   }
Title: Re: Help me please ! Problem with add to cart button
Post by: Gingerweb on April 27, 2022, 10:32:08 AM
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
Title: Re: Help me please ! Problem with add to cart button
Post by: GJC Web Design on April 27, 2022, 11:05:53 AM
components\com_virtuemart\assets\js\vmprices.js
Title: Re: Help me please ! Problem with add to cart button
Post by: Gingerweb on April 27, 2022, 11:13:58 AM
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
Title: Re: Help me please ! Problem with add to cart button
Post by: Gingerweb on April 27, 2022, 11:40:32 AM
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