Add Contact Number in Header

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
How can i add contact number in header from admin panel and it has to change when ever i update the contact number
7 years ago
Hi,

The most basic way: add to your view cshtml file new resource string, and add translation to your language. Each time you will update phone, it is just modification at the translation.

Regards,
Tomasz
7 years ago
Any Example ... I am new to NopCommerce
7 years ago
raghu11021993 wrote:
Any Example ... I am new to NopCommerce


Go to Nop.Web==>Views==>Shared==>Header.cshtml.If you use theme then go to Nop.Web==>Themes==>Views==>Shared==>Header.cshtml and place @T("phonenumber"). Then go to Admin==>Configuration==>Language==>Edit==>Resource String==>Add new record==>Name: phonenumber and value:111111
7 years ago
Very basic tutorial.
I want to place phone number between logo and search at the top of the store.

So I go to Views/Shared/Header.cshtml and place between
 <div class="header-lower">
        <div class="header-logo">
            @Html.Action("Logo", "Common")
        </div>
        <div class="search-box store-search-box">
            @Html.Action("SearchBox", "Catalog")
        </div>
    </div>

New div with resource string. So it would be look like below:
<div class="header-lower">
        <div class="header-logo">
            @Html.Action("Logo", "Common")
        </div>
        <div>@T("myspecialphonenumber")</div>
        <div class="search-box store-search-box">
            @Html.Action("SearchBox", "Catalog")
        </div>
    </div>

All to do now, is to add new resource string with appropriate value.
So go to Admin panel -> settings -> language, choose your language and in second tab ("String resources") add new record. On resource name should be myspecialphonenumber.

Please note, it is good practice, to made modification only at the Themes view folder, not main. So if you have only Default clean theme, you would need to copy file  Header.cshtml from main View folder to /Themes/DefaultClean/Views/Sheared


Hope it would help with first steps :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.