Remove 00.00 and replace with "Price From £xx.xx"

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I am using the 3.9 version of nopcommerce and my products use Product Attributes. I would like to change the price $0.00 to Prices From at $xx.xx.  This product price (00.00) is displayed on home page.
There are a few answers to this question but the answers are outdated.
Can anyone help please?
What files to edit?
Location of Files?
Code that will work?

Many Thanks.
6 years ago
[email protected] wrote:
I am using the 3.9 version of nopcommerce and my products use Product Attributes. I would like to change the price $0.00 to Prices From at $xx.xx.  This product price (00.00) is displayed on home page.
There are a few answers to this question but the answers are outdated.
Can anyone help please?
What files to edit?
Location of Files?
Code that will work?

Many Thanks.


You can make a plugin that when the price of a product is Zero it replaces it by another text (as here by "Pedido Especial")) or field from the product data like Cost or Admin comment or a specification attribut or a new column added for this purpose.
6 years ago
[email protected] wrote:
I am using the 3.9 version of nopcommerce and my products use Product Attributes. I would like to change the price $0.00 to Prices From at $xx.xx.  This product price (00.00) is displayed on home page.
There are a few answers to this question but the answers are outdated.
Can anyone help please?
What files to edit?
Location of Files?
Code that will work?

Many Thanks.


@Eduardo already told you best option to do from plugin.

If you want to custom core code ==>
Go:

\Libraries\Nop.Services\Catalog\PriceFormatter.cs


and Edit:


/// <summary>
        /// Formats the price
        /// </summary>
        /// <param name="price">Price</param>
        /// <param name="showCurrency">A value indicating whether to show a currency</param>
        /// <param name="targetCurrency">Target currency</param>
        /// <param name="language">Language</param>
        /// <param name="priceIncludesTax">A value indicating whether price includes tax</param>
        /// <param name="showTax">A value indicating whether to show tax suffix</param>
        /// <returns>Price</returns>
        public virtual string FormatPrice(decimal price, bool showCurrency,
            Currency targetCurrency, Language language, bool priceIncludesTax, bool showTax)
        {
            //we should round it no matter of "ShoppingCartSettings.RoundPricesDuringCalculation" setting
            price = RoundingHelper.RoundPrice(price);
            
            //Do you login here if price zero

            string currencyString = GetCurrencyString(price, showCurrency, targetCurrency);
            if (showTax)
            {
                //show tax suffix
                string formatStr;
                if (priceIncludesTax)
                {
                    formatStr = _localizationService.GetResource("Products.InclTaxSuffix", language.Id, false);
                    if (String.IsNullOrEmpty(formatStr))
                        formatStr = "{0} incl tax";
                }
                else
                {
                    formatStr = _localizationService.GetResource("Products.ExclTaxSuffix", language.Id, false);
                    if (String.IsNullOrEmpty(formatStr))
                        formatStr = "{0} excl tax";
                }
                return string.Format(formatStr, currencyString);
            }
            
            return currencyString;
        }
6 years ago
Hallo,
Many Thanks for taking the time to offer help...
However, please confirm that this is for V3.90
because I can not find
The location files:

\Libraries\Nop.Services\Catalog\PriceFormatter.cs

Would you please confirm the location and the code I need to insert?

Thank you.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.