want price per unit before the price

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
9 years 1 month ago #195394

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.5.x

Hello,

We want the line price per unit. before the price instead of behind. but not to be shown in the listing of products.
can u tell me how to do that! i attached two images one of the products listing and one of a product itself.
I can not seem to figure it out. Please help.
Thanks.

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
9 years 4 weeks ago #195397

Hello,
1. If you want to remove the "price" column of your product listing, you'll just have to set the "Display price" option to NO through your product listing content menu/module configuration page.
2. What do you exactly mean by : "We want the line price per unit. before the price instead of behind" ?

Last edit: 9 years 1 month ago by Mohamed Thelji.

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
9 years 4 weeks ago #195528

1. we don't want to remove the price in the listing. only the text price per unit.
we alterd the table that's why the text price per unit is now underneat the price. normaly it will be after the price. like this: $ 40,- per unit.
2. in the product itself we want this textline per unit (we will translate this text in dutch to: onze prijs) to be before $ 40,-
so that it looks like: onze prijs $ 40,- instead of $ 40,- onze prijs

Hope u can help

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

  • Posts: 13201
  • Thank you received: 2322
9 years 4 weeks ago #195535

Hi,

So to in the view "product / listing_price" you can replace the code:

			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>';
				}
			}
By:
			if(JRequest::getCmd('layout') == 'show' && 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>';
				}
			}
To display it only on the product detail page, and move that whole code earlier in the view to display it before the price.

www.hikashop.com/support/support/documen...ize-the-display.html

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
9 years 3 weeks ago #195896

A little late,
but thanks for this solution. i couldn't figure it out.
it works!

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
5 years 11 months ago #292640

Hello,
A little question,
It seems that the code you gave me does not set the text per unit in front of the price any more since the new version of hikashop.
How can i do it now?
Thanks

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
5 years 11 months ago #292643

Hi,

There was two modifications in the message from Xavier.
The first one was to add JRequest::getCmd('layout') == 'show' so that the per unit would only display on the product page, not on listings.
If you applied that change, it's normal that it didn't change the location of the per unit text.
The second modification was to swap that block of code with the code before it :

echo '<span class="'.implode(' ',$classes).'"'.$attributes.'>';

			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');
			}
			echo '</span> ';
and that is the modification you want to do.
This code hasn't changed since 3 years ago so the modification is still valid and it's still in the same view file you need to do it.

The following user(s) said Thank You: BluepointWebdesign

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

Time to create page: 0.096 seconds
Powered by Kunena Forum