Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3035 Vizualizări

I have a promotion that I need applied as follows:

Buy 4 x Item A and get 1 x Item B for free

However, the promotion should not be limited to one per order, so if the sale includes 12 item A, the reward should be 3 x item B.

In the base configuration, even when the sale includes 12 item A, the reward is still only 1 x item B.

¿How can I configure this behaviour?

Thank you!

Imagine profil
Abandonează
Cel mai bun răspuns

You could override the write method to display the correct amount of items or define an onchange method on the item count

onchange sounds easier

@api.onchange('items')

def _onchange_items(self):

 promotion_item_amount = len(self.items)//4

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mar. 24
3333
1
nov. 21
2812
0
oct. 24
1184
0
iun. 24
1480
1
mai 24
3032