Skip to content

Commit

Permalink
[FIX] website_sale: Terms and conditions keep button disabled
Browse files Browse the repository at this point in the history
Steps to reproduce:
- Setup sendcloud shipping (shipping product 10-30KG)
- Enable demo payment
- On the website proceed to checkout (customizable desk)
- Select sendcloud (Pay button is disabled)
- Edit website and add terms and conditions
- Now if you uncheck and recheck terms and conditions
- Pay button is enabled although carrier is in error

Fix:
when reenabling the pay button we check that the
carrier is ready but we only check if there's pickup point
ensure that the shipping method is avialable before enabling
the pay button

opw-3698804

closes odoo#159133

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
  • Loading branch information
HANNICHE-Walid committed Mar 27, 2024
1 parent 31fca02 commit 7682c4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addons/website_sale/static/src/js/payment_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ paymentButton.include({
return false; // Nothing else to check.
}
const carriersContainer = checkedCarriers[0].closest('.o_delivery_carrier_select');
if (carriersContainer.querySelector('.o_wsale_delivery_carrier_error')) {
// Rate shipment error.
return false;
}
const isPickUpPointRequired = carriersContainer.querySelector('.o_show_pickup_locations');
if (isPickUpPointRequired) {
const address = carriersContainer.querySelector(
Expand Down

0 comments on commit 7682c4b

Please sign in to comment.