8530d1233b72d35a9aad7b0490bb3da52faf24ce
The two modules both implemented the cart update warnings box
incorrectly, and differently (though in part because of later
changes):
- `aria-hidden` has meant `display: none` for a while, so the dismiss
button would never show up
- the class is alert-dismiss*i*ble, not alert-dismiss*a*ble
- unnecessarily complicated dom manipulation on updating the warning
- wishlist would go and update the cart badge by hand, unnecessarily
Extracted the warnings stuff to its own helper, with a fixed DOM, and
a slightly modified structure so it's possible to update the message
without having to rewrite the entire box content.
Also modified wishlist to update the cart badge via the existing
helper, this way both modules just call
updateCartNavBar(data);
showWarning(data.warning);
the same way in the same order, and everything is clear.
Also updated `updateCartNavBar`:
- removed the iteration as jQuery should be able to work on the set
- added the warning message and an icon if the quantity is 0 (could
not add to cart) as the separate warning may not be available on all
pages e.g. "recently viewed" product widget can appear anywhere,
previously was only set through wishlist
- keep reveal of cart quantity ancestor as on some pages it's not
visible by default (see previous item for user-case)
closes odoo/odoo#96047
X-original-commit: 2ff55c5fd684ab701cf143d3b0d46979759a8e9f
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%