Add a custom pipeline task to add a fee based on the discounted total
Hi
I've got a custom OrderCalculation pipeline task which is add on a 'processing fee' which is based on the total order amount.
This works well until I am using discounts, in which case the Calculation object does not have the discounts in it.
I would like to be able to calculate a processing fee based on the discounted total.
I believe this is because of where the task is in the pipeline, it is currently configured as shown:
Which task should I insert my custom task after so that I can access the discounts in the Calculation object?
I tried a few, but either seem to get into an infinite loop, or dependency injection errors at start up if I don't use the right pipeline/task combination. I am clutching at straws!
For example, I tried this one which just seemed to get me in an infinite loop.
Add a custom pipeline task to add a fee based on the discounted total
Hi I've got a custom OrderCalculation pipeline task which is add on a 'processing fee' which is based on the total order amount. This works well until I am using discounts, in which case the Calculation object does not have the discounts in it.
I would like to be able to calculate a processing fee based on the discounted total.
I believe this is because of where the task is in the pipeline, it is currently configured as shown:
Which task should I insert my custom task after so that I can access the discounts in the Calculation object? I tried a few, but either seem to get into an infinite loop, or dependency injection errors at start up if I don't use the right pipeline/task combination. I am clutching at straws!
For example, I tried this one which just seemed to get me in an infinite loop.
I am using vendr 2.4.1 and umbrcao 9 (soon to upgrade) Thanks
Sue
How exactly are you adding the "fee"? As a price adjustment? If not, this is generally how I would suggest you apply fees. Take a look at https://vendr.net/docs/core/3.0.0/key-concepts/price-amount-adjustments/
Price adjustments should get calculated in the right place so I don't think you would hit this problem.
I'm adding it as an order line, which I change the amount of in the pipeline task, so feels like a price adjustment would be better.
Thanks, I'll try this.
is working on a reply...