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

Posted: February 10, 2018 at 4:44 PM Quote #200468
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.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: February 12, 2018 at 12:59 PM Quote #200528
[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.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Regards

Eduardo

www.tecnofin.com
nopCommerce Solution Partner
-----------------------------------------------------------
Developer of e-Commerce sites since 1996
Mexico - Chile- Colombia - Costa Rica - Peru
Desarrollo de sitios de comercio electrónico
Posted: February 13, 2018 at 12:21 AM Quote #200538
[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;
        }
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Best Regards,
nopStation;
Email : [email protected], [email protected], [email protected]
https://nop-station.com
Skype: sohel.bs23, sina.bs-23, nafiz.khan_1
Please vote up if it helps.
Posted: February 13, 2018 at 4:12 PM Quote #200577
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 post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.