Do not display Base Currency on Product Listing

  • Posts: 4
  • Thank you received: 0
5 years 9 months ago #294698

-- HikaShop version -- : 3.4.1
-- Joomla version -- : 3.8.1
-- PHP version -- : 7.1

We would like to show products only in their own Currency and hide Base Currency on Product Listing.

There is a very old discussion about modifying code in Views >> Product Listing.

However, the code now is different and old patch can not be used.

Can you advise how to modify the code so that only product's own currency is shown both on Product Listing and Checkout?

www.hikashop.com/forum/checkout/866056-d...eir-currency-of.html

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

  • Posts: 81511
  • Thank you received: 13066
  • MODERATOR
5 years 9 months ago #294743

Hi,

The piece of code mentioned on that other thread is still the exact same in product / listing_price.php:

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');
					}
so I don't see why the patch couldn't be used anymore. Did you get an error when you tried ? Which one ?

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

  • Posts: 4
  • Thank you received: 0
5 years 9 months ago #294776

and if we create a Module for "Product Listing" to be used with HikaMarket Vendor List, we also use "listing_price.php" or some other file?

sethealth.ru/список-продавцов/vendor/show/6-linda-cakes

here it shows Base currency "1 300 Баллов" and then in brackets the currency that we want to display: (1 300,00 РУБ)

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
5 years 9 months ago #294785

Hello,

The product listing module under the vendor page is still a product listing.
If you create a menu or a module for a product listing, it will use the same HikaShop content. The place where you place the module doesn't matter but the module/menu settings do.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 4
  • Thank you received: 0
5 years 9 months ago #294959

but why replacing code doesn't help then?

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

  • Posts: 81511
  • Thank you received: 13066
  • MODERATOR
5 years 9 months ago #294980

Hi,

So do you mean that it works fine for other products listings and not for that products listing on the vendor page ?
I suppose that it doesn't work anymore because probably the modification you're doing is not the one you want to do.
For what you want, you need to change the 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') && !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');
			}
to:
if(empty($price->price_orig_value)){
			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');
			}
} else {
				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');
				}
}
Please note however that such customization is outside of the support we're supposed to provide. We can give hints but it's up to you to do such code modifications or hire someone to help you with them.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum