• Hi guys,

    I’m receiving the following woocommerce notice error for logged in users on my product page. When logged out , the woocommerce notice disappears. I have tested and it is caused by your plugin. Any idea what error is this referring to?

    “Cannot read properties of undefined (reading ‘variation’)”

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @kraken85

    The variation data is stored as a data attribute in the express payment method html. Usually that JS error indicates you are not rendering the express buttons but the express payment scripts are being enqueued.

    You likely have some functionality that’s conditionally rendering sections of your product page based on the user’s logged in status.

    Kind Regards

    Plugin Author Payment Plugins

    (@mrclayton)

    @kraken85 If you are using a cache plugin then that could also be the culprit. Some cache plugins combine many scripts into one via minification which means the product page express button scripts could be included in a common minification file even if you don’t have those express payment options enabled on your product page.

    I’d take a look at your cache settings and see if it’s something related to your settings there.

    Kind Regards

    Thread Starter kraken85

    (@kraken85)

    Im using litespeed cache plugin. I have disabled it now, yet the error still appears ??

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @kraken85

    Can you share a website link so we can review the product page of your site?

    Kind Regards

    Thread Starter kraken85

    (@kraken85)

    https://stagingnew.senaglobal.co/product/pre-cleanse-treatment-10ml/

    you have to be a logged-in user to see the error

    Test user account

    Username : test

    pwd: test1234

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @kraken85

    Make sure your product page is triggering the action woocommerce_after_add_to_cart_button. That’s what our plugin uses to render the express payment buttons and it looks like the page builder you used isn’t triggering that WooCommerce action.

    Or you could use shortcode [wc_stripe_payment_buttons] on your product page as well.

    Please don’t share credentials on www.remarpro.com, that is against the forum guidelines.

    Kind Regards

    Thread Starter kraken85

    (@kraken85)

    i have added the shortcode but to no avail. Error still pops up

    Plugin Author Payment Plugins

    (@mrclayton)

    @kraken85 Here is a screenshot of the Javascript files being loaded on your product page. The scripts like applepay-checkout.js etc should not be loading on your product page since they are reserved for the checkout page.

    Something on your site is causing those scripts to be enqueued, which is not how this Stripe plugin is designed.

    I also don’t see where the express payment method html is rendering. If you go to the Apple Pay Settings page do you actually have Apple Pay enabled for product pages?

    Kind Regards

    Thread Starter kraken85

    (@kraken85)

    yes – i have the following payment methods enabled in the plugin settings

    Credit Card

    ApplePay

    Gpay

    Grabpay

    I have even removed all payment sections

    View post on imgur.com

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @kraken85

    My recommendation would be to start with just WooCommerce and the Stripe plugin installed. Something is causing the checkout page scripts to load on your product page.

    See if a basic site behaves as expected and then work your way forward by enabling plugins. That will help you narrow down the cause of the issue.

    Kind Regards

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Cannot read properties of undefined (reading ‘variation’)’ is closed to new replies.