Product Price format change..

  • Posts: 18
  • Thank you received: 0
11 years 4 weeks ago #167122

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.1

Hey!

My apologies for the beginner's question but I'm new to php..

How could I change the order of hikashop_product_price_main so that it appears like:
"each 1€" instead of "1€ each"

I'm trying to figure it out by editing show_default.php and listing_price.php but no luck yet..
Any help would be greatly appreciated!

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

  • Posts: 12953
  • Thank you received: 1778
11 years 4 weeks ago #167128

Hello,
You'll have to edit the "listing_price" file of the "product" view of your front-end template via "Hikashop->Display->Views", note that the "each" is displayed through that 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>';
				}
			}
So you'll just have to replace it by :
			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>';
				}
			}

And move that php code before the displaying of the price :
if($price->price_min_quantity<=1){
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
}

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

  • Posts: 18
  • Thank you received: 0
11 years 4 weeks ago #167223

Thank you!

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

Time to create page: 0.066 seconds
Powered by Kunena Forum