Close

How to change Full Description tab to Short Description?

arelydistillery
6 years ago
#13383 Quote
Avatar
  • 3
Hello,

Currently the plugin let's me enable the product Full Description to show as a tab. Is there a way to not make it the Full Description and switch it to the Short Description of the product?

Any help is appreciated.

Thanks!
anton_ivanov
6 years ago
#13386 Quote
Avatar
  • Moderator
  • 277
Hello,

Unfortunately, at the moment you cannot show the short description of the product in a tab.

You can suggest your idea over at our UserVoice, however. We implement the best and most voted ideas, so our users can have the functionalities they want from our products.

You can achieve this functionality by doing some code modification. Edit the ~/Plugins/SevenSpikes.Nop.Plugins.NopQuickTabs/Views/ProductTab/_ProductTabsWithoutAjax.cshtml file and on line 20 you should find the following code:

    @foreach (var tabInfo in Model.Tabs)
    {
        <div id="[email protected]">
            @Html.Raw(tabInfo.Content)
        </div>
    }

replace it with this:

    @foreach (var tabInfo in Model.Tabs)
    {
        <div id="[email protected]">

            @if (tabInfo.Title.Equals("Overview"))
            {
                @Model.ProductModel.ShortDescription
            }
            else
            {
                @Html.Raw(tabInfo.Content)
            }

        </div>
    }

Note: Change "Overview" with whatever your description tab title is called if for some reason it is different (e.g. different language).
Note: You will have to uncheck the Enable Ajax setting in the Nop Quick Tabs settings in order for this to work.

Hope that helps!
Regards,
Anton Ivanov
Nop-Templates.com
arelydistillery
6 years ago
#13389 Quote
Avatar
  • 3
This worked perfectly! Could you also help me how to display it in HTML raw?

I tried using:
@Html.Raw(Model.ProductModel.ShortDescription)


But that didn't work.

Thank you for your help!
arelydistillery
6 years ago
#13390 Quote
Avatar
  • 3
arelydistillery wrote:
This worked perfectly! Could you also help me how to display it in HTML raw?

I tried using:
@Html.Raw(Model.ProductModel.ShortDescription)


But that didn't work.

Thank you for your help!


Never mind, that did work! I just forgot to enable the Full Description :)

Thanks!