[ADD] user friendly error handling for restricted qty on ecommerce app
Some checks failed
pre-commit / pre-commit (pull_request) Has been cancelled

This commit is contained in:
2026-08-18 17:52:11 +02:00
parent a140edb60e
commit 5d8293f73e
10 changed files with 393 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Product page: tell the customer about the orderable quantities,
right below the quantity selector and the add-to-cart button. -->
<template id="product_restricted_qty_info"
inherit_id="website_sale.product_quantity"
name="Restricted Quantity Information">
<xpath expr="//div[@id='add_to_cart_wrap']" position="after">
<t t-set="qty_hint" t-value="product._get_restricted_qty_hint()"/>
<div t-if="qty_hint"
class="o_wsale_qty_restriction alert alert-info d-flex align-items-center w-100 mt-2 mb-0 py-2 px-3">
<i class="fa fa-info-circle me-2" role="img" aria-label="Information"/>
<span t-out="qty_hint"/>
</div>
</xpath>
</template>
</odoo>