• Resolved cargarm3

    (@cargarm3)


    Hello! On our site https://photo-to-text.com/, when we create our product and apple pay button is shown, if you make clic to “Pay with Apple Pay”, an order with 0 items and $0.00 is created.

    Is there any way to solve it?
    Is there any way to show only the Apple pay button when checking out? (we have tried with

    add_filter( 'wc_stripe_hide_payment_request_on_product_page', '__return_true' );

    but does not work.

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support wpnomad a11n

    (@wpnomad)

    Hi there,

    Is there any way to show only the Apple pay button when checking out?

    The code you added is to hide the payment request buttons on the product page. It won’t, however, show the payment request button on the checkout page.

    To add the payment request button on the checkout page, please use this code: https://docs.woocommerce.com/document/stripe/#section-48

    Do let us know how that goes and if you need any further help from us.

    Thread Starter cargarm3

    (@cargarm3)

    I’ve inserted both codes, so it should only be shown at checkout and not on the product page … and it is shown on joth.

    Furthermore, The reason to hide it on the product page is because it shows 0 items with value $0.00 (works wrong).

    Any solution?

    Thank you!

    Plugin Support dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hi @cargarm3

    add_filter( 'wc_stripe_hide_payment_request_on_product_page', '__return_true' );

    I’ve retested this code myself and I can confirm it removes the Payment Request button from the product page.

    You can see that by adding a product to the cart then going to checkout on my test site – https://dev.doug.press/product/long-sleeve-tee/

    Here is a screenshot of my functions.php file showing these three snippets.
    1. Remove from product page
    2. Remove from cart page
    3. Add to checkout by in default position

    Stripe custom code
    Link to image: https://d.pr/i/K1i8CQ

    Furthermore, The reason to hide it on the product page is because it shows 0 items with value $0.00 (works wrong).

    Looking at the site in desktop Safari, I can see Apple Pay shows zero even with a variation price showing on the product page. This would be related to your theme as that is how the price is displayed, something is not allowing the variation price to be passed to Apple Pay.

    If you feel the custom code is correct but this is not working, I’d recommend testing on a staging site and using the snippet in a default theme with only WooCommerce and the Stripe plugin active.

    Thanks,

    Thread Starter cargarm3

    (@cargarm3)

    Thank you. Finally I removed the Payment Request button from the product page with this other code:

    add_action('wp_enqueue_scripts','my_custom_css_do');
    function my_custom_css_do()
    { 
      $texto_url=$_SERVER['REQUEST_URI'];
     	 if(strpos($texto_url,'/product/') !== false)
    	   {
    	   		echo "<script>
    		    var elemento = document.getElementsByClassName('apple-pay-button-wrapper');
     			elemento[0].style.display='none';
    		   </script>";
           }
    }
    add_filter( 'wc_stripe_show_payment_request_on_checkout', '__return_true' );

    Now, the problem is on the /shop/cart. The Apple Pay button works, but the button of “Proceed to checkout” does not work (I make clic there and there is no action).

    Thread Starter cargarm3

    (@cargarm3)

    I’ve debugged it and at /shop/cart and on Safari (and some product in the chart), the button does not work. On the other browser works with no problem.

    Atached is the Console error : https://we.tl/t-p71Z9U1cx1

    RangeError: “amex,diners,discover,jcb,mastercard,visa” is an invalid payment method identifier.

    Thank you.

    Plugin Support John Coy a11n

    (@johndcoy)

    Automattic Happiness Engineer

    Hi @cargarm3

    Do you have this issue after switching back to a default theme like Twenty Twenty-One and disabling all plugins except for WooCommerce and Stripe?

    Here is a link that better outlines that process:

    https://docs.woocommerce.com/document/woocommerce-self-service-guide/#section-4

    If this fixes the issue, then re-enable each plugin one at a time, then the theme, until you find the one that’s causing the conflict.

    Plugin Support dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hi @cargarm3

    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.

    Thanks,

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Problems orders 0 items with Apple Pay’ is closed to new replies.