Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
730 Visualizzazioni

So you can't add or buy more than 1 copy of the same course at a time which makes sense, however I'm trying to have Variants/Attributes to my course and when I do I become able to add more than one copy!

I have one course that has 3 tiers.

you can't add the same tire twice but you can add tire 1 and tire 3 of same course to your cart for example and then I get users telling my the total is too high.

Any fix?

Odoo 18v

Avatar
Abbandona
Risposta migliore

Odoo doesn’t natively limit how many different variants of a product can be added to the cart, but you can achieve this with a custom module or by using website sale hooks.

Here’s how you can approach it:

  1. Custom Python Logic
    • Override the website_sale.cart_update_json() method.
    • Add a condition to check how many different variants of the course are already in the cart.
    • If it exceeds the limit (e.g., 1), block the addition and return a warning.
  2. Alternative: Attribute Filtering
    • If you only want to show limited attribute combinations, configure those under: Sales → Products → Attributes → Values
    • Or use the “Optional Products” feature in the Sales tab to guide user selection.
  3. UI Alert (Optional)
    • Use JavaScript to show a message when a user tries to add more than one course variant.

At Wan Buffer Services, we’ve helped many eLearning businesses restrict product configurations and checkout behavior based on business rules.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
lug 25
1106
0
dic 16
3962
4
mar 15
6767
4
ago 25
1022
1
lug 25
359