Minicart Button Disappearing
-
Hi,
I’m using Version: 2.0.1, I am having trouble with the Minicart button. When I am on certain pages if I click the paypal button the screen looks like it is loading the popup but it doesn’t and then the paypal button disappears completely.
I believe it is something to do with my cache plugin as when I load the page without cache it works. It has worked perfectly until updating to this new version of your plugin. My cache plugin has not had any updates in this time.
Is there javascript or css that I should be excluding from my cache plugin?
Thank you.
-
Hi @kds26 – We have seen this issue crop up lately. Can you let us know which version of PayPal Checkout you’re currently using?
– Joey
@jricketts4 I’m currently using version 2.0.1, I see there is a new update today, do you know if the issue has been fixed in this version? Thanks.
Hi @jricketts4 – I just updated to Version 2.0.2 and I’m still having the same issue.
Hi @kds26, sorry for the trouble this update has caused.
Is it possible that your caching plugin is stripping some script arguments from the new PayPal JS file?
Regarding your question:
> Is there javascript or css that I should be excluding from my cache plugin?
The new javascript file we are using is: https://www.paypal.com/sdk/js. Please let me know if excluding that file from your cache plugin changes anything.
If it’s still not working, can you check if there are any javascript/console errors on the page?
If you’d like us to take a closer look, can you please pass on your store URL.
Thanks
Hi @mattdallan
Thanks for the reply. I have excluded the javascript file from my cache plugin but I am still getting the same error. I am still in the development stage of my website hoping to go live soon, but this error is holding me up. I am running your plugin in sandbox mode at present.
These warnings show in the console before the paypal button is clicked:
JQMIGRATE: Migrate is installed, version 1.4.1
(index):1 A cookie associated with a cross-site resource at https://paypal.com/ was set without theSameSite
attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set withSameSite=None
andSecure
. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
DevTools failed to load SourceMap: Could not load content for https://www.sandbox.paypal.com/smart/smart-payment-buttons.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILUREThese warnings show in the console after the paypal button is clicked:
JQMIGRATE: Migrate is installed, version 1.4.1
(index):1 A cookie associated with a cross-site resource at https://paypal.com/ was set without theSameSite
attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set withSameSite=None
andSecure
. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
DevTools failed to load SourceMap: Could not load content for https://www.sandbox.paypal.com/smart/smart-payment-buttons.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
buttons:998 update_client_config_error {err: “SyntaxError: Unexpected token C in JSON at positio…ing-eligibility&commit=false¤cy=AUD:2:72314”, timestamp: “1591076350795”, referer: “www.sandbox.paypal.com”, sessionID: “23fe6ed511_mdu6mzg6mjg”, env: “sandbox”, …}
A @ buttons:998
I @ buttons:998
error @ buttons:998
(anonymous) @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
(anonymous) @ buttons:998
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
(anonymous) @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
(anonymous) @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
nr.postrobot_message_response @ VM6 js:2
cr @ VM6 js:2
(anonymous) @ VM6 js:2
(anonymous) @ VM6 js:2
buttons:998 unhandled_error {err: “SyntaxError: Unexpected token C in JSON at positio…ing-eligibility&commit=false¤cy=AUD:2:72314”, timestamp: “1591076350800”, referer: “www.sandbox.paypal.com”, sessionID: “23fe6ed511_mdu6mzg6mjg”, env: “sandbox”, …}
A @ buttons:998
I @ buttons:998
error @ buttons:998
(anonymous) @ buttons:998
(anonymous) @ buttons:998
(anonymous) @ buttons:998
setTimeout (async)
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
(anonymous) @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
(anonymous) @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
(anonymous) @ buttons:998
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
(anonymous) @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
(anonymous) @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
nr.postrobot_message_response @ VM6 js:2
cr @ VM6 js:2
(anonymous) @ VM6 js:2
(anonymous) @ VM6 js:2
Show 14 more frames
buttons:998 Uncaught SyntaxError: Unexpected token C in JSON at position 0Error: Unexpected token C in JSON at position 0
at Ut.error (VM6 js:2)
at Object.<anonymous> (VM6 js:2)
at JSON.parse (<anonymous>)
at o (VM6 js:2)
at er (VM6 js:2)
at u.on (VM6 js:2)
at cr (VM6 js:2)
at VM6 js:2
at VM6 js:2
Ut.error @ VM6 js:2
(anonymous) @ VM6 js:2
o @ VM6 js:2
er @ VM6 js:2
u.on @ VM6 js:2
cr @ VM6 js:2
(anonymous) @ VM6 js:2
(anonymous) @ VM6 js:2
setTimeout (async)
(anonymous) @ buttons:998
(anonymous) @ buttons:998
setTimeout (async)
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
(anonymous) @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
(anonymous) @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
n.dispatch @ buttons:998
n.reject @ buttons:998
(anonymous) @ buttons:998
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
(anonymous) @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
(anonymous) @ VM6 js:2
n.dispatch @ VM6 js:2
n.reject @ VM6 js:2
nr.postrobot_message_response @ VM6 js:2
cr @ VM6 js:2
(anonymous) @ VM6 js:2
(anonymous) @ VM6 js:2
Show 18 more framesThe paypal button then disappears completely from my minicart.
Any help you can provide would be appreciated. Thank you.
Hey @kds26, thanks for the response.
The Samesite cookie notice and DevTools failed to load SourceMap you are seeing in the console are not caused by PayPal Checkout and shouldn’t be causing the PayPal Buttons to not load. These messages are related to samesite cookies being enabled in chrome://flags/ and other chrome extensions (adblock usually will cause the SourceMap errors)
The one error that concerns me is
Error: Unexpected token C in JSON at position 0
.This error is most likely coming from another extension or theme or custom code, so I would start debugging this by deactivating everything except WooCommerce and PayPal Checkout, and switching to a default/storefront theme.
Let me know if you are still seeing this error.
Hi @mattdallan
I’m pretty sure it is to do with my cache plugin but no idea how to fix. I have excluded the javascript file you suggested.
Getting a different error now.
update_client_config_error
Object { err: “JSON.parse: unexpected character at line 1 column 1 of the JSON data\n\n\nUt.error@https://www.paypal.com/sdk/js?client-id=sb&merchant-id=R39LVCN8MD4CN&intent=capture&locale=en_AU&components=buttons,funding-eligibility&commit=false¤cy=AUD:2:54543\ner/</<@https://www.paypal.com/sdk/js?client-id=sb&merchant-id=R39LVCN8MD4CN&intent=capture&locale=en_AU&components=buttons,funding-eligibility&commit=false¤cy=AUD:2:61983\ner/<@https://www.paypal.com/sdk/js?client-id=sb&merchant-id=R39LVCN8MD4CN&intent=capture&locale=en_AU&components=buttons,funding-eligibility&commit=false¤cy=AUD:2:61842\ner@https://www.paypal.com/sdk/js?client-id=sb&merchant-id=R39LVCN8MD4CN&intent=capture&locale=en_AU&components=buttons,funding-eligibility&commit=false¤cy=AUD:2:61995\ncr/u<@https://www.paypal.com/sdk/js?client-id=sb&merchant-id=R39LVCN8MD4CN&intent=capture&locale=en_AU&components=buttons,funding-eligibility&commit=false¤cy=AUD:2:67035\ncr@https://www.paypal.com/sdk/js?client-id=sb&merchant-id=R39LVCN8MD4CN&intent=capture&locale=en_AU&components=buttons,funding-eligibility&commit=false¤cy=AUD:2:67224\nwr/</</<@https://www.paypal.com/sdk/js?client-id=sb&merchant-id=R39LVCN8MD4CN&intent=capture&locale=en_AU&components=buttons,funding-eligibility&commit=false¤cy=AUD:2:72270\nwr/</<@https://www.paypal.com/sdk/js?client-id=sb&merchant-id=R39LVCN8MD4CN&intent=capture&locale=en_AU&components=buttons,funding-eligibility&commit=false¤cy=AUD:2:72314\n”, timestamp: “1591138591392”, referer: “www.sandbox.paypal.com”, sessionID: “db565cc41f_mji6ntm6ndi”, env: “sandbox”, buttonSessionID: “40e24c1a64_mji6nty6mtk” }Any ideas? Thank you.
@mattdallan I should also mention the first error was in google chrome. The latest one is using firefox. So could be the same error, sorry I’m new to this.
Thanks.
@mattdallan I cannot find a solution to this problem, the only option I can think of for now is not showing it in the minicart. How can I stop it from displaying in the minicart but still show up on the cart page and checkout? Thank you.
@kds26 I think the best thing to do next is confirm that it’s really the caching plugin and not something else.
If you switch your site’s theme to Storefront and deactivate all plugins, do those errors still happen? If not, do they reappear after the caching plugin is activated?
If this is being caused by the caching plugin and it doesn’t seem to want to work with the updated JavaScript, you could also https://docs.woocommerce.com/document/paypal-express-checkout/#section-23 by adding this filter:
add_filter( 'woocommerce_paypal_express_checkout_use_legacy_checkout_js', '__return_true' );
If you would like to not use Smart Payment Buttons, you can use this filter:
add_filter( 'woocommerce_paypal_express_checkout_disable_smart_payment_buttons', '__return_true' );
Let us know how that works out.
We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.
– Joey
- The topic ‘Minicart Button Disappearing’ is closed to new replies.