Cannot add to cart (book)
-
Hi
I have been having trouble getting the gift card to add to cart. I read through the support forum and then decided I would get woocommerce template files up-to-date and then add the variation-add-to-cart-button.php file as this seemed to be the most suggested fix. Having tested this in development (and now pushed changes to live site so you can see) I still can’t get the gift card product to add to basket (book).
Any help would be massively appreciated!
Thanks in advance
JakeThe page I need help with: [log in to see the link]
-
I reviewed the HTML source for your gift card product and I can see that the correct code is in place. You have resolved any compatibility issues with the theme.
With that said, there are several javascript errors that are preventing any code from running. When the amount is selected, javascript shows/hides the fields but can’t run if there are errors.
If you use Chrome, open the Developer Console to see the errors. Here is a text version:
(index):432 Uncaught ReferenceError: ga is not defined
at (index):432
(anonymous) @ (index):432
(index):1093 Uncaught ReferenceError: fbq is not defined
at HTMLDocument.<anonymous> ((index):1093)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at Function.ready (jquery.js?ver=1.12.4:2)
at HTMLDocument.K (jquery.js?ver=1.12.4:2)
(anonymous) @ (index):1093
i @ jquery.js?ver=1.12.4:2
fireWith @ jquery.js?ver=1.12.4:2
ready @ jquery.js?ver=1.12.4:2
K @ jquery.js?ver=1.12.4:2
VM316:2 Uncaught SyntaxError: Invalid or unexpected token
at Object.e.replace (core-fcf8c9eac36aece9d290934b54a63296.js:1)
at r (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at C (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at core-fcf8c9eac36aece9d290934b54a63296.js:2
at w (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at core-fcf8c9eac36aece9d290934b54a63296.js:2
at s (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at v.activateSnippet (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at e.activateSnippet (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at Object.e.iterateAsyncSeq (core-fcf8c9eac36aece9d290934b54a63296.js:2)
e.replace @ core-fcf8c9eac36aece9d290934b54a63296.js:1
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
C @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
w @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
s @ core-fcf8c9eac36aece9d290934b54a63296.js:2
v.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.iterateAsyncSeq @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
setTimeout (async)
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
i @ core-fcf8c9eac36aece9d290934b54a63296.js:2
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
C @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
w @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
s @ core-fcf8c9eac36aece9d290934b54a63296.js:2
v.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.iterateAsyncSeq @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
setTimeout (async)
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
i @ core-fcf8c9eac36aece9d290934b54a63296.js:2
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
C @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
w @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
s @ core-fcf8c9eac36aece9d290934b54a63296.js:2
v.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.iterateAsyncSeq @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
setTimeout (async)
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
i @ core-fcf8c9eac36aece9d290934b54a63296.js:2
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
C @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
w @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
s @ core-fcf8c9eac36aece9d290934b54a63296.js:2
v.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.iterateAsyncSeq @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
setTimeout (async)
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.onload.e.onerror.e.(anonymous function) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
load (async)
i @ core-fcf8c9eac36aece9d290934b54a63296.js:2
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
C @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
w @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
s @ core-fcf8c9eac36aece9d290934b54a63296.js:2
v.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.iterateAsyncSeq @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
setTimeout (async)
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.onload.e.onerror.e.(anonymous function) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
load (async)
i @ core-fcf8c9eac36aece9d290934b54a63296.js:2
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
C @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
w @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
s @ core-fcf8c9eac36aece9d290934b54a63296.js:2
v.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.iterateAsyncSeq @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
setTimeout (async)
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
i @ core-fcf8c9eac36aece9d290934b54a63296.js:2
r @ core-fcf8c9eac36aece9d290934b54a63296.js:2
C @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
w @ core-fcf8c9eac36aece9d290934b54a63296.js:2
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:2
s @ core-fcf8c9eac36aece9d290934b54a63296.js:2
v.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.activateSnippet @ core-fcf8c9eac36aece9d290934b54a63296.js:2
e.iterateAsyncSeq @ core-fcf8c9eac36aece9d290934b54a63296.js:2
v.activateSnippets @ core-fcf8c9eac36aece9d290934b54a63296.js:2
v.activateAllSnippets @ core-fcf8c9eac36aece9d290934b54a63296.js:2
c.startActivation @ core-fcf8c9eac36aece9d290934b54a63296.js:3
c.applyConsent @ core-fcf8c9eac36aece9d290934b54a63296.js:3
c.start @ core-fcf8c9eac36aece9d290934b54a63296.js:3
r.loadConsentLocal @ core-fcf8c9eac36aece9d290934b54a63296.js:2
c.loadConsent @ core-fcf8c9eac36aece9d290934b54a63296.js:3
c.preLoad @ core-fcf8c9eac36aece9d290934b54a63296.js:3
(anonymous) @ core-fcf8c9eac36aece9d290934b54a63296.js:3
h @ core-fcf8c9eac36aece9d290934b54a63296.js:1
load (async)
o @ core-fcf8c9eac36aece9d290934b54a63296.js:1
loading.s.readyState.s.onreadystatechange @ core-fcf8c9eac36aece9d290934b54a63296.js:1
VM318:4 Uncaught SyntaxError: Invalid or unexpected token
at Object.e.replace (core-fcf8c9eac36aece9d290934b54a63296.js:1)
at r (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at C (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at core-fcf8c9eac36aece9d290934b54a63296.js:2
at w (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at core-fcf8c9eac36aece9d290934b54a63296.js:2
at s (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at v.activateSnippet (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at e.activateSnippet (core-fcf8c9eac36aece9d290934b54a63296.js:2)
at Object.e.iterateAsyncSeq (core-fcf8c9eac36aece9d290934b54a63296.js:2)Once you resolve these errors then you will be all set!
Thanks for your reply.
So, I managed to narrow it down to some google analytics tracking, yell conversion tracking and facebook pixel that are causing the issues… I think. I got rid of the google and yell so am just left with one error but don’t really want to abandon the facebook pixel. I’ve seen some forums suggesting setting up the pixel manually through google tag manager but for now this is beyond me. I may have to find a different gift cards plug-in then perhaps come back once I’m more up to speed on my coding and on using conversion tags/pixels etc.
Thanks for your help so far!
The final error you have on your site (“fbq is not defined”) looks like it can be a tag sequencing error.
See if this article helps: https://stackoverflow.com/questions/46972912/facebook-pixel-google-tag-manager-fbq-events
Yeah that’s one of the ones I read already. I use woomcommerce’s in built integration for the facebook pixel at the moment. So maybe it is a case of learning to use GTM for the facebook pixel somewhere down the line!
Thanks
Gotcha. I’m going to resolve this ticket since it isn’t something directly related to the Gift Cards plugin. I hope you are able to find and fix the issue, we would love for you to be able to use our plugin!
If there is anything else I can help with let me know. Best of luck with your store!
- The topic ‘Cannot add to cart (book)’ is closed to new replies.