How to remove price from product category page in nopcommerce 4.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
I want to remove the product price from category page.

Now, surprised topic is that from my code in local server working well while I published that code in live server it is not working.

Here is my code,

@if(Model.ProductPrice.Price.Remove(0, 1) != "0.00")
{
    <div class="prices">
        @if (!string.IsNullOrEmpty(Model.ProductPrice.OldPrice))
        {
            <span class="price old-price">@Model.ProductPrice.OldPrice</span>
        }
        <span class="price actual-price">@Model.ProductPrice.Price</span>
        @if (Model.ProductPrice.DisplayTaxShippingInfo)
        {
            var inclTax = workContext.TaxDisplayType == TaxDisplayType.IncludingTax;
            //tax info is already included in the price (incl/excl tax). that's why we display only shipping info here
            //of course, you can modify appropriate locales to include VAT info there
            <span class="tax-shipping-info">
                @T(inclTax ? "Products.Price.TaxShipping.InclTax" : "Products.Price.TaxShipping.ExclTax", Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("shippinginfo") }))
            </span>
        }
        @if (!string.IsNullOrEmpty(Model.ProductPrice.BasePricePAngV))
        {
            <div class="base-price-pangv">
                @Model.ProductPrice.BasePricePAngV
            </div>
        }
    </div>
}
I given the condition in Nop.Web => Themes => Emporium => Views => Shared => _ProductBox.html

Condition shows that if price is greater than zero then it show else don't show.

This code perfectly working in local while the same thing is not working in live server.

Note: I run the live site in crome private window also but still didn't work.
3 years ago
Did you restart the application or webserver after making changes ?
3 years ago
Yup. I restart the server, do clear cache too but when I can't restart the website by admin panel. Because when I restart the website by admin panel its shows message i.e. connection timed out.
3 years ago
sksoni wrote:
I want to remove the product price from category page.

Now, surprised topic is that from my code in local server working well while I published that code in live server it is not working.

Here is my code,

@if(Model.ProductPrice.Price.Remove(0, 1) != "0.00")
{
    <div class="prices">
        @if (!string.IsNullOrEmpty(Model.ProductPrice.OldPrice))
        {
            <span class="price old-price">@Model.ProductPrice.OldPrice</span>
        }
        <span class="price actual-price">@Model.ProductPrice.Price</span>
        @if (Model.ProductPrice.DisplayTaxShippingInfo)
        {
            var inclTax = workContext.TaxDisplayType == TaxDisplayType.IncludingTax;
            //tax info is already included in the price (incl/excl tax). that's why we display only shipping info here
            //of course, you can modify appropriate locales to include VAT info there
            <span class="tax-shipping-info">
                @T(inclTax ? "Products.Price.TaxShipping.InclTax" : "Products.Price.TaxShipping.ExclTax", Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("shippinginfo") }))
            </span>
        }
        @if (!string.IsNullOrEmpty(Model.ProductPrice.BasePricePAngV))
        {
            <div class="base-price-pangv">
                @Model.ProductPrice.BasePricePAngV
            </div>
        }
    </div>
}
I given the condition in Nop.Web => Themes => Emporium => Views => Shared => _ProductBox.html

Condition shows that if price is greater than zero then it show else don't show.

This code perfectly working in local while the same thing is not working in live server.

Note: I run the live site in crome private window also but still didn't work.


Make sure that you upload the Nop.Web.Views.dll and restart the server.
3 years ago
Upload the file and restart the server still not working....
3 years ago
When viewing the page in your browser, press Control-F5
3 years ago
Done even run at private windows also still not working
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.