Kit Pricing fix for now

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Kit Pricing fix for now

Post by heinscott » Thu Jun 05, 2008 9:45 am

Hello... I thought I would post this here, in case it is helpful for anyone...
I was having a problem with kit pricing not showing on the Category grid pages. Now, I know this isn't the best option for a permenant fix, and it does not take into account options (only kit pricing), but, it fixed my problem. So...
In the ProductPrice.acsx.cs file, find the line:

Price.Text = pcalc.Price.ToString("ulc");

Replace with:

if (pcalc.Price == 0)
{
LSDecimal lowestKitPrice = 999999;
KitComponentCollection kcc = KitComponentDataSource.LoadForProduct(_Product.ProductId);
foreach (KitComponent kc in kcc)
{
KitProductCollection kpc = KitProductDataSource.LoadForKitComponent(kc.KitComponentId);
foreach (KitProduct kp in kpc)
{
if ((kp.Quantity * kp.Price) < lowestKitPrice)
{
lowestKitPrice = kp.Quantity * kp.Price;
}
}
}
Price.Text = lowestKitPrice.ToString("ulc");
}
else
{
Price.Text = pcalc.Price.ToString("ulc");
}

So, this change will fix the error. I would suggest, however, making copies and making the changes to those, of course.
Hope this is helpful.

Scott

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: Kit Pricing fix for now

Post by compunerdy » Thu Jun 05, 2008 10:48 am

I tried this on a kit that has hidden items and it didn't work.

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Kit Pricing fix for now

Post by heinscott » Thu Jun 05, 2008 1:07 pm

Sorry Tim... I only use kits for creating Case quantities of different sizes. Works fine for me, but, I don't have any kit items that are not displayed. I'm using the AC object and collection classes here, so, I'm not sure how they handle the hidden stuff. Wish I could be more helpful...

Scott

Post Reply