- Posts: 25
- Thank you received: 8
change per unit into per set, per length, per reel
Less
More
6 years 2 months ago #323412
by gabriel.robert
Replied by gabriel.robert on topic change per unit into per set, per length, per reel
thank you very much, it's great it works perfectly!
Please Log in or Create an account to join the conversation.
3 years 11 months ago #346703
by Mea Arte
Replied by Mea Arte on topic change per unit into per set, per length, per reel
Nicolas,
Although this item is quite older, it still is applicable.
I am trying to do this and to get things going I used the exact directions you gave. But I still get the same result:
Warning: Undefined property: stdClass::$product_per in /Users/reijervangalen/Sites/localhost/mea-arte.nl/templates/cassiopeia/html/com_hikashop/product/listing_price.php on line 196
I did make the field and the column exists in the table hikashop_product.
My piece of code:
if($this->element->product_per == 'unit'|| $this->row->product_per == 'unit'){
echo $this->element->product_per;
}
What is wrong here?
And can I use an selection list as field in which I can select per product what unit it goes in?
It is not on line yet, because I am building on localhost, sorry.
Thanks in advance.
Although this item is quite older, it still is applicable.
I am trying to do this and to get things going I used the exact directions you gave. But I still get the same result:
Warning: Undefined property: stdClass::$product_per in /Users/reijervangalen/Sites/localhost/mea-arte.nl/templates/cassiopeia/html/com_hikashop/product/listing_price.php on line 196
I did make the field and the column exists in the table hikashop_product.
My piece of code:
if($this->element->product_per == 'unit'|| $this->row->product_per == 'unit'){
echo $this->element->product_per;
}
What is wrong here?
And can I use an selection list as field in which I can select per product what unit it goes in?
It is not on line yet, because I am building on localhost, sorry.
Thanks in advance.
Please Log in or Create an account to join the conversation.
3 years 11 months ago #346851
by nicolas
Replied by nicolas on topic change per unit into per set, per length, per reel
Hi,
The issue is several folds.
The code should be like this:
That should work on the product details page as well as on the listings while still displaying the default "per unit" when nothing is selected in the custom product field in the product, without any error message.
The issue is several folds.
The code should be like this:
Code:
if(!empty($this->element->product_per)) {
echo $this->element->product_per;
}elseif(!empty($this->row->product_per)) {
echo $this->row->product_per;
} else {
echo JText::_('PER_UNIT');
}
Please Log in or Create an account to join the conversation.
3 years 11 months ago #346927
by Mea Arte
Replied by Mea Arte on topic change per unit into per set, per length, per reel
Thanks, Nicolas.
This was indeed the trick.
Now I can, when needed, add an extra selling unit in a dropdown custom field for any product and show this on the front end.
This was indeed the trick.
Now I can, when needed, add an extra selling unit in a dropdown custom field for any product and show this on the front end.
Please Log in or Create an account to join the conversation.
Time to create page: 0.062 seconds