$ 31.62
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
eCommerce (website_sale)
• Website (website) • Invoicing (account) • Discuss (mail) |
| Lines of code | 85 |
| Technical Name |
d_website_sale_cart_quantity |
| License | OPL-1 |
| Website | https://duong-odoo-apps.odoo.com |
| Versions | 17.0 18.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
eCommerce (website_sale)
• Website (website) • Invoicing (account) • Discuss (mail) |
| Lines of code | 85 |
| Technical Name |
d_website_sale_cart_quantity |
| License | OPL-1 |
| Website | https://duong-odoo-apps.odoo.com |
| Versions | 17.0 18.0 |
CONFIGURABLE CART QUANTITY PER CATEGORY
Set custom default cart quantities for each product category with smart hierarchy inheritance
This module allows you to configure default cart quantity for each product public category instead of using a fixed hard-coded value.
Perfect for businesses that sell different types of products requiring different default quantities - from single luxury items to bulk consumables.
Key Features
- Category-based Configuration: Set different default quantities for different product categories
- Easy Backend Management: Configure quantities directly from the product category form
- Dynamic Frontend Updates: Real-time quantity updates when customers browse different products
- Smart Fallback System: Automatic fallback to quantity 1 if no configuration is found
How to Configure
- Go to Website > Configuration > eCommerce > Product Categories
- Select the category you want to configure
- Set the "Default Cart Quantity" field:
- Value > 0: Category will use this specific quantity
- Value = 0 or empty: Category will inherit from parent category
- Save and test on your website frontend
Configuration Tips:
- Start with Parent Categories: Set default quantities for main categories first (e.g., Furniture = 2)
- Override When Needed: Only set values for child categories when you need different behavior
- Use 0 for Inheritance: Leave child categories at 0 to automatically inherit from parents
- Test the Hierarchy: Check products assigned to different category levels to verify inheritance works correctly
Use Cases
Food & Beverages
Set default quantity to 2 for drinks, 1 for main dishes
Home & Garden
Set quantity 4 for light bulbs, 1 for furniture
Electronics
Set quantity 1 for phones, 2 for accessories
Fashion
Set quantity 1 for clothing, 3 for socks
Smart Category Hierarchy Logic
The module uses an intelligent priority system that respects category parent-child relationships:
Priority Order for Default Quantity:
- Child Category First: If product is assigned to a specific category (e.g., "Furniture Couches") and it has a default quantity > 0, use that value
- Parent Category Fallback: If child category has no value (0 or empty), look up the hierarchy to parent categories (e.g., "Furniture")
- System Default: If no category in the hierarchy has a configured value, use quantity 1
Example Scenario:
Category Hierarchy: Furniture (default_cart_quantity = 2) âââ Furniture Couches (default_cart_quantity = 0) â inherits 2 from parent âââ Furniture Tables (default_cart_quantity = 1) â uses own value 1 âââ Furniture Chairs (default_cart_quantity = 3) â uses own value 3 Product Assignment Results: ⢠Product A â assigned to "Furniture Couches" â Default Quantity: 2 (inherited from Furniture) ⢠Product B â assigned to "Furniture Tables" â Default Quantity: 1 (own value) ⢠Product C â assigned to "Furniture Chairs" â Default Quantity: 3 (own value) ⢠Product D â assigned to "Furniture" only â Default Quantity: 2 (parent value)
How It Works:
- Automatic Inheritance: Child categories automatically inherit from parents when their value is 0 or empty
- Override Capability: Set any value > 0 in child category to override parent inheritance
- Multi-level Support: Works with unlimited category depth (grandparent â parent â child â grandchild...)
- Real-time Updates: Changes to parent categories automatically affect children with no custom values
SUPPORT EMAIL
contact me for support duongodooapps@gmail.com
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module