Hey Guys,
I've started working on a price provider / orderline extender which must be able to change the price on a given product in my cart.
To give an example of it's usage we might have one product named Carpet (PROD1),
The user must be able to enter a diminsion (width and length), based on that i calculate a price for the Carpet which could be 20.000,00 kr. the users adds it to his basket and 20.000,00 kr is shown in the basket
Now the user selects the same Carpet (PROD1) and enters another dimension, now the price is 21.000,00 kr.
So i need to be able to have the same product than once in my basket, with different prices.
PROD1 Carpet 20.000,00 kr 100cm x 100cm
PROD1 Carpet 21.000,00 kr 200cm x 200cm
Is it possible?
I tried this:
public class SampleOrderLineTemplateExtender : Dynamicweb.eCommerce.Orders.OrderLineTemplateExtender {
public override void ExtendTemplate(Dynamicweb.Templatev2.Template Template, Dynamicweb.eCommerce.Frontend.TemplateExtenderRenderingState RenderingState) {
// Her manipulere vi vores Orderline data inden Dynamic spytter dem ud
if (RenderingState == Dynamicweb.eCommerce.Frontend.TemplateExtenderRenderingState.Before) {
OrderLine.Price.Multiply( 0 );
IPriceInfo Et = Dynamicweb.eCommerce.Prices.Price.GetDoublePriceInfo( 1, Order.Currency );
OrderLine.Price.Add( Et );
OrderLine.Price.Multiply( 120.00 );
}
}
}
But my price isn't changed on my page.