Show Option Price in Option Dropdown

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
jbburgos
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Sun Mar 16, 2008 10:53 am

Show Option Price in Option Dropdown

Post by jbburgos » Sun May 25, 2008 3:38 pm

Hello All,

I am trying to show the added option price for each option in the option dropdown box, for example:

Product 1

Option 1 (this is the base price so I don't want anything to show up next to it)
Option 2 +30 (this option adds $30 to the base price so I want it to show up next to the option)
Option 3 +50
etc.

I am using variants and the only way I can do the above right now is to include the dollar value in each option name, for example:

When I create the options above I would name them:

Option 1
Option 2 +30
Option 3 +50
etc.

This poses a problem in the future, when those prices change I have to manually change the option names, which also deletes all of the variants. This would be a HUGE waste of time, the whole point of having a database driven cart is so you don't have to do all of the manual work needed for a non database driven cart. If anyone has any idea on how to do the above please let me know :D

I searched through the forums and couldn't find anything related to the above problem.

Thanks!

Justin

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

Re: Show Option Price in Option Dropdown

Post by compunerdy » Sun May 25, 2008 5:48 pm

Use kits instead.

User avatar
m_plugables
Commander (CMDR)
Commander (CMDR)
Posts: 149
Joined: Tue Mar 11, 2008 12:44 am
Contact:

Re: Show Option Price in Option Dropdown

Post by m_plugables » Tue May 27, 2008 12:05 pm

Check the App_Code/ProductHelper.cs file's BuildProductOptions method. It may help you.
Image
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com

jbburgos
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Sun Mar 16, 2008 10:53 am

Re: Show Option Price in Option Dropdown

Post by jbburgos » Sat May 31, 2008 6:45 pm

Thanks for the help, I found this in the file you suggested:

// CREATE A DROPDOWN FOR THE OPTIONS
DropDownList aspOptions = new DropDownList();
RequiredFieldValidator aspOptionsValidator = new RequiredFieldValidator();
aspOptions.ID = "option" + i;
if (autoPostBack) aspOptions.AutoPostBack = true;
else


It looks like I can put a price variable inside the "option" for example:

x = option price

aspOptions.ID = "option +x" + i;

Does this look right? Does anyone know what the option price variable is?

Thanks for all your help

User avatar
m_plugables
Commander (CMDR)
Commander (CMDR)
Posts: 149
Joined: Tue Mar 11, 2008 12:44 am
Contact:

Re: Show Option Price in Option Dropdown

Post by m_plugables » Mon Jun 02, 2008 7:12 am

I think you need to modify the following code in the Method

Code: Select all

foreach (OptionChoice optionOption in availableOptions)
                    {
                        aspOptions.Items.Add(new ListItem(optionOption.Name, optionOption.OptionChoiceId.ToString()));
                    }
The changes you require may be some thing like the code below

Code: Select all

foreach (OptionChoice optionOption in availableOptions)
                    {
                        aspOptions.Items.Add(new ListItem(optionOption.Name+" - "+optionOption.PriceModifier.ToString("ulc"), optionOption.OptionChoiceId.ToString()));
                    }
Image
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com

Post Reply