Default selection in the product options
- Willisski
- Lieutenant Commander (LCDR)
- Posts: 82
- Joined: Thu Oct 27, 2005 1:46 am
- Location: http://www.Thejibshop.com
- Contact:
Default selection in the product options
We need default selection in the product options (Color,Size,etc...) Right now the customer has to click on a blank field. it would be great if there was a default for those selections.
Re: Default selection in the product options
I can't believe there aren't a million other people thinking this is necessary too! I agree 100% this needs to be implemented in the next release.
Re: Default selection in the product options
Please have a look at this solution for setting the default product option:
http://8bitbyte.com/programming-help/20 ... ct-option/
http://8bitbyte.com/programming-help/20 ... ct-option/
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Default selection in the product options
You don't really need javascript to do it. In the App_Code/ProductHelper.cs, you can remove this line:
aspOptions.Items.Add(option.HeaderText);
or this line
aspOptions.Items.Add(String.Empty);
depending on what build of Able you are using. Able had said in the past that it might cause a problem if you are using inventory on the variants, but I don't know if that even applies now, it was so long ago.
aspOptions.Items.Add(option.HeaderText);
or this line
aspOptions.Items.Add(String.Empty);
depending on what build of Able you are using. Able had said in the past that it might cause a problem if you are using inventory on the variants, but I don't know if that even applies now, it was so long ago.
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
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
Re: Default selection in the product options
Curious if anyone has tested in this GOLD yet....
I'm trying to enforce the first option to be the 'default' choice....
I'm trying to enforce the first option to be the 'default' choice....
Re: Default selection in the product options
In GOLD there is a function in the BuyProductDialog.ascx.cs that builds the options choice - GetOptionChoices. By default this function adds the option header text as the first item. We commented out that code to always default to the first option.
Code: Select all
protected List<OptionChoiceItem> GetOptionChoices(Object objOption, int index)
{
ProductOption productOption = objOption as ProductOption;
if (productOption == null)
return GetOptionChoiceValues(new List<OptionChoice>());
IList<OptionChoice> availableChoices;
if (!ShowAllOptions && index < ProductVariant.MAXIMUM_ATTRIBUTES)
{
availableChoices = OptionChoiceDataSource.GetAvailableChoices(_Product.Id, productOption.OptionId, _SelectedOptionChoices);
}
else
{
availableChoices = productOption.Option.Choices;
}
//OptionChoice optionChoice = new OptionChoice();
//optionChoice.Name = productOption.Option.HeaderText;
//optionChoice.OptionId = productOption.OptionId;
//availableChoices.Insert(0, optionChoice);
return GetOptionChoiceValues(availableChoices);
}
Re: Default selection in the product options
Yes, David......
I found that same code and updated just a few days ago...
Thanks for the response, though!
I found that same code and updated just a few days ago...
Thanks for the response, though!
Re: Default selection in the product options
In R9, I just commented out the following line on the BuyProductDialog:
Has anyone done this to where it adds the header text if entered within a products options, or defaults to the first option if there is no header text for that product option?
Code: Select all
//ddl.Items.Add(new ListItem(opt.HeaderText, string.Empty));
Re: Default selection in the product options
If you are using Gold R9, then you can either use the Header text or you can select a default option. From the Manage Option Choices page, there is a column where you can check a box for "Selected". This will be the default option choice, if you want to use the feature, or it will just default to the header text. No customization necessary!
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support