跳至內容
選單
此問題已被標幟
1 回覆
3201 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
3月 24
3453
1
11月 21
2876
0
10月 24
1285
0
6月 24
1603
1
5月 24
3324