I have a product wich includes a "main product" and several "sub products". So I have added the "sub products" as bundled items to the "main prodcut" (AddProductToBundle). I would like to make the "sub products" price to become 0 while they are added these way. I have looked at Pipelines, Events, Calculators. But with no success. I would love some input on this.
I think your best bet would be to implement a custom IOrderLineCalculator inheriting from the default OrderLineCalculator and in it, override the CalculateOrderLineUnitPrice and if the order line belongs to a bundle, return a zero price, otherwise return the price calculated from the base implementation.
I'm happy to help but you could you please raise this as a new question of it's own rather than replying on the end of an already marked as answered question.
It just helps keeps things clear and searchable for others that have the same problem.
Bundled orderline price 0
Hi!
I have a product wich includes a "main product" and several "sub products". So I have added the "sub products" as bundled items to the "main prodcut" (
AddProductToBundle
). I would like to make the "sub products" price to become 0 while they are added these way. I have looked at Pipelines, Events, Calculators. But with no success. I would love some input on this.//Johannes
Hi Johannes,
I think your best bet would be to implement a custom
IOrderLineCalculator
inheriting from the defaultOrderLineCalculator
and in it, override theCalculateOrderLineUnitPrice
and if the order line belongs to a bundle, return a zero price, otherwise return the price calculated from the base implementation.Hope this helps
Matt
Hi Matt!
Thank you! I am a bit unsure on how I would return the orderline, that dosen't belong to the bundle. I got the following:
//Johannes
Almost there
Thank you so much Matt! 🥳
Hi Matt,
I have the opposite question. What if I want to keep the "main" product unit price as it is instead of sum of all sub products?
I have this, with no luck:
Thanks
Hi Paulius,
I'm happy to help but you could you please raise this as a new question of it's own rather than replying on the end of an already marked as answered question.
It just helps keeps things clear and searchable for others that have the same problem.
Many thanks
Matt
is working on a reply...