[FIX] website_sale: check pickUp list

To reproduce
============
- Website > Shipping methods > Pick-up in store
- Add a description displayed on the eCommerce
- add at least 3 or 4 lines with "enter" in between the lines.
- from the shop select Pick-up in store, the payment button will be locked

Problem
=======
- The method `_disablePayButtonNoPickupPoint` checks if there are pickup points
in a shipping method based on the count of children in the selected method
- The description will be counted as child which breaks the checking

Solution
========
check the existence of `.o_list_pickup_locations` instead

opw-3628025

closes odoo/odoo#149163

X-original-commit: cfaa0d47de2b4931f23994061ec489ae5705f181
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
This commit is contained in:
Abdelouahab (abla)
2024-01-12 11:18:03 +00:00
parent d49f94315a
commit a62f4c30d9
@@ -205,11 +205,12 @@ publicWidget.registry.websiteSaleDelivery = publicWidget.Widget.extend({
_disablePayButtonNoPickupPoint : function (ev){
const selectedCarrierEl = ev.currentTarget.closest('.o_delivery_carrier_select');
const address = selectedCarrierEl.querySelector('.o_order_location_address').innerText
const isPickUp = selectedCarrierEl.lastChild.previousSibling.children;
const orderLocationContainer = selectedCarrierEl.querySelector('.o_order_location').parentNode;
const hasPickUpLocations = selectedCarrierEl.querySelector('.o_list_pickup_locations');
document.querySelectorAll('.error_no_pick_up_point').forEach(el => el.remove());
if (isPickUp.length > 1 && (address == "" || isPickUp[0].classList.contains("d-none"))) {
if (hasPickUpLocations && (address == "" || orderLocationContainer.classList.contains("d-none"))) {
this._disablePayButton();
const errorNode = document.createElement("i");
errorNode.classList.add("small", "error_no_pick_up_point","ms-2");