Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
651 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jul 25
857
0
dic 16
3892
4
mar 15
6626
1
jul 25
133
0
jul 25
65