Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
734 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 25
1106
0
gru 16
3962
4
mar 15
6767
4
sie 25
1022
1
lip 25
359