Product option choice default selection

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
corgalore
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Thu Nov 08, 2012 2:57 pm

Product option choice default selection

Post by corgalore » Fri Aug 23, 2013 9:41 am

In Gold R5, if I create product options and set one of the choices as 'selected', the choice is not selected on the public product page. I had to add this work-around in order to get it working:

Around Line 799, BuyProductDialog.asxc.cs

Code: Select all

foreach (OptionChoice choice in opt.Choices)
 {

  //Fix:Select default choice
  if (!IsPostBack && _SelectedOptionChoices.Count == 0)
  {
   if (choice.Selected)
    ddl.SelectedValue = choice.Id.ToString();
  }
  //End Fix

  if (!string.IsNullOrEmpty(choice.ImageUrl))
  {
   imageScript.Append("    " + ddl.ClientID + "_Images[" + choice.Id.ToString() + "] = '" + this.Page.ResolveUrl(choice.ImageUrl) + "';\n");
  }
}

Post Reply