How to remove price from product category page in nopcommerce 4.3

2 months 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.
2 months ago
Did you restart the application or webserver after making changes ?
2 months 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.
2 months 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.
2 months ago
Upload the file and restart the server still not working....
2 months ago
When viewing the page in your browser, press Control-F5
2 months ago
Done even run at private windows also still not working