Nazim71177

Hi,

For the selected item, the user will enter the quantity in order to add to the cart.

Instead of the list price, i will calculate the best price logic to determine the unit price from the price book.

After i pick the best price, then i need to update the price for the selected item instead of the line item listprice.

I tried the PlacedPrice & LineItemDiscountAmount property in the lineitem class to place the best price value, so that the

basket pipeline will calculate the subtotal and total based on the new price. But inspite of my efforts to update the best price,

the basket pipeline takes the default listprice and calculates the subtotal and total for the line item.

Let me know how to handle this situation. Is there any property to override the listprice for the line item or should i go with the discount pattern.

- Nazim



Re: Commerce Server 2007 Need Help on Updating ListPrice

Max Akbar

You need to create your own pipeline componet (SetCustomPricing) and put your logic there and then place it after the product pipeline components.

-Max





Re: Commerce Server 2007 Need Help on Updating ListPrice

Nazim71177

hi Max,

Can you help me on how do i create the pipeline for this purpose. Also, i want to access the current user Profile object within the pipeline component. Is it possible

Nazim





Re: Commerce Server 2007 Need Help on Updating ListPrice

Max Akbar

Hi Nazim,

I am sorry as much as I would like to help and I can't spend too much time but I will answer your questions. Start with my blog on how to create a pipeline component and along the way if you run into issues I will do what I can.

Good luck,
-Max





Re: Commerce Server 2007 Need Help on Updating ListPrice

Nazim71177

Thanks Max. I will start exploring on it with your articles.

- Nazim





Re: Commerce Server 2007 Need Help on Updating ListPrice

Max Akbar

Well as luck would have it, I have customer that is asking for the same thing so I did a bit research and here is what I came up with.

You need to extend the LineItems object to have a property called PriceOverride or something else. Next you need to create a pipeline component that iterates through all line items and checks to see if PriceOverride is greater than zero then sets the cy_placed_price.

Just make sur that you place your pipeline component after the Product Info stage.

Good luck,
-Max





Re: Commerce Server 2007 Need Help on Updating ListPrice

Bald Programmer

Max,

Correct me if I'm wrong, but if they were to add a "PriceOverride" property, wouldn't they need to add a new custom pipeline component in the Product Info stage that would make sure PriceOverride has the "latest" price (similar to the List Price check)

-Bald Programmer





Re: Commerce Server 2007 Need Help on Updating ListPrice

Max Akbar

Max Akbar wrote:


Next you need to create a pipeline component that iterates through all line items and checks to see if PriceOverride is greater than zero then sets the cy_placed_price.



Yes, I did mention this in my post , and you want to have this right after the Prod Info stage.

-Max





Re: Commerce Server 2007 Need Help on Updating ListPrice

Bald Programmer

I'm not talking about updating the actual price, but rather another component to validate the value of the PriceOverride. The custom component you are talking about is to assign PriceOverride (if > 0) to PlacePrice, but what about checking to make sure PriceOverride is "up to date" (similar to the ListPrice check).

For example, let's say you have a product with a listprice of $100 and a price override of $50. Some time later, the $100 becomes $80 and the price override becomes $40, without the additional component, they will pay $50 (priceoverride) instead of the new $40.

So you'd need two custom pipeline components, correct One to verify the priceoverride, and another to set the PlacedPrice. I'm probably missing the boat, but that's what I assumed.

-Bald Programmer




Re: Commerce Server 2007 Need Help on Updating ListPrice

Max Akbar

Having one or more component really depends on your requirements and preference. I would have one component that checks the price and overrides. Of course I would have two business rules outside of the component so it could be used outside of the pipeline or when the next version of the product does not support pipelines. One would check the price validity and the other override.

So, yes you are correct and thanks for pointing that out.

-Max





Re: Commerce Server 2007 Need Help on Updating ListPrice

Bald Programmer

Max,

How would you store the business rules outside of the pipelines

As for the next version of Commerce Server, do you think they'll go towards .NET's Workflow components instead of pipelines That seems exciting Smile!

-Bald Programmer







Re: Commerce Server 2007 Need Help on Updating ListPrice

Max Akbar

You would create a new project and store all of your buisness logic there so if anything changes you have little work to integrate to a new service.

I am not exactly sure what will happen in the next version but there were some talks about making it an eventing model. There were many reason why the pipelines remained COM but one reason for sure was that the Workflow stuff was a huge dependacny and we wanted to release the product .

-Max