logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Thursday, September 1, 2022 9:45:03 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
@if (ShowManufacturer && Model.Manufacturer != null)
{
<div class="branding">
<a href="@Url.Content("~/Search" + new { m = Model.Manufacturer.Id.ToString() }.ToQueryString())">
@Model.Manufacturer.Name
</a>
</div>
}

There needs to be a ? after ~/Search like ~/Search?

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

judy at Web2Market  
#2 Posted : Thursday, September 1, 2022 10:23:37 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Also, I couldn't get the manufacturer to show until I populated it in the productsModel on the CategoryGridPage in the controller.
Maybe I'm doing something wrong?
When I stepped through the view, I got a value for the @Model.Manufacturer.Name
@if (ShowManufacturer && Model.Manufacturer != null)
{
<div class="branding">
<a href="@Url.Content("~/Search?" + new { m = Model.Manufacturer.Id.ToString() }.ToQueryString())">
@Model.Manufacturer.Name
</a>
</div>
}

I didn't understand what was going on, so I just took the path of least resistance and populated the manufacturer in the productsModel
shaharyar  
#3 Posted : Thursday, September 1, 2022 11:16:49 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
The code changes you did for populating Manufacturer Name are correct.
It was not displayed in the view because ShowManufacturer will always be false.

The display was initially handled from widget settings but we hide the option as the discussion was going on about the display position.

Along with the changes in the controller, to fix the display issue you can enable to widget setting and then hide/show from the retail widget setting pop-up.

1. Open file E:\Workspace\AbleCommerce9\trunk\Website\Models\ProductModels.cs
2. Search for

Code:
[Browsable(false)]
[DisplayName("Show Product Manufacturer")]
[DefaultValue(false)]
[Description("If true manufacturer is displayed")]


3. Replace with

Code:
[Browsable(true)]
[DisplayName("Show Product Manufacturer")]
[DefaultValue(false)]
[Description("If true manufacturer is displayed")]


4. Compile the project
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.