- Posts: 7
- Thank you received: 0
change per unit into per set, per length, per reel
we are planing to sell products with a hikashop 2.5.
in the product-mask i haven't the possibility to change the phrase "per unit" after the price into one of the other terms mentioned above. A simple translation isn't usefull, because we sell different things per unit, per set, per length (per meter) ot per reel. So is there a possibility to adjust the term seperately for every product?
Please Log in or Create an account to join the conversation.
A way to do that is:
Create a "Custom field" in Hikashop > Display > Custom fields with the table "Product" with the title, for example: "product_per";
In your product configuration page, add "unit" in the "product_per" field.
Then in Hikashop > Display > Views, edit the view: "product / listing_price.php" in the good template.
Here you can replace:
To:
And add custom values for your checks: unit / set / lenght / reel ...
Please Log in or Create an account to join the conversation.
$mengeneinheit1 = JText::_('PER_UNIT') ;
foreach($this->fields as $fieldName => $oneExtraField) {
if(!empty($this->element->$fieldName)){
if( $this->fieldsClass->show($oneExtraField,$this->element->$fieldName) == 'pro Satz'){
$mengeneinheit1 = JText::_('per pack');}
else if( $this->fieldsClass->show($oneExtraField,$this->element->$fieldName) == 'pro Meter'){
$mengeneinheit1 = JText::_('per meter');}
else if( $this->fieldsClass->show($oneExtraField,$this->element->$fieldName) == 'pro Rolle'){
$mengeneinheit1 = JText::_('per reel');}
}
}
echo $mengeneinheit1;
But thre's another Problem.In the product overviews, there is alway mentioned 'PER_UNIT' or my translation 'pro Stück' and not my chosen option (here per_pack). So i need to copy the text in another file, but i coldn't find it. Could you give me a hint.
Here the picture:
Overview
Product Page
Please Log in or Create an account to join the conversation.
For the product overviews you need:
$this->row->product_per == 'unit'
Please Log in or Create an account to join the conversation.
Also I am looking to create instead of the $14.95 each to $14.95 per page
Sorry but getting a bit lost creating this.
Sorry fixed!, got it via the Configuration, languages file, edited that and voila, per page pops up
Please Log in or Create an account to join the conversation.
- arens
-
- Thank you received: 0
How too change order of " per unit" for before the price??
Ex: per unit 345 €
tx
Please Log in or Create an account to join the conversation.
You can override the translation of: "PRICE_BEGINNING" to set: PRICE_BEGINNING="per unit". and the translation of: "PER_UNIT" to PER_UNIT=""
Please Log in or Create an account to join the conversation.
- arens
-
- Thank you received: 0
I solved but i have aproblem in page Checkout appear "precio" in resume products.
See attacha capture
Attachment not found
Please Log in or Create an account to join the conversation.
You can edit the view "product / listing_price" and add a span tag around the text "echo JText:
And then add a property in the frontend css file like:
Please Log in or Create an account to join the conversation.
- arens
-
- Thank you received: 0
i put the code , but a error syntax,
the error:
arse error: syntax error, unexpected '/' in
i write this:
But no dissappear .
The text appear , in the PDF, mail etc.. all
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- arens
-
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Could you give a link to your website ?
Please Log in or Create an account to join the conversation.
- arens
-
- Thank you received: 0
checkout / listing_price.php
And dissappear!!
is correct?
i need dissapear in Pdf and mails how too file modified??
Please Log in or Create an account to join the conversation.
All the views where "PRICE_BEGINNING" is present are:
"checkout / listing_price", "checkout / shipping", "product / listing_price".
Please Log in or Create an account to join the conversation.
So far I have added this code:
if($this->element->product_per == '' || $this->row->product_per == ''){
echo JText::_('PER_UNIT');
}
else{
echo $this->element->product_per;
}
to the file "product / listing_price"
I still need this change to show on the category listing; goo.gl/4ZFzg
Thank you for your help.
Please Log in or Create an account to join the conversation.
What is the var $this->element->product_per ? a Custom field.
If not, you have to create a custom field with this name.
Please Log in or Create an account to join the conversation.
Xavier wrote: Hi cobinet,
For the product overviews you need:
$this->row->product_per == 'unit'
Code:if($this->element->product_per == 'unit' || $this->row->product_per == 'unit'){ echo JText::_('PER_UNIT'); }
Hi,
Yes I have created the custom field 'product_per' and I used the code from your post above.
Thanks again for your help.
Please Log in or Create an account to join the conversation.
- Posts: 25
- Thank you received: 8
I found this topic to do what I want to do, namely to be able to change the sales unit according to the categories or according to a choice.
but the problem is that this explanation dates from old version of hikashop and no longer goes.
can you tell us how to do the same operation with hikashop verion 4?
I thank you in advance !
Please Log in or Create an account to join the conversation.
The exact code indeed changed but the principle is still valid.
In the file product / listing_price.php
You have that code:
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
and you can still replace it with :
echo $this->element->product_per;
where "product_per" is the column name of the custom product field where you've selected / entered the text to have instead of "per unit".
Please Log in or Create an account to join the conversation.