ootb, Able lists choices as a run-on sentence. I've got products with up to 10 choices.
ootb: large, blue, button-down, long, etc....
I need - Choice Name: Choice made (like a bullet list):
Size: large
Color: blue
Collar style: button-down
Sleeve type: long
In the cart, on the checkout, emails, etc. Has anyone done this? I'd like to pass any help you can offer on to my developer to ease the workload.
Thanks.
Need 'bullet list' of: Choice name: choice made
Re: Need 'bullet list' of: Choice name: choice made
I found the run-on sentence very annoying also.
Here is how I fixed the Basket
In /conlib/utility/BasketItemDetail.ascx.cs in the Page_Prender:
Change
to
GetVariantList Function:
Here is how I fixed the Basket
In /conlib/utility/BasketItemDetail.ascx.cs in the Page_Prender:
Change
Code: Select all
productName += string.Format(" ({0})", _BasketItem.ProductVariant.VariantName);
Code: Select all
prodOptions += GetVariantList(_BasketItem.OptionList);
Code: Select all
private string GetVariantList(string OptionListIn)
{
string RetVal = "";
string[] SingleOpt = OptionListIn.Split(',');
for (int LpCnt = 0; LpCnt <= SingleOpt.GetUpperBound(0); LpCnt++)
{
if (SingleOpt[LpCnt] != "0")
{
if (RetVal != "")
RetVal += "<br />";
OptionChoice CurOptCh = OptionChoiceDataSource.Load(Convert.ToInt32(SingleOpt[LpCnt]));
Option CurrOpt = OptionDataSource.Load(CurOptCh.OptionId);
string OptionName = CurrOpt.Name;
//Strip unnecessary text from the Option Name (as necessary)
OptionName = OptionName.Replace("Select ", "");
OptionName = OptionName.Replace("Add a ", "");
RetVal += OptionName + ": " + CurOptCh.Name;
}
}
return RetVal;
}
Re: Need 'bullet list' of: Choice name: choice made
Thanks, I'll pass it on.
Re: Need 'bullet list' of: Choice name: choice made
Thanks for the great start, dbreyley.
I had to add a couple things so I figured I'd post them here as well in case other people were looking for a fix like this.
For the GetVariantList function in BasketItemDetail.ascx.cs, I changed this line:
to this:
In BasketItemDetail.ascx.cs, right after this line:
I added this line:
I also needed to add the output for the prodOptions. To do this I changed this block of code:
to this:
I believe those were the only changes I made. Thanks again!
I had to add a couple things so I figured I'd post them here as well in case other people were looking for a fix like this.
For the GetVariantList function in BasketItemDetail.ascx.cs, I changed this line:
Code: Select all
string RetVal = "";
Code: Select all
string RetVal = "<br />";
Code: Select all
string productName = product.Name;
Code: Select all
string prodOptions = "";
Code: Select all
if (this.LinkProducts)
{
//OUTPUT NAME AS LINK
string url = UrlGenerator.GetBrowseUrl(product.ProductId, CatalogNodeType.Product, product.Name);
string link = string.Format("<a href=\"{0}\">{1}</a>", Page.ResolveUrl(url), productName);
phProductName.Controls.Add(new LiteralControl(link));
}
else
{
//OUTPUT NAME
phProductName.Controls.Add(new LiteralControl(productName));
}
Code: Select all
if (this.LinkProducts)
{
//OUTPUT NAME AS LINK
string url = UrlGenerator.GetBrowseUrl(product.ProductId, CatalogNodeType.Product, product.Name);
string link = string.Format("<a href=\"{0}\">{1}</a>", Page.ResolveUrl(url), productName);
phProductName.Controls.Add(new LiteralControl(link));
phProductName.Controls.Add(new LiteralControl(prodOptions));
}
else
{
//OUTPUT NAME
phProductName.Controls.Add(new LiteralControl(productName));
phProductName.Controls.Add(new LiteralControl(prodOptions));
}