Product Title Issue?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 9 años
Hello,

In my product box I have this code:


  <div class="product-title">
        @{
            ProductUtils pu1 = new ProductUtils();
            var prodname = pu1.GetProductNameFromUrl(Url.RouteUrl("Product", new { SeName = Model.SeName }));
            var lowerName = @prodname.ToLower();
        }
            <a href="@Url.RouteUrl("Product", new { SeName = Model.SeName })">@lowerName</a>
     </div>


But for some strange reason it works for all my products but the very first product on the page.

So all titles are now lower case but the first product on the page!

Any idea what could be going wrong?

Thanks
Hace 9 años
Hi,

I think you can use an easy way to resolve this. It is stylesheet.
Add following styles at the bottom of "Themes/DefaultClean/Content/styles.css" file:

.product-title a { text-transform: lowercase; }

Keep the original code in the "_ProductBox.cshtml" file:

<h2 class="product-title">
            <a href="@Url.RouteUrl("Product", new { SeName = Model.SeName })">@Model.Name</a>
        </h2>

Of course, remove following code:

@{
            ProductUtils pu1 = new ProductUtils();
            var prodname = pu1.GetProductNameFromUrl(Url.RouteUrl("Product", new { SeName = Model.SeName }));
            var lowerName = @prodname.ToLower();
        }

Hope this help :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.