Dynamically setting Product Pricing

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
moopa
Lieutenant (LT)
Lieutenant (LT)
Posts: 59
Joined: Tue May 13, 2008 10:11 am

Dynamically setting Product Pricing

Post by moopa » Sun Nov 23, 2008 8:56 pm

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Dynamically setting Product Pricing

Post by mazhar » Tue Nov 25, 2008 9:56 am

What about using the variable price feature.

User avatar
moopa
Lieutenant (LT)
Lieutenant (LT)
Posts: 59
Joined: Tue May 13, 2008 10:11 am

Re: Dynamically setting Product Pricing

Post by moopa » Tue Nov 25, 2008 2:43 pm

Thanks for the response.
Do you have an example of how this is used?


Thanks very much.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Dynamically setting Product Pricing

Post by mazhar » Wed Nov 26, 2008 4:47 am

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.

User avatar
moopa
Lieutenant (LT)
Lieutenant (LT)
Posts: 59
Joined: Tue May 13, 2008 10:11 am

Re: Dynamically setting Product Pricing

Post by moopa » Thu Nov 27, 2008 11:07 am

Thanks Mazhar, i will be sure to check this out tomorrow.

Best Regards,

Dave

kastnerd
Commodore (COMO)
Commodore (COMO)
Posts: 474
Joined: Wed Oct 22, 2008 9:17 am

Re: Dynamically setting Product Pricing

Post by kastnerd » Mon Dec 01, 2008 11:16 am

see the last post on this topic
viewtopic.php?f=42&t=7936

Post Reply