Skip to main content

How to put "per unit" below product price

More
12 years 1 month ago #168830 by kontakt@friesbureau.dk
-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3.
-- PHP version -- : 5.4.
-- Browser(s) name and version -- : Safari

Hi Hika Support,

I need to put "per unit" below the product price in category table layout.

How is this possible?

I found another thread, ( www.hikashop.com/forum/4-how-to/51395-ch...length-per-reel.html ) but I need an example code for my problem.

Best regards

Carsten

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

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

By default you should see the word "each" displayed, so you can replace it thanks to a translation override on the key "PER_UNIT".
Here is some documentation:
hikashop.com/support/faq.html#tran

Else you can add it via a view override. Actually the given informations are not correct, the category table layout is a layout for the categories, what kind of layout do you use for the products ? You can see this information in the associated module of the category listing menu.

If you use the "table" one, so the view to edit will be "product / listing_table", here is documentation for layout editions:
hikashop.com/support/support/documentati...ize-the-display.html

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

More
12 years 1 month ago #168907 by kontakt@friesbureau.dk
Hi Xavier

I'm sorry if I didn't explain myself very clearly. I don't need a translation, and I already know that I have to edit the view of "product/listing table".

But I don't know which code to edit, or which code to put in. I want to put "pr. vare..." under the product price in a row format..

Hope this is more clear to you.

Best regards

Carsten

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

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

So you have to replace the code:
Code:
<?php if($this->params->get('show_price','-1')=='-1'){ $config =& hikashop_config(); $this->params->set('show_price',$config->get('show_price')); } if($this->params->get('show_price')){ ?> <td class="hikashop_product_price_row"> <?php $this->setLayout('listing_price'); echo $this->loadTemplate(); ?> </td> <?php } ?>
By:
Code:
<?php if($this->params->get('show_price','-1')=='-1'){ $config =& hikashop_config(); $this->params->set('show_price',$config->get('show_price')); } if($this->params->get('show_price')){ ?> <td class="hikashop_product_price_row"> <tr> <td> <?php $this->setLayout('listing_price'); echo $this->loadTemplate(); ?> </td> <td> <?php echo JText::_('PR_VARE'); ?> </td> </tr> </td> <?php } ?>
This way it will be in a row under the product price.
Don't forget to add the translation for "PR_VARE".

ps: thanks to note that we generally don't provide customization code. ;)

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

More
12 years 1 month ago #169356 by kontakt@friesbureau.dk
Hi Xavier

Thank you for the customization even though it is not considered commes il faut in this forum.

I changed the layout to img-title and made the customization in this view instead. For others interest, I put this code:

<tr>
<td>
<?php echo $this->row->product_description; ?>
</td>
</tr>

In the product / listing. img.title.php so it will look like this:

<!-- PRODUCT PRICE -->
<?php
}
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
if($this->params->get('show_price')){
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
?><tr>
<td>
<?php echo $this->row->product_description; ?>
</td>
</tr>
<!-- EO PRODUCT PRICE -->

Best regards

Carsten
The following user(s) said Thank You: Mohamed Thelji

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

Time to create page: 0.198 seconds
Powered by Kunena Forum