Hide product option category name

Artemy Sokolov asked on April 8, 2014 02:49

Hello!

I need show optioncatergory name only when im using dropdownlist, else hide

not sure, but i think it should look like this

if ( *here is something about dropdownlist using) { lblCategName.Text = HTMLHelper.HTMLEncode(ResHelper.LocalizeString(OptionCategory.CategoryDisplayName)); } else { lblCategName.Visible = false; }

How correctly should look this code?

Best regards.

Recent Answers


Michal Kadák answered on April 16, 2014 05:19

Hello Artemy,

I suppose that your goal is to hide category name on product detail page. To achieve that you can insert this code: selector.ShowOptionCategoryName = selector.OptionCategory.CategorySelectionType == OptionCategorySelectionTypeEnum.Dropdownlist;

into the LoadProductOptions method in ShoppingCartItemSelector.ascx.cs, somewhere below: ProductOptionSelector selector = (ProductOptionSelector)LoadUserControl("~/CMSModules/Ecommerce/Controls/ProductOptions/ProductOptionSelector.ascx");

Let me know if I can help you any further.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.