• Resolved luxtools

    (@luxtools)


    At first I loved these plug-ins.. .they seemed streamlined and I loved how they were displayed… but for whatever reason, when a variation of a product is chosen, you can no longer click on apple pay or paypal. What’s more confusing, is further down the page, I have the express buttons featured again, where it’s the OTHER varaition that does not work with your plug ins?

    Sometimes, it also says the address is incorrect… I disabled any currency switching as I read that could be the case, but that solved nothing. I just can’t see any consitency in the issues I am having, as it sometimes changes.

    And more confusingly, your buttons do indeed work at the checkout page, even if they didn’t work on the product page?

    I have enabled other paypal and stripe plug ins and they work flawlessly, but I prefer the look of yours. You can see they are all currently enabled to test for yourself (so the page looks like a mess).

    I disabled all other plug ins and tried different themes with no success.

    I just checked and it now looks like your paypal payment option isn’t even loading on the product page now.

    The page I need help with: [log in to see the link]

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

    (@mrclayton)

    Hi @luxtools

    Sometimes, it also says the address is incorrect

    When the plugin provides notice in the payment wallet, whether it’s Apple Pay or GPay, that’s because the WooCommerce shipping calculation returns an empty list of shipping methods. If your customer selects a shipping address that your store does not ship to, then that notice will be shown.

    Are you using a plugin for shipping functionality or relying solely on WooCommerce’s shipping? What we have found with some shipping plugins is they limit the shipping options unless the request is coming from the checkout page. Therefore, a request coming from the product page can result in shipping options not being returned to the payment method.

    I just checked and it now looks like your paypal payment option isn’t even loading on the product page now.

    I see you’re using Elementor and that explains why you’re not seeing the payment buttons on your product page. Depending on how your product page has been designed using Elementor, sometimes the action woocommerce_after_add_to_cart_button and woocommerce_before_add_to_cart_button are not triggered. Those are actions which WooCommerce always triggers in the product template, but when Elementor is used, those actions can sometimes be excluded. The Stripe plugin and PayPal plugin use those actions to render the express payment buttons on the product page.

    Because of this behavior with Elementor, we offer the shortcode wc_stripe_payment_buttons for the Stripe plugin. Elementor has a shortcode widget where you can add that shortcode on your product page and that will render the payment buttons. The PayPal button has a product page payment button widget which you can use to place the button or you can use shortcode ppcp_product_buttons.

    Kind Regards

    Thread Starter luxtools

    (@luxtools)

    Ok thank you very much for the response, it’s appreciated !

    Did you have a look for yourself? The buttons are now being rendered (except often the Apple pay is greyed out, only for one variation… and the PayPal window opens and closes, again for one variation). It’s just confusing as the variation this happens on often changes. The other gateway plugins work perfectly, but I really want to use yours.

    anyway I’ll try your suggestions and see if that makes any difference at all. Also regarding the shipping options, I am using DSERS which is an AliExpress link which I can test further. So that may have something to do with it, which I did consider before. Just a shame that it works with other stripe/PayPal plugins and not this one

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @luxtools

    The reason PayPal is opening and then closing is because there is an error being triggered by the PayPal API. Here is the error message:

    Expected currency from order api call to be GBP, got USD. Please ensure you are passing currency=USD to the sdk url.

    Reviewing your product page here, the currency is shown as GBP and the www.paypal.com/sdk/js script correctly has GBP as the currency. However, it appears when the plugin is creating the PayPal order object (that occurs when you click the PayPal button), WooCommerce is telling it the currency is USD.

    So it seems your currency switcher plugin is losing its reference to the GBP currency. The PayPal plugin uses the WooCommerce provided function get_woocommerce_currency which is best practice.

    Also regarding the shipping options, I am using DSERS which is an AliExpress link which I can test further. So that may have something to do with it, which I did consider before. Just a shame that it works with other stripe/PayPal plugins and not this one

    You can create a support ticket here regarding the DSERS shipping plugin.

    The buttons are now being rendered (except often the Apple pay is greyed out, only for one variation

    Yes, for the 128GB variation.

    {
        "code": "cart-error",
        "message": "Invalid value posted for Storage",
        "data": {
            "status": 200
        }
    }

    Here is the request payload for that error:

    product_id: 1425
    variation_id: 1442
    qty: 1
    payment_method: stripe_applepay
    currency: GBP
    page_id: product
    attribute_storage: 64G

    Notice that the attribute_stoarge value is 64G but for product variation 1442, the attribute_storage value should be 128G. So why is that value incorrect? The answer is, your product page has two select elements with a name of name="attribute_storage". Name attributes are supposed to be unique in HTML. But, your product page shows your variation and product options twice, once at the top of the page and again towards the middle.

    Since the attribute_storage value is duplicated, the plugin takes the last value in the list, which is 64G.

    As an experiment to test this behavior, select the 128G variation for both product sections and then click Apple Pay. Notice that the button will work this time since the 128G attributes aligns with the variation ID.

    My recommendation would be to not have your product info duplicated on that page and just show it once.

    Kind Regards

    Thread Starter luxtools

    (@luxtools)

    Damn i’m just seeing this now!

    I have been troubleshooting and came to the same conclusion that it’s because it’s duplicated. A real shame I can’t have multiple “add to cart” buttons on the page — this seems like a bit of a flaw, but I suppose not the end of the world.

    I believe it’s the sole reason i was experiencing any errors, as the currency switching doesn’t seem to affect it? Paypal was closing on the same variation that the Apple Pay button was greyed out; because there were duplicates on the page. Now everything works fine with just one instance of a payment buttons.

    I believe you were seeing the USD because I had currency switcher on test mode in USD.

    PS the buttons don’t seem to be centred for me (slightly aligned to the left) — is there anyway to fix. Many thanks, I really appreciate your help.

    Plugin Author Payment Plugins

    (@mrclayton)

    A real shame I can’t have multiple “add to cart” buttons on the page — this seems like a bit of a flaw, but I suppose not the end of the world.

    Are you using a plugin for this functionality? If not, what is your process for rendering the duplicate product add to cart section? I see you’re using Elementor, is that a custom product page template?

    the buttons don’t seem to be centred for me (slightly aligned to the left) — is there anyway to fix.

    The following CSS will make the buttons take up the same amount of space as their container.

    .wc_stripe_product_payment_methods li {
        max-width: 100% !important;
    }

    Kind Regards

    Thread Starter luxtools

    (@luxtools)

    Thanks a lot, the code worked a treat!!

    i use Elementor, which allows you to add as many “add to cart” buttons as you’d like. I am however using a custom template for the first section as the theme I’m using requires it for products.

    is there a way to do this but without rendering your plug-in twice? (So it would just be add to cart, with no express options).

    I’d like to use this on my other site but i use multiple add to cart buttons. I guess I could do what I did with this one with having a “buy now” button which simply brings the user back to the top of the page, but I’m curious.

    thanks again. Your plug ins are still the cleanest looking express buttons in my opinion.

    • This reply was modified 1 year, 4 months ago by luxtools.
    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @luxtools

    We’ve been working on a solution that accounts for when a product page has multiple Add to Cart buttons. If you’d like to test this update, please create a support ticket here.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Many issues. Not working (paypal or stripe)’ is closed to new replies.