- Posts: 61
- Thank you received: 0
language file change for a specific product
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.13
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : no errors
In the language file "English (en-GB)" the line PER_UNIT=" each" is perfect for all my products except one. I sell a product based on price per square foot, so i want it to say "price per square foot." How would you go about this?
Please Log in or Create an account to join the conversation.
So you will have to edit the view "product / listing_price" and replace:
Then add a translation override like:
www.hikashop.com/support/faq.html#tranPER_SQUARE_FOOT="price per square foot"
Please Log in or Create an account to join the conversation.
testpatiodrape.dependentmedia.com/products-listing
but it did not change for this page:
testpatiodrape.dependentmedia.com/produc...product/127-curtains
Is there another view to change?
Please Log in or Create an account to join the conversation.
if($this->row->product_id == 'XX'){
to:
if($this->row->product_id == 'XX' || $this->element->product_id == 'XX'){
in the code of Xavier
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Then please try with this line instead:
if($this->row->product_id == 'XX' || $this->element->main->product_id == 'XX'){
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
We don't have a donate button but you can send directly to the email address hikari DOT software AT gmail DOT com via PayPal and we'll receive it.
Thanks !
Please Log in or Create an account to join the conversation.
this solution:
So you will have to edit the view "product / listing_price" and replace:
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
By:
if($this->row->product_id == 'XX'){ // Replace XX by the product id
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_SQUARE_FOOT').'</span>';
}else{
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
}
works for this page:
testpatiodrape.dependentmedia.com/products-listing
but it did not change text on this page:
testpatiodrape.dependentmedia.com/produc...product/127-curtains
and now these modifications to make the "per square foot" show on both pages do not work:
if($this->row->product_id == 'XX'){
to:
if($this->row->product_id == 'XX' || $this->element->product_id == 'XX'){
and
if($this->row->product_id == 'XX' || $this->element->main->product_id == 'XX'){
all this did work for about a month. Specifically this one
if($this->row->product_id == 'XX' || $this->element->main->product_id == 'XX'){
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_SQUARE_FOOT').'</span>';
}else{
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
}
now the text following the product price is this message:
Notice: Undefined property: stdClass::$main in /var/www/vhosts/testpatiodrape.dependentmedia.com/httpdocs/templates/rt_chimera/html/com_hikashop/product/listing_price.php on line 170 Notice: Trying to get property of non-object in /var/www/vhosts/testpatiodrape.dependentmedia.com/httpdocs/templates/rt_chimera/html/com_hikashop/product/listing_price.php on line 170 each
Please Log in or Create an account to join the conversation.
Please put "@" before the variables to avoid the warnings.
Like
Regards,
PS : Please use the "code" tag instead of the "quote" one ; it made the code easier to read.
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.