Change Manufactures name in multi store.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Can anyone tell me how to create a condition to change the Manufactures name by assigning different names depending on the loaded store. Nop4.2 multistore activated.

Example:

    @if (storeID = 1)
    {
        <div class="title">
            <strong>@T("Manufacturers")</strong>
        </div>
    }

    else

    {
        <div class="title">
            <strong>@T("Manufacturers2")</strong>
        </div>
    }
4 years ago
So you are editing src\Presentation\Nop.Web\Views\Shared\Components\ManufacturerNavigation\Default.schtml
The data for the page is stored in ManufacturerNavigationModel
a property of which is ManufacturerBriefInfoModel which is populated in
protected virtual IList<ManufacturerBriefInfoModel> PrepareProductManufacturerModels(Product product) in
src\Presentation\Nop.Web\Factories\ProductModelFactory.cs

I am assuming you want to separate the the Manufactures into 2 lists but at the moment there is no access to the StoreId for each Manufacturer in the above models.

One way would be to add a new property StoreId in the ManufacturerBriefInfoModel then populate the new field when preparing the model then you would have access to it when you modify and build upon the existing functionality in the above page. Another way might be to pass in the StoreId into the control itself.

Without actually thinking about in more depth and coding it myself I cant be of more help, feel free to have a play, explore and understand the problem to build a solution:)
4 years ago
Thanks for the tips. I needed to have in the 2 sites manufacturers> authors and manufactures> publishers.
For now I have found a simpler solution by duplicating the language and associating it to the reference site each with its translation. Thank you
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.