[FIX] website_sale_aplicoop: force enable cart buttons
This commit is contained in:
parent
6cc0a18de3
commit
62a1c4e1e9
1 changed files with 14 additions and 0 deletions
|
|
@ -611,6 +611,20 @@
|
|||
return Math.round(value * factor) / factor;
|
||||
}
|
||||
|
||||
// Safety net: ensure add-to-cart buttons stay enabled in case a stale
|
||||
// cached template left the "disabled" attribute or a legacy class.
|
||||
// Stock validation happens server-side on confirm; here we keep the UI usable.
|
||||
var forceEnableCartButtons = function () {
|
||||
var buttons = document.querySelectorAll(".add-to-cart-btn");
|
||||
buttons.forEach(function (btn) {
|
||||
if (btn.hasAttribute("disabled")) {
|
||||
btn.removeAttribute("disabled");
|
||||
}
|
||||
btn.classList.remove("btn-disabled");
|
||||
});
|
||||
};
|
||||
forceEnableCartButtons();
|
||||
|
||||
// ============ ATTACH CHECKOUT BUTTONS (ALWAYS, on any page) ============
|
||||
// These buttons exist on checkout page, not on cart pages
|
||||
if (!this._cartCheckoutListenersAttached) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue