[Skip to main content](#vessel-content)

#   Add CSS Class to Value and another one to currency symbol

##

- **[joki1994](/forum/user/70183-joki1994 "View joki1994's Profile")**
- [![joki1994's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/70183-joki1994 "View joki1994's Profile") Topic Author
- [ Offline](/forum/user/70183-joki1994)

Less More

- Posts: 13
- Thank you received: 2
-
-

4 years 1 week ago [\#346651](#346651) by [joki1994](/forum/user/70183-joki1994 "View joki1994's Profile")  *[Add CSS Class to Value and another one to currency symbol](/forum/27-checkout/905363-add-css-class-to-value-and-another-one-to-currency-symbol#346651 "-- HikaShop version -- : 4.6.2 -- Joomla version -- : 4.2.3 -- PHP version -- : 8.0.25 -- Browser(s) name and version -- : Firefox  Hi again,  is there a way to add two different css classes to the price value and the currency symbol, so that I can align the currency symbol on the left and the price value on the right.  I found several very old topics with the same issue but nothing solved my problem.  Hope you can help.  Kind Regards, Nathalie")* was created by *[joki1994](/forum/user/70183-joki1994 "View joki1994's Profile")*

-- HikaShop version -- : 4.6.2
-- Joomla version -- : 4.2.3
-- PHP version -- : 8.0.25
-- Browser(s) name and version -- : Firefox

Hi again,

is there a way to add two different css classes to the price value and the currency symbol, so that I can align the currency symbol on the left and the price value on the right.

I found several very old topics with the same issue but nothing solved my problem.

Hope you can help.

Kind Regards, Nathalie

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTM2My1hZGQtY3NzLWNsYXNzLXRvLXZhbHVlLWFuZC1hbm90aGVyLW9uZS10by1jdXJyZW5jeS1zeW1ib2w/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14327
-
-

4 years 1 week ago [\#346652](#346652) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add CSS Class to Value and another one to currency symbol](/forum/27-checkout/905363-add-css-class-to-value-and-another-one-to-currency-symbol#346652 "-- HikaShop version -- : 4.6.2 -- Joomla version -- : 4.2.3 -- PHP version -- : 8.0.25 -- Browser(s) name and version -- : Firefox  Hi again,  is there a way to add two different css classes to the price value and the currency symbol, so that I can align the currency symbol on the left and the price value on the right.  I found several very old topics with the same issue but nothing solved my problem.  Hope you can help.  Kind Regards, Nathalie")*

Hi,

There is no option for that.
However, thinking about it, I see a solution which will only require a slight modification in HikaShop. So we'll do the modification for the next version.
First, you need to change the line: Code:

if($column!='currency_symbol'){

to: Code:

if(in_array($column, array('currency_symbol', 'currency_format'))){

in the file administrator/components/com_hikashop/classes/currency.php
This will allow you the possibility to add HTML in the "format" setting of the currencies in the System&gt;Currencies menu of HikaShop. We'll add that change.

Second, you need to change the type of the currency_format column of the hikashop_currency table to VARCHAR(255) instead of the CHAR(10) which is there at the moment. You can do that in your PHPMyAdmin. We'll change that so that all new installations of HikaShop will get it automatically.

Third, in the "Format" setting of your currency, instead of Code:

%n

, you'll want to use something like that: Code:

&lt;span class="symbol"&gt;€&lt;/span&gt;&lt;span class="price"&gt;%!n&lt;/span&gt;

That way, you can then use .symbol{} and .price{} for your CSS.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTM2My1hZGQtY3NzLWNsYXNzLXRvLXZhbHVlLWFuZC1hbm90aGVyLW9uZS10by1jdXJyZW5jeS1zeW1ib2w/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[joki1994](/forum/user/70183-joki1994 "View joki1994's Profile")**
- [![joki1994's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/70183-joki1994 "View joki1994's Profile") Topic Author
- [ Offline](/forum/user/70183-joki1994)

Less More

- Posts: 13
- Thank you received: 2
-
-

4 years 1 week ago [\#346666](#346666) by [joki1994](/forum/user/70183-joki1994 "View joki1994's Profile")  Replied by *[joki1994](/forum/user/70183-joki1994 "View joki1994's Profile")* on topic *[Add CSS Class to Value and another one to currency symbol](/forum/27-checkout/905363-add-css-class-to-value-and-another-one-to-currency-symbol#346666 "-- HikaShop version -- : 4.6.2 -- Joomla version -- : 4.2.3 -- PHP version -- : 8.0.25 -- Browser(s) name and version -- : Firefox  Hi again,  is there a way to add two different css classes to the price value and the currency symbol, so that I can align the currency symbol on the left and the price value on the right.  I found several very old topics with the same issue but nothing solved my problem.  Hope you can help.  Kind Regards, Nathalie")*

Thank you for this very fast support.

I did everything you mentioned, but unfortunately if I enter html in the Format area of currency setting, the html disappear after saving.

This code Code:

&lt;span class="symbol"&gt;€&lt;/span&gt;&lt;span class="price"&gt;%!n&lt;/span&gt;

after saving is only €%!n

Therefore I don't have the possibility to style the symbol with .symbol in css file.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTM2My1hZGQtY3NzLWNsYXNzLXRvLXZhbHVlLWFuZC1hbm90aGVyLW9uZS10by1jdXJyZW5jeS1zeW1ib2w/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14327
-
-

4 years 1 week ago [\#346672](#346672) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add CSS Class to Value and another one to currency symbol](/forum/27-checkout/905363-add-css-class-to-value-and-another-one-to-currency-symbol#346672 "-- HikaShop version -- : 4.6.2 -- Joomla version -- : 4.2.3 -- PHP version -- : 8.0.25 -- Browser(s) name and version -- : Firefox  Hi again,  is there a way to add two different css classes to the price value and the currency symbol, so that I can align the currency symbol on the left and the price value on the right.  I found several very old topics with the same issue but nothing solved my problem.  Hope you can help.  Kind Regards, Nathalie")*

Hi,

Sorry, I made a typo when I wrote my message.
The code in the file administrator/components/com_hikashop/classes/currency.php should be: Code:

if(!in_array($column, array('currency_symbol', 'currency_format'))){

Then the saving should work properly.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTM2My1hZGQtY3NzLWNsYXNzLXRvLXZhbHVlLWFuZC1hbm90aGVyLW9uZS10by1jdXJyZW5jeS1zeW1ib2w/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[joki1994](/forum/user/70183-joki1994 "View joki1994's Profile")**
- [![joki1994's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/70183-joki1994 "View joki1994's Profile") Topic Author
- [ Offline](/forum/user/70183-joki1994)

Less More

- Posts: 13
- Thank you received: 2
-
-

4 years 1 week ago [\#346682](#346682) by [joki1994](/forum/user/70183-joki1994 "View joki1994's Profile")  Replied by *[joki1994](/forum/user/70183-joki1994 "View joki1994's Profile")* on topic *[Add CSS Class to Value and another one to currency symbol](/forum/27-checkout/905363-add-css-class-to-value-and-another-one-to-currency-symbol#346682 "-- HikaShop version -- : 4.6.2 -- Joomla version -- : 4.2.3 -- PHP version -- : 8.0.25 -- Browser(s) name and version -- : Firefox  Hi again,  is there a way to add two different css classes to the price value and the currency symbol, so that I can align the currency symbol on the left and the price value on the right.  I found several very old topics with the same issue but nothing solved my problem.  Hope you can help.  Kind Regards, Nathalie")*

Thank you, that works perfect

The following user(s) said Thank You: [Philip](/forum/user/34318-philip "View Philip's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTM2My1hZGQtY3NzLWNsYXNzLXRvLXZhbHVlLWFuZC1hbm90aGVyLW9uZS10by1jdXJyZW5jeS1zeW1ib2w/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.065 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
