Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3067 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
bře 24
3358
1
lis 21
2829
0
říj 24
1187
0
čvn 24
1492
1
kvě 24
3105