Is it possible to set a fixed UnitPrice when using CartCmd=AddMulti?
One of our solutions have a feature where the customers can copy/paste from Excel into a textarea with productId and quantity, and then we "transform" the input into a AddMulti call.
We wan't to extend on that feature so if a user has impersonation rights, they should be allowed to set the UnitPrice aswell.
We have a feature to update the UnitPrice on an orderline with the cart command UpdateOrderlines&UnitPriceOrderline, but we we're looking to add the products with the price in a single call.
We tried to just add UnitPrice in the AddMulti call, but it doesn't seem to have an effect.
We can't find anything about setting the price on the docs in the AddMulti section, but we can't see anything about the UpdateOrderlines&UnitPriceOrderline in the UpdateOrderlines section.
So we wanted to hear it if's possible, and if not then add it as a feature request:
setting UnitPrice on CartCmd=AddMulti
They cannot be combined as it is now. It would be possible though to refactor the code to something like cartcmd=command1,command2 but that is a serious change that we will not just do. And it would be rather advanced to use and understand :-).
You might be able to call CartService.UpdateOrderLines() in a notification - after Standard.Page.Loaded has fired and before the rendering takes place. I.e. using Standard.Page.PageTitle (weird, I know). Or use Standard.Page.Loaded and then add the addinsort attribute with a vlue of 10000
A regular cartcmd=addmulti will do a redirect, so you also have to combine it with a redirect=false and then in your notification subscriber do the redirect back.
That is a hack, maybe it works... And now thinking of it, cartcmd=AddMulti,UpdateOrderlines would make it all fail... so the above will probably not work.
Maybe you can chain the commands?
- The above would redirect to cartcmd=UpdateOrderlines&.... after the product has been added
- Then get back to the page you came from...?
You must be logged in to post in the forum