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

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!

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mar 24
3384
1
nov 21
2839
0
ott 24
1242
0
giu 24
1525
1
mag 24
3178