woocommerce / woocommerce-blocks

(Deprecated) This plugin has been merged into woocommerce/woocommerce
https://wordpress.org/plugins/woo-gutenberg-products-block/
GNU General Public License v3.0
406 stars 219 forks source link

Payment method required when order value is 0 #6178

Closed bertrandhumm closed 2 years ago

bertrandhumm commented 2 years ago

Describe the bug

A valid payment method is requested at checkout even when order value is null (stripe payment gateway)

To reproduce

Steps to reproduce the behavior:

  1. Add a product to the cart (a booking in my case)
  2. Proceed to checkout and fill in your details
  3. Add a coupon worth the cart amount
  4. Submit order

Expected behavior

The order should be placed The coupon should be burnt The order details should be displayed on screen

Screenshots

image

Environment

WordPress (please complete the following information):

Desktop (please complete the following information):

Smartphone (please complete the following information):

alexflorisca commented 2 years ago

Hi @bertrandhumm thanks for submitting the issue. I just tried to replicate it and I wasn't able to. For me, when I input the coupon that is greater than the total, the payment options disappear and I'm able to place my order.

Could you try disabling your other plugins and trying again? If you're still having the issue, could you provide some more details.

bertrandhumm commented 2 years ago

Hi @alexflorisca,

Thanks for trying to replicate. I also tried on my staging environment and the same happened.

I was surprised of such obvious bug at first so I did try to disable a few plugins and even downgraded woocommerce-gutenberg-products-block to see if things improved. Not at all. However, going back to the woocommerce_checkout shortcode did work so the live eshop is no more impacted.

Please find here a video screengrab from the staging environment which demonstrates the bug + woocommerce status report below

`

WordPress Environment

WC Version: 6.3.1 REST API Version: ✔ 6.3.1 WC Blocks Version: ✔ 7.3.0 Action Scheduler Version: ✔ 3.4.0 WC Admin Version: ✔ 3.2.1 Log Directory Writable: ✔ WP Version: 5.9.2 WP Multisite: – WP Memory Limit: 512 Mo WP Debug Mode: ✔ WP Cron: ✔ Language: fr_FR External object cache: –

Database

WC Database Version: 6.3.1 WC Database Prefix: studio_ Taille totale de la base de données: 179.89MB Taille de la base de données: 118.67MB Taille de l’index: 61.22MB

Security

Secure connection (HTTPS): ✔ Hide errors from visitors: ✔

Active Plugins (33)

Admin Menu Editor: par Janis Elsts – 1.10 Complianz | GDPR/CCPA Cookie Consent: par Really Simple Plugins – 6.1.2 Email Log: par Sudar – 2.4.8 Facebook for WooCommerce: par Facebook – 2.6.12 Jetpack: par Automattic – 10.7 Kadence Blocks – Gutenberg Blocks for Page Builder Features: par Kadence WP – 2.3.0 Mailchimp for WooCommerce: par Mailchimp – 2.6.2 Revolut Gateway for WooCommerce: par Revolut – 3.1.6 Tiles Badge Block: par UseTiles.com – 0.1.0 UpdraftPlus - Sauvegarde/Restauration: par UpdraftPlus.Com DavidAnderson – 1.22.11

WebP Converter for Media: par Mateusz Gbiorczyk – 4.2.4 WooCommerce Blocks: par Automattic – 7.3.0 WooCommerce Zettle Integration: par BjornTech AB – 7.6.3 Advanced Order Export For WooCommerce: par AlgolPlus – 3.2.2 Preview E-mails for WooCommerce: par Digamber Pradhan – 2.0.2 WooCommerce Advanced Ajax Layered Navigation: par WooCommerce – 1.7.0 WooCommerce Bookings Availability: par WooCommerce – 1.1.19 WooCommerce Bookings: par Woocommerce – 1.15.53 Follow-Up Emails: par WooCommerce – 4.9.19 (une mise à jour de la version 4.9.20 est disponible) WooCommerce Stripe Gateway: par WooCommerce – 6.3.0 WooCommerce Google Analytics Pro: par SkyVerge – 1.11.1 (une mise à jour de la version 1.12.0 est disponible) WooCommerce Print Invoices/Packing Lists: par SkyVerge – 3.11.4 WooCommerce Smart Coupons: par StoreApps – 5.0.0 Inoui Studio Subscriptions Extender: par Bertrand Humm – 1.0 Abonnements WooCommerce: par WooCommerce – 4.1.0 WooCommerce: par Automattic – 6.3.1 Yoast SEO Premium: par L’équipe Yoast – 18.1 Yoast SEO: par L’équipe Yoast – 18.4.1 Mail logging - WP Mail Catcher: par James Ward – 1.5.4 WP Mail Logging: par Wysija – 1.10.4 WP Rollback: par GiveWP.com – 1.7.1 WPC Variations Radio Buttons for WooCommerce: par WPClever – 3.0.4 Yoast SEO : WooCommerce: par L’équipe Yoast – 14.6

Settings

API Enabled: – Force SSL: – Currency: EUR (€) Currency Position: right Thousand Separator: Decimal Separator: , Number of Decimals: 0 Taxonomies: Product Types: booking (booking) external (external) grouped (grouped) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription)

Connected to WooCommerce.com: ✔

Prise en charge de la passerelle de paiement

Stripe: products refunds tokenization add_payment_method subscriptions subscription_cancellation subscription_suspension subscription_reactivation subscription_amount_changes subscription_date_changes subscription_payment_method_change subscription_payment_method_change_customer subscription_payment_method_change_admin multiple_subscriptions

Status report information

Generated at: 2022-04-01 18:43:46 +02:00 `

alexflorisca commented 2 years ago

Thanks @bertrandhumm. First, can you try to disable all plugins except WooCommerce, WooCommerce Blocks and Bookings and see if you can replicate it? If you can't then activate plugins one by one and see where the problem happens. I think it's likely an integration issue, probably with WooCommerce Bookings if I was to guess.

@tarunvijwani Can you try to replicate this with the Woocommerce Bookings installed as in the video?

tarunvijwani commented 2 years ago

It is working fine with Woocommerce Bookings. Here is the screen recording:

https://user-images.githubusercontent.com/11503784/161558560-79fb1fb9-5927-4c9d-a89b-91f6011b4ae4.mov

It's possible that there's a conflict with another plugin. To confirm, please disable all plugins except WooCommerce, WooCommerce Blocks, and Bookings.

bertrandhumm commented 2 years ago

Hi both and thanks for your support.

I deactivated every single plugin one after the other and finally found Smart Coupons was causing the issue.

I just had a look online. A newer version (5.1) was made available last friday and the changelog mentions a fix for "Store credit not applying discount when applied via REST API during order creation"

Do you think that could be the cause. Is the Woo Gutenberg Blocks relying on the API rather than wp functions?

bertrandhumm commented 2 years ago

Hi @alexflorisca, @tarunvijwani. Just updated Smart Coupons on staging to 5.1 and I can confirm the order submission went trough as expected ! Definitely a bug which was identified by their team and fixed with this release. Sorry for raising this here in the first place, I should have raised it with them instead. Thanks again for your help anyway !