Page 1 of 1

Dynamically setting Product Pricing

Posted: Sun Nov 23, 2008 8:56 pm
by moopa
Hi all.

I need to dynamically allocate the price of a product when it goes into the cart based on certain custom criteria.
Logic would be something like this

if (PrintArea > A4)
{
// Add 2.00 to cost of product

}

Looking at the Class Library, Product has a CostOfGoods Property. Would this allow me to add cost for the Token.Instance only?
Could this also be used with the Variable Pricing?

Thanks in advance.

Re: Dynamically setting Product Pricing

Posted: Tue Nov 25, 2008 9:56 am
by mazhar
What about using the variable price feature.

Re: Dynamically setting Product Pricing

Posted: Tue Nov 25, 2008 2:43 pm
by moopa
Thanks for the response.
Do you have an example of how this is used?


Thanks very much.

Re: Dynamically setting Product Pricing

Posted: Wed Nov 26, 2008 4:47 am
by mazhar
You can add your custom value to the product price when creating basket item. For example in your case

Code: Select all

if (PrintArea > A4)
{
// Add 2.00 to cost of product
basketItem.Price += 2;
}
Check the BuyProductDialog.ascx.cs file. Check for the code that is used to support the variable pricing feature. You will need a very similar code for your solution.

Re: Dynamically setting Product Pricing

Posted: Thu Nov 27, 2008 11:07 am
by moopa
Thanks Mazhar, i will be sure to check this out tomorrow.

Best Regards,

Dave

Re: Dynamically setting Product Pricing

Posted: Mon Dec 01, 2008 11:16 am
by kastnerd
see the last post on this topic
viewtopic.php?f=42&t=7936