Skip to main content

Display prices only in their currency of

More
12 years 7 months ago #144982 by Premier
Hello, I need to show only the price in the currency specified in settings ( each item separately).

1. If the product is worth the price of 10 Euro is to show only this price without conversion to base currency store (which is set as the main settings );

2 . If the setting is worth the price shipping method delivery $ 5 (USD), then to ordering to only have this price , without conversion to Euro ( if the Euro is the main currency of the site).

Please tell me how to do it ?

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #144999 by Mohamed Thelji
Hi,
1. & 2. If your have set your main currency to USD, the best solution will probably be to let your product price show like this : $13.72 (10€)
But if you only want : 10€ you'll have to directly edit the code of the files of the "product" view of your front-end template through the page "Hikashop->Display->Views"

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #145034 by Premier
Not understand :-)

By default (possibly) be Euro

Examples:

1. Product 1, the price of 50 USD, you need to show the price of 50 USD, do not show the Euro;

2. Product 2, the price of 1000 JPY, you need to show the price of 1000 JPY, do not show the Euro;

3. Product 3, the price of 200 RUB, you need to show the price of 1000 RUB, do not show the Euro;

4. Product 4, the price of 40 Euro, you need to show the price of 40 Euro.

What exactly to edit? :-)

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #145070 by nicolas
Hi,

There is no option to do that.
HikaShop always displays the prices on the page in the same currency.
HikaShop can display both the original price and the converted price if you turn on the "show original price" option of the configuration.
Then, if you want to remove the display of the converted price, as Mohamed said, you'll have to modify the code of the view.
You can for example edit the file "listing_price" of the view "product" via the menu Display>Views and remove the code:
Code:
if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } if($this->params->get('show_original_price','-1')=='-1'){ $config =& hikashop_config(); $this->params->set('show_original_price',$config->get('show_original_price')); }
and that way you'll only see the original price on the products listings and on the product page.

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #168378 by erhartm
while this somewhat works, it does not show any price anymore for products whose original price is set in the currency selected.

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #168459 by Xavier
Hi,

In 6 months few things could have changed.
Thanks to give us your HikaShop version number, and tell us what you exactly need. :)

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #168476 by erhartm
sorry for resurrecting an old thread :-) thank you for the answer!!

my problem is exactly the same as described above.

Version 2.3.2 business, Joomla 3.3.3

I have two products, one has the original price set to EUR, one tu USD; in the frontend, I want ONLY the original currency to be displayed, not both currencies. It should be:

Product 1 56 USD
Product 2 30 EUR

instead of

Product 1 40 EUR (56 USD)
Product 2 30 EUR

thank you and all the best,

Lukas

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #168479 by Xavier
Hi,

So you well have to edit the view "product / listing_price" use code like:
Code:
if(empty($price->price_orig_value_without_discount_with_tax)){ if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value_without_discount,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } } if($this->params->get('show_original_price') && !empty($price->price_orig_value_without_discount_with_tax)){ if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_orig_value_without_discount_with_tax,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax') && !empty($price->price_orig_value_without_discount)){ echo $this->currencyHelper->format($price->price_orig_value_without_discount,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } }
Instead of:
Code:
if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value_without_discount,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } if($this->params->get('show_original_price') && !empty($price->price_orig_value_without_discount_with_tax)){ echo JText::_('PRICE_BEFORE_ORIG'); if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_orig_value_without_discount_with_tax,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax') && !empty($price->price_orig_value_without_discount)){ echo $this->currencyHelper->format($price->price_orig_value_without_discount,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); }

There is two places to edit. the second one you have to adapt the code to not display the taxes.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #198914 by blueagle1829
I have the exact same issue as post # 168476. I want to show just the currency the product is associated with. I'm not sure exactly how to modify the code you provided.

Below is the code for my listing_price file. Where do I need to modify this code?
Code:
<?php /** * @package HikaShop for Joomla! * @version 2.2.2 * @author hikashop.com * @copyright (C) 2010-2013 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php $class =''; if(!empty($this->row->prices) && count($this->row->prices)>1){ $class = ' hikashop_product_several_prices'; } if(isset($this->element->main->product_msrp) && !(@$this->row->product_msrp > 0.0) ) $this->row->product_msrp = $this->element->main->product_msrp; if(isset($this->row->product_msrp) && @$this->row->product_msrp > 0.0 && JRequest::getCmd('layout') == 'show' && $this->params->get('from_module','') == ''){ ?> <span class="hikashop_product_msrp_price hikashop_product_price_full"> <span class="hikashop_product_msrp_price_title"> <?php echo JText::_('PRODUCT_MSRP_BEFORE'); ?> </span> <span class="hikashop_product_price"> <?php $mainCurr = $this->currencyHelper->mainCurrency(); $app = JFactory::getApplication(); $currCurrency = $app->getUserState( HIKASHOP_COMPONENT.'.currency_id', $mainCurr ); $msrpCurrencied = $this->currencyHelper->convertUniquePrice($this->row->product_msrp,$mainCurr,$currCurrency); if($msrpCurrencied == $this->row->product_msrp) echo $this->currencyHelper->format($this->row->product_msrp,$mainCurr); else echo $this->currencyHelper->format($msrpCurrencied,$currCurrency).' ('.$this->currencyHelper->format($this->row->product_msrp,$mainCurr).')'; ?> </span> </span> <?php } ?> <span class="hikashop_product_price_full<?php echo $class; ?>"> <?php if(empty($this->row->prices)){ echo JText::_('FREE_PRICE'); }else{ $first=true; echo JText::_('PRICE_BEGINNING'); $i=0; if(isset($this->row->product_msrp) && @$this->row->product_msrp > 0.0 && JRequest::getCmd('layout') == 'show' && $this->params->get('from_module','') == ''){ echo '<span class="hikashop_product_our_price_title">'.JText::_('PRODUCT_MSRP_AFTER').'</span> '; } if($this->params->get('price_with_tax',3)==3){ $config =& hikashop_config(); $this->params->set('price_with_tax',$config->get('price_with_tax')); } foreach($this->row->prices as $price){ if($first)$first=false; else echo JText::_('PRICE_SEPARATOR'); $start = JText::_('PRICE_BEGINNING_'.$i); if($start!='PRICE_BEGINNING_'.$i){ echo $start; } if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $price->price_min_quantity>1){ echo '<span class="hikashop_product_price_with_min_qty hikashop_product_price_for_at_least_'.$price->price_min_quantity.'">'; } $classes = array('hikashop_product_price hikashop_product_price_'.$i); if(!empty($this->row->discount)){ $classes[]='hikashop_product_price_with_discount'; } if(!empty($this->row->discount)){ if($this->params->get('show_discount',3)==3){ $config =& hikashop_config(); $this->params->set('show_discount',$config->get('show_discount')); } if($this->params->get('show_discount')==1){ echo '<span class="hikashop_product_discount">'.JText::_('PRICE_DISCOUNT_START'); if(bccomp($this->row->discount->discount_flat_amount,0,5)!==0){ echo $this->currencyHelper->format(-1*$this->row->discount->discount_flat_amount,$price->price_currency_id); }elseif(bccomp($this->row->discount->discount_percent_amount,0,5)!==0){ echo -1*$this->row->discount->discount_percent_amount.'%'; } echo JText::_('PRICE_DISCOUNT_END').'</span>'; }elseif($this->params->get('show_discount')==2){ echo '<span class="hikashop_product_price_before_discount">'.JText::_('PRICE_DISCOUNT_START'); if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value_without_discount,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } if($this->params->get('show_original_price','-1')=='-1'){ $config =& hikashop_config(); $this->params->set('show_original_price',$config->get('show_original_price')); } if($this->params->get('show_original_price') && !empty($price->price_orig_value_without_discount_with_tax)){ echo JText::_('PRICE_BEFORE_ORIG'); if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_orig_value_without_discount_with_tax,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax') && !empty($price->price_orig_value_without_discount)){ echo $this->currencyHelper->format($price->price_orig_value_without_discount,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo JText::_('PRICE_DISCOUNT_END').'</span>'; }elseif($this->params->get('show_discount')==3){ } } echo '<span class="'.implode(' ',$classes).'">'; if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_value,$price->price_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } if($this->params->get('show_original_price','-1')=='-1'){ $config =& hikashop_config(); $this->params->set('show_original_price',$config->get('show_original_price')); } if($this->params->get('show_original_price') && !empty($price->price_orig_value)){ echo JText::_('PRICE_BEFORE_ORIG'); if($this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_orig_value_with_tax,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ echo $this->currencyHelper->format($price->price_orig_value,$price->price_orig_currency_id); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '</span> '; if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){ if($price->price_min_quantity>1){ echo '<span class="hikashop_product_price_per_unit_x">'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity).'</span>'; }else{ echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>'; } } if($this->params->get('show_price_weight')){ if(!empty($this->element->product_id) && isset($this->row->product_weight) && bccomp($this->row->product_weight,0,3)){ echo JText::_('PRICE_SEPARATOR').'<span class="hikashop_product_price_per_weight_unit">'; if($this->params->get('price_with_tax')){ $weight_price = $price->price_value_with_tax / $this->row->product_weight; echo $this->currencyHelper->format($weight_price,$price->price_currency_id).' / '.JText::_($this->row->product_weight_unit); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){ $weight_price = $price->price_value / $this->row->product_weight; echo $this->currencyHelper->format($weight_price,$price->price_currency_id).' / '.JText::_($this->row->product_weight_unit); } if($this->params->get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } echo '</span>'; } } if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $price->price_min_quantity>1){ echo '</span>'; } $end = JText::_('PRICE_ENDING_'.$i); if($end!='PRICE_ENDING_'.$i){ echo $end; } $i++; } echo JText::_('PRICE_END'); } ?></span>

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #198997 by Mohamed Thelji
Hello,
If you want to do the same thing you'll probably just have to reproduce and test what Nicolas and Xavier said.

Please Log in or Create an account to join the conversation.

Time to create page: 0.339 seconds
Powered by Kunena Forum