Price (GBR) or (USD) lblPriceValue

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 13 años
Newbie to ASP.net and think that Nopcommerce is cool - had the CMS up and runing in a day (version 1.8) fantastic features... But got stuck on this point... Have a product displayed at....   £19.00 (GBP)

I want to remove the (GBP) so only     £19.00      is displayed... But where and how can i change it! (or put it in a <span> class...)

ProductPrice.ascx  - (line 10)
<asp:Label ID="lblPriceValue" runat="server" CssClass="productPrice" />

Looks like i have to change something in the ProductPrice.ascx.cs - file - any advice would be great...
Hace 13 años
I think you can go in the admin area->configuration->location->Currencies edit British Pound and in the custom formatting put £#,##0.00 (not tested)
Hace 13 años
hi roger, thanks for reply... tired out the custom formatting - but was not successful.... thanks for the info...

Did change the file: Templates\Products\OneVariant.ascx

Line: 69
<nopCommerce:ProductPrice ID="ctrlProductPrice2" runat="server" /> exclusive offer

local display page now becomes: £19.00 (GBR) exclusive offer
change the currency - $ :   $30.14 (USD) exclusive offer

know its on the module page - but unsure of which values to change or comment out code... ProductPrice.ascx - ProductPrice.ascx.cs - ProductPrice.ascx.designer.cs
Hace 13 años
First go to Home > Configuration > Location > Currencies in the administration area then

edit your currency


£#,###.00


and it will change for sure
Hace 13 años
UK - Edit Currency details: Custom formatting
£#,###.00  (exclusive)  - add this to the GBR and shows up as

£19.99 (exclusive) (GBR)  change the currency....
$19.99 (USD)

Okay not the result i wanted, but getting warmer, must be something with the currency code / product id displaying....its like finding a needle in a haystack, but without a magnet...
Hace 13 años
1. Just disable or delete all other currencies from admin area and GBP will disappear (ensure that only one currency is enabled)
or
2. Delete the following code in LocalizationManager.GetCurrencyString(decimal amount, bool showCurrency, Currency targetCurrency) method:
if (showCurrency && CurrencyManager.GetAllCurrencies().Count > 1)
result = String.Format("{0} ({1})", result, targetCurrency.CurrencyCode);
Hace 13 años
Hi Andrei,

I went with option 2: and worked great - you know your stuff - thanks a million

if (showCurrency && CurrencyManager.GetAllCurrencies().Count > 1)
result = String.Format("{0} ({1})", result, targetCurrency.CurrencyCode);


Notes: File...(vs2010) NopCommerce v1.8

Libraries/Localization/LocalizationManager.cs
(delete 2 lines of code...)
Rebuild and f5

= Screen Product price =    £19.99

Just what i was after....
Hace 13 años
What would be the easiest way to change the way that the price is displayed.  For example, I have the following shown on the product description page:

Old Price: $25.00 inc tax
$20.00 inc Tax

What I would like to see is something like:

Old Price: $25.00 inc tax
Your Price: $20.00 inc tax

Could even add a Saving: $5.00 or a percentage figure underneath


Paul
Hace 13 años
Old Price: $25.00 inc tax
Your Price: $20.00 inc tax

For v1.8... Using the DEMO build files..

Store/Templates/Products/   OneVariant.ascx
Go to Line 103 add a SPAN at start of line...  <span style="color:red;">TEST</span>

Store/Modules/ProductPrice1.ascx
Go to Line 10 add a SPAN at start of line... <span style="color:red;">WORD</span>

Store/Modules/ProductPrice2.ascx
Go to Line 3 and 5 add a SPAN's at start of line... <span style="color:red;">123</span>

Remember to save the files and in the local or (upload) Remote - refresh your browsers and the added words will be there - go back to SPAN's and adjust your html coding...for different effects etc...

You will find the examples in - Book Category and product /61-cooking-for-two.aspx
Hace 12 años
In version 2.0 if you don't wish to alter the logic, find the view _ProductPrice.cshtml in the catalog folder and replace the line:

<span class="productPrice">@Model.Price</span>

with this

<span class="productPrice">@Model.Price.Remove(@Model.Price.Length - 5)</span>

May not be good practice to run string manipulation on every price that is shown but given that every currency code is 3 characters in length you can just trim the Price string length down by 5 characters to remove the (USD) at the end of the price.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.