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

#   Multicurrency / Different prices

##

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

Less More

- Posts: 29
- Thank you received: 0
-
-

11 years 8 months ago [\#190335](#190335) by [Pajerchin](/forum/user/20592-pajerchin "View Pajerchin's Profile")  *[Multicurrency / Different prices](/forum/26-product-category-display/874913-multicurrency-different-prices#190335 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.17 -- Browser(s) name and version -- : Firefox 35.0.1  Hello,  1) I Have two currencies&gt; - EURO (default currency) - CZK (second currency)  2) For product I define separate prices for EURO &amp; CZK (See PICTURE 1)  3) On Front end I set CZK currency  PROBLEM: ----- In the category listing of the products - the displayed prices are the prices in CZK calculated by currency ratio (See PICTURE 2) because at the product definition are enterred the prices for every currency separatelly  In the product detail listing - is everything OK - the displayed price is CZK price defined in my Product (See PICTURE 3)  Would you be so kind to provide any advice how on the category listing of the products (PICTURE 2) display right prices for &quot;second currency - CZK&quot;, please ?")* was created by *[Pajerchin](/forum/user/20592-pajerchin "View Pajerchin's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.17
-- Browser(s) name and version -- : Firefox 35.0.1

Hello,

1)
I Have two currencies&gt;
- EURO (default currency)
- CZK (second currency)

2)
For product I define separate prices for EURO &amp; CZK (See PICTURE 1)

3)
On Front end I set CZK currency

PROBLEM:

---

In the category listing of the products - the displayed prices are the prices in CZK calculated by currency ratio (See PICTURE 2)
It is wrong, because at the product definition are enterred the prices for every currency separatelly

In the product detail listing - is everything OK - the displayed price is CZK price defined in my Product (See PICTURE 3)

Would you be so kind to provide any advice how on the category listing of the products (PICTURE 2) display right prices for "second currency - CZK", please ?

[ ![Prices.jpg](/forum/attachment/22310) ](/forum/attachment/22310 "Prices.jpg")

- [ ![Prices.jpg](/forum/attachment/22310) ](/forum/attachment/22310 "Prices.jpg") [ ](/forum/attachment/22310?download=1 "Prices.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzQ5MTMtbXVsdGljdXJyZW5jeS1kaWZmZXJlbnQtcHJpY2VzP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 8 months ago [\#190394](#190394) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Multicurrency / Different prices](/forum/26-product-category-display/874913-multicurrency-different-prices#190394 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.17 -- Browser(s) name and version -- : Firefox 35.0.1  Hello,  1) I Have two currencies&gt; - EURO (default currency) - CZK (second currency)  2) For product I define separate prices for EURO &amp; CZK (See PICTURE 1)  3) On Front end I set CZK currency  PROBLEM: ----- In the category listing of the products - the displayed prices are the prices in CZK calculated by currency ratio (See PICTURE 2) because at the product definition are enterred the prices for every currency separatelly  In the product detail listing - is everything OK - the displayed price is CZK price defined in my Product (See PICTURE 3)  Would you be so kind to provide any advice how on the category listing of the products (PICTURE 2) display right prices for &quot;second currency - CZK&quot;, please ?")*

Hi,

Change the code: Code:

$currentRowPrices = array(); $matches=array(); foreach($prices as $price){ if($price-&gt;price_product_id!=$element-&gt;product_id){ continue; } if ( !empty( $price-&gt;price_site_id) &amp;&amp; $price-&gt;price_site_id == '[unselected]') { $price-&gt;price_site_id = ''; } if ( !isset( $matches[$price-&gt;price_min_quantity])) { $matches[$price-&gt;price_min_quantity]=$price; }elseif ( empty( $matches[$price-&gt;price_min_quantity]-&gt;price_site_id)) { $matches[$price-&gt;price_min_quantity]=$price; }elseif ( $matches[$price-&gt;price_min_quantity]-&gt;price_site_id == $price-&gt;price_site_id) { $matches[$price-&gt;price_min_quantity]=$price; } $currentRowPrices[]=$price; } if(empty($matches)&amp;&amp;!empty($currentRowPrices)){ foreach($currentRowPrices as $price){ if($price-&gt;price_currency_id==$main_currency){ $matches[$price-&gt;price_min_quantity]=$price; } } if(empty($matches)){ $match = array_pop($currentRowPrices); if(!empty($currentRowPrices)){ foreach($currentRowPrices as $price){ if($price-&gt;price_currency_id==$match-&gt;price_currency_id){ $matches[$price-&gt;price_min_quantity]=$price; } } } $matches[]=$match; } }

by the code: Code:

$defaultCurrentRowPrices = array(); $currentRowPrices = array(); $matches=array(); //get a list of the prices with the good currency and a list of prices in other currencies for the current product foreach($prices as $price){ // Skip if the price is not for the current product if($price-&gt;price_product_id!=$element-&gt;product_id){ continue; } $defaultCurrentRowPrices[]=$price; // Skip if the price is not for the current currency if($price-&gt;price_currency_id!=$currency_id) { continue; } if ( !empty( $price-&gt;price_site_id) &amp;&amp; $price-&gt;price_site_id == '[unselected]') { $price-&gt;price_site_id = ''; } if ( !isset( $matches[$price-&gt;price_min_quantity])) { // If a price is not already saved for this minimum quantity, save it $matches[$price-&gt;price_min_quantity]=$price; }elseif ( empty( $matches[$price-&gt;price_min_quantity]-&gt;price_site_id)) { // Otherwise, when a default price is present, it can be replaced by another default (lower) price or specific site ID price $matches[$price-&gt;price_min_quantity]=$price; }elseif ( $matches[$price-&gt;price_min_quantity]-&gt;price_site_id == $price-&gt;price_site_id) { // Finally, when the SAME "Site" price is present, then replace it with the lower price (as the prices are sorted in DESC order) $matches[$price-&gt;price_min_quantity]=$price; } $currentRowPrices[]=$price; } // When no price is selected for the currency if ( empty( $currentRowPrices) &amp;&amp; !empty( $defaultCurrentRowPrices)) { // Then use the default one to allow currency conversion. $currentRowPrices = $defaultCurrentRowPrices; } //if we didn't found any prices in the good currency we choose another currency (the main one preferably) and use the prices in this currency if(empty($matches)&amp;&amp;!empty($currentRowPrices)){ foreach($currentRowPrices as $price){ if($price-&gt;price_currency_id==$main_currency){ $matches[$price-&gt;price_min_quantity]=$price; } } if(empty($matches)){ $match = array_pop($currentRowPrices); if(!empty($currentRowPrices)){ foreach($currentRowPrices as $price){ if($price-&gt;price_currency_id==$match-&gt;price_currency_id){ $matches[$price-&gt;price_min_quantity]=$price; } } } $matches[]=$match; } }

in the file administrator/components/com_hikashop/classes/currency.php and that should fix the problem.

The following user(s) said Thank You: [cpreen](/forum/user/604-cpreen "View cpreen's Profile"), [Pajerchin](/forum/user/20592-pajerchin "View Pajerchin's Profile"), [tristanbailey](/forum/user/36164-tristanbailey "View tristanbailey's Profile")

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

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

Less More

- Posts: 29
- Thank you received: 0
-
-

11 years 8 months ago [\#190414](#190414) by [Pajerchin](/forum/user/20592-pajerchin "View Pajerchin's Profile")  Replied by *[Pajerchin](/forum/user/20592-pajerchin "View Pajerchin's Profile")* on topic *[Multicurrency / Different prices](/forum/26-product-category-display/874913-multicurrency-different-prices#190414 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.17 -- Browser(s) name and version -- : Firefox 35.0.1  Hello,  1) I Have two currencies&gt; - EURO (default currency) - CZK (second currency)  2) For product I define separate prices for EURO &amp; CZK (See PICTURE 1)  3) On Front end I set CZK currency  PROBLEM: ----- In the category listing of the products - the displayed prices are the prices in CZK calculated by currency ratio (See PICTURE 2) because at the product definition are enterred the prices for every currency separatelly  In the product detail listing - is everything OK - the displayed price is CZK price defined in my Product (See PICTURE 3)  Would you be so kind to provide any advice how on the category listing of the products (PICTURE 2) display right prices for &quot;second currency - CZK&quot;, please ?")*

Yes - it works

The problem is solved.

Thank you very much for quick and perfect help.

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

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

Less More

- Posts: 4
- Thank you received: 1
-
-

11 years 6 months ago [\#197014](#197014) by [tristanbailey](/forum/user/36164-tristanbailey "View tristanbailey's Profile")  Replied by *[tristanbailey](/forum/user/36164-tristanbailey "View tristanbailey's Profile")* on topic *[Multicurrency / Different prices](/forum/26-product-category-display/874913-multicurrency-different-prices#197014 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.17 -- Browser(s) name and version -- : Firefox 35.0.1  Hello,  1) I Have two currencies&gt; - EURO (default currency) - CZK (second currency)  2) For product I define separate prices for EURO &amp; CZK (See PICTURE 1)  3) On Front end I set CZK currency  PROBLEM: ----- In the category listing of the products - the displayed prices are the prices in CZK calculated by currency ratio (See PICTURE 2) because at the product definition are enterred the prices for every currency separatelly  In the product detail listing - is everything OK - the displayed price is CZK price defined in my Product (See PICTURE 3)  Would you be so kind to provide any advice how on the category listing of the products (PICTURE 2) display right prices for &quot;second currency - CZK&quot;, please ?")*

Hi @nicolas

Thanks for that code for currency using all available priced options not just the main currency.

Could this be an option switch in Hikashop rather than a code change in a next version?

Works for me now though, so thank you

tristan

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzQ5MTMtbXVsdGljdXJyZW5jeS1kaWZmZXJlbnQtcHJpY2VzP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 6 months ago [\#197096](#197096) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Multicurrency / Different prices](/forum/26-product-category-display/874913-multicurrency-different-prices#197096 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.17 -- Browser(s) name and version -- : Firefox 35.0.1  Hello,  1) I Have two currencies&gt; - EURO (default currency) - CZK (second currency)  2) For product I define separate prices for EURO &amp; CZK (See PICTURE 1)  3) On Front end I set CZK currency  PROBLEM: ----- In the category listing of the products - the displayed prices are the prices in CZK calculated by currency ratio (See PICTURE 2) because at the product definition are enterred the prices for every currency separatelly  In the product detail listing - is everything OK - the displayed price is CZK price defined in my Product (See PICTURE 3)  Would you be so kind to provide any advice how on the category listing of the products (PICTURE 2) display right prices for &quot;second currency - CZK&quot;, please ?")*

Hi,

This fix was included in HikaShop 2.4.0

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzQ5MTMtbXVsdGljdXJyZW5jeS1kaWZmZXJlbnQtcHJpY2VzP3RtcGw9bWFya2Rvd24=) 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.212 seconds

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

[](#top)
