[FIX] website_sale_aplicoop: enable add to cart

This commit is contained in:
snt 2026-02-27 13:30:00 +01:00
parent 130a5ff6c4
commit d58c621ef1

View file

@ -150,7 +150,7 @@
<script type="text/javascript">
(function() {
'use strict';
console.log('[eskaera_page] Loading translated labels for category selector');
// console.log('[eskaera_page] Loading translated labels for category selector');
// Fetch translated labels from endpoint
fetch('/eskaera/labels', {
@ -162,13 +162,13 @@
})
.then(response =&gt; response.json())
.then(labels =&gt; {
console.log('[eskaera_page] Labels received:', labels);
//console.log('[eskaera_page] Labels received:', labels);
// Update category selector first option text
var categorySelect = document.getElementById('realtime-category-select');
if (categorySelect &amp;&amp; categorySelect.options[0] &amp;&amp; labels &amp;&amp; labels.all_categories) {
categorySelect.options[0].text = labels.all_categories;
console.log('[eskaera_page] Updated category selector to:', labels.all_categories);
// console.log('[eskaera_page] Updated category selector to:', labels.all_categories);
} else {
console.log('[eskaera_page] Could not update category selector');
console.log(' categorySelect:', !!categorySelect);
@ -212,7 +212,7 @@
</template>
<template id="eskaera_shop" name="Eskaera Shop">
<t t-call="website.layout">
<div id="wrap" class="eskaera-shop-page oe_structure oe_empty" data-name="Eskaera Shop" t-attf-data-delivery-product-id="{{ delivery_product_id }}" t-attf-data-delivery-product-name="{{ delivery_product_name }}" t-attf-data-delivery-product-price="{{ delivery_product_price }}" t-attf-data-home-delivery-enabled="{{ 'true' if group_order.home_delivery else 'false' }}">
<div id="wrap" class="eskaera-shop-page oe_structure oe_empty" data-name="Eskaera Shop" t-attf-data-delivery-product-id="{{ delivery_product_id or '' }}" t-attf-data-delivery-product-name="{{ delivery_product_name or '' }}" t-attf-data-delivery-product-price="{{ delivery_product_price or '' }}" t-attf-data-home-delivery-enabled="{{ 'true' if group_order.home_delivery else 'false' }}">
<div class="container">
<div class="row mb-4">
<div class="col-lg-12">
@ -346,9 +346,6 @@
<div class="card-header d-flex justify-content-between align-items-center gap-1">
<h6 class="mb-0 cart-title-sm" id="cart-title">My Cart</h6>
<div class="btn-group cart-btn-group gap-0" role="group">
<button type="button" class="btn btn-warning cart-btn-compact" id="home-delivery-btn" t-attf-data-order-id="{{ group_order.id }}" data-bs-title="Home Delivery" data-bs-toggle="tooltip">
<i class="fa fa-truck cart-icon-size" />
</button>
<button type="button" class="btn btn-primary cart-btn-compact" id="save-cart-btn" t-attf-data-order-id="{{ group_order.id }}" data-bs-title="Save Cart" data-bs-toggle="tooltip">
<i class="fa fa-save cart-icon-size" />
</button>
@ -685,7 +682,7 @@
<button class="qty-increase" type="button" t-attf-data-product-id="{{ product.id }}" aria-label="Increase quantity">
<i class="fa fa-plus" />
</button>
<button t-attf-class="add-to-cart-btn {{ 'btn-disabled' if product.is_out_of_stock else '' }}" type="button" t-attf-disabled="{{ 'disabled' if product.is_out_of_stock else '' }}" t-attf-aria-label="{{ 'Out of stock' if product.is_out_of_stock else 'Add %s to cart' % product.name }}" t-attf-title="{{ 'Out of stock' if product.is_out_of_stock else 'Add %s to cart' % product.name }}">
<button t-attf-class="add-to-cart-btn {{ 'btn-disabled' if product.is_out_of_stock else '' }}" type="button" t-att-disabled="product.is_out_of_stock or None" t-attf-aria-label="{{ 'Out of stock' if product.is_out_of_stock else 'Add %s to cart' % product.name }}" t-attf-title="{{ 'Out of stock' if product.is_out_of_stock else 'Add %s to cart' % product.name }}">
<i t-attf-class="fa {{ 'fa-ban' if product.is_out_of_stock else 'fa-shopping-cart' }}" aria-hidden="true" />
</button>
</div>