Display Variant Price in Options Drowdown

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
gdelorey@mitcs.com
Commander (CMDR)
Commander (CMDR)
Posts: 129
Joined: Thu Oct 19, 2006 5:33 pm

Display Variant Price in Options Drowdown

Post by gdelorey@mitcs.com » Tue Sep 15, 2009 9:10 am

Hi -

Currently when a user drops down the variant list on individual product pages they have to click on a variant to have the price updated at the top of the product area. Is there a way to display the price next to the variants?

Example:

Option 1 ($14.99)
Option 2 ($16.99)
Option 3 ($17.99)

Thanks!

:Greg

gdelorey@mitcs.com
Commander (CMDR)
Commander (CMDR)
Posts: 129
Joined: Thu Oct 19, 2006 5:33 pm

Re: Display Variant Price in Options Drowdown

Post by gdelorey@mitcs.com » Mon Sep 21, 2009 9:59 am

Follow-up: I've been trying to get this figured out without any luck. If anyone has ideas, they'd be greatly appreciated!

Thanks,

: Greg

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Display Variant Price in Options Drowdown

Post by jmestep » Mon Sep 21, 2009 10:54 am

This is old code andmaybe incomplete, but in the ProductHelper.cs, you can use
foreach (OptionChoice optionOption in availableOptions)
{
aspOptions.Items.Add(new ListItem(optionOption.Name + " + " + optionOption.PriceModifier.ToString("ulc"), optionOption.OptionChoiceId.ToString()));
}

You would need to tweak it if you aren't using price modifier or if some of your modifiers are negative dollar amounts.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

gdelorey@mitcs.com
Commander (CMDR)
Commander (CMDR)
Posts: 129
Joined: Thu Oct 19, 2006 5:33 pm

Re: Display Variant Price in Options Drowdown

Post by gdelorey@mitcs.com » Mon Sep 21, 2009 10:56 am

Hi Judy -

Thanks for your assistance! I'll give this a shot and post back my results.

: Greg


User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Display Variant Price in Options Drowdown

Post by jmestep » Thu Sep 24, 2009 5:59 am

Duh, I don't remember my own posts! :)
I'm glad Mr. Encyclopedia, Mazhar is back!
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

gdelorey@mitcs.com
Commander (CMDR)
Commander (CMDR)
Posts: 129
Joined: Thu Oct 19, 2006 5:33 pm

Re: Display Variant Price in Options Drowdown

Post by gdelorey@mitcs.com » Wed Oct 07, 2009 10:22 am

So I got the product variants to display their modifier price, then took it one step further to get them to display the actual variant price (modifier + product base price). My code looked like this:

Code: Select all

foreach (OptionChoice optionOption in availableOptions)
                    {
                        aspOptions.Items.Add(new ListItem(optionOption.Name + " - " + (product.Price + optionOption.PriceModifier).ToString("ulc"), optionOption.OptionChoiceId.ToString()));
                    }
This worked great, until I added the product to the cart. I get a ConLib error that states:

[[ConLib:Basket]] d:\projects\OlivePit\www\ConLib\Utility\BasketItemDetail.ascx.cs(170): error CS1501: No overload for method 'GetAssets' takes '5' arguments

I would love to get this working, but I'm a bit stuck at this point. Anyone have ideas on how to get around this issue?

Thanks!

Post Reply