Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2633 Переглядів

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!

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
бер. 24
2748
1
лист. 21
2356
0
жовт. 24
715
0
черв. 24
930
1
трав. 24
1990