[Skip to main content](#vessel-content)

#   Price per Unit /Diferent Units

##

- **[slipperyman](/forum/user/30097-slipperyman "View slipperyman's Profile")**
- [![slipperyman's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30097-slipperyman "View slipperyman's Profile") Topic Author
- [ Offline](/forum/user/30097-slipperyman)

Less More

- Posts: 4
- Thank you received: 0
-
-

12 years 10 months ago [\#135835](#135835) by [slipperyman](/forum/user/30097-slipperyman "View slipperyman's Profile")  *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#135835 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")* was created by *[slipperyman](/forum/user/30097-slipperyman "View slipperyman's Profile")*

Hi, I'm starting a project on a pasta shop...
So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E.
Ravioli are sold by Sheet
Caneloni by unit
Spaguetti by weight
Cheese by weight..
Cakes by slice or the whole cake....

So not all of them are a case of "Give me one of that"...
What's the right way to handle this on HikaShop?
Thanks in advance...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 10 months ago [\#135862](#135862) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#135862 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

Hi,
Hikashop products are sold by quantity, but note that you'll probably be able to do what you want by using characteristics like weights/Slice.. so that your customers can select what type of product they want and select a quantity.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[slipperyman](/forum/user/30097-slipperyman "View slipperyman's Profile")**
- [![slipperyman's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30097-slipperyman "View slipperyman's Profile") Topic Author
- [ Offline](/forum/user/30097-slipperyman)

Less More

- Posts: 4
- Thank you received: 0
-
-

12 years 10 months ago [\#135916](#135916) by [slipperyman](/forum/user/30097-slipperyman "View slipperyman's Profile")  Replied by *[slipperyman](/forum/user/30097-slipperyman "View slipperyman's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#135916 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

I guess that with products sold by weight like cheese, where we have packs of 50 /100/150gr can work with variations, but

but How would you handle something like 1,5 kg of noodles?
How would you show to users that the price of caneloni is by unit and Ravioli by sheet insteas of the plain by unit... cause the translation does not handle those variations....

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[slipperyman](/forum/user/30097-slipperyman "View slipperyman's Profile")**
- [![slipperyman's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30097-slipperyman "View slipperyman's Profile") Topic Author
- [ Offline](/forum/user/30097-slipperyman)

Less More

- Posts: 4
- Thank you received: 0
-
-

12 years 10 months ago [\#135917](#135917) by [slipperyman](/forum/user/30097-slipperyman "View slipperyman's Profile")  Replied by *[slipperyman](/forum/user/30097-slipperyman "View slipperyman's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#135917 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

As a quick thought I think that I could handle 1,5 Kg as 1500 grams but it's absolutely not user friendlym besides the problems it would bring with prices, since the value is by Kg... 1kg= $xx,xx

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

12 years 10 months ago [\#135967](#135967) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#135967 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

Hi,

This is explained in our FAQ:
[ www.hikashop.com/support/documentation/106-faq.html#tran](http://www.hikashop.com/support/documentation/106-faq.html#tran)
under the question: 'I sell packed products, how can I change "each" text in the product page ?'

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")**
- [![teamtmedia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar39167.png)](/forum/user/39167-teamtmedia "View teamtmedia's Profile")
- [ Offline](/forum/user/39167-teamtmedia)

Less More

- Posts: 38
- Thank you received: 0
-
-
-
-

11 years 1 week ago [\#217891](#217891) by [teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")  Replied by *[teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#217891 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

Thank you for your concise documentation on the basic process. However when attempting to apply this method to "cheapest price" or "price range" my php is letting me down and I am getting an
Code:

Undefined property: stdClass::$salemethod in .....\html\com_hikashop\product\listing_price.php

for my (rather poorly hacked) code of
Code:

if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $this-&gt;params-&gt;get('per_unit',1)){ if($price-&gt;price_min_quantity&gt;1){ echo '&lt;span class="hikashop_product_price_per_unit_x"&gt;'.JText::_($this-&gt;element-&gt;salemethod).' '.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity).'&lt;/span&gt;'; }else{ if(isset($this-&gt;element-&gt;main)) echo JText::_($this-&gt;element-&gt;main-&gt;salemethod); elseif(isset($this-&gt;row)) echo JText::_($this-&gt;row-&gt;salemethod); else echo JText::_($this-&gt;element-&gt;salemethod); } }

Obviously I do not have the isset statement but this is where I could spend an hour hacking that or just ask nicely. I think the latter is more appealing on a set priced project ![;)](/media/kunena/emoticons/11.png ";)")

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

11 years 1 week ago [\#217929](#217929) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#217929 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

Hi,

If you don't have $this-&gt;element-&gt;salemethod or $this-&gt;element-&gt;main-&gt;salemethod or $this-&gt;row-&gt;salemethod
It means that you didn't create a custom field with the column name "salemethod" via the menu Display&gt;Custom fields
Could you check on that ?
Could you do a screenshot of the settings of your custom field ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")**
- [![teamtmedia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar39167.png)](/forum/user/39167-teamtmedia "View teamtmedia's Profile")
- [ Offline](/forum/user/39167-teamtmedia)

Less More

- Posts: 38
- Thank you received: 0
-
-
-
-

11 years 1 week ago [\#217953](#217953) by [teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")  Replied by *[teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#217953 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

Here's the image as requested. As you can see I have followed your documentation. The thing is that it is working on the price per unit but when I request a range (i.e. the first if statement) it doesn't have the isset. My php is a little behind on the correct creation of this.
[ ![FireShot&#95;Screen&#95;Capture&#95;370&#95;-&#95;Administration&#95;-&#95;Field&#95;&#95;&#95;salemethod&#95;-&#95;localhost&#95;sydney&#95;administrator&#95;index&#95;php&#95;optioncom&#95;hikashopctrlfieldtaskeditcid17.jpg](/forum/attachment/27163) ](/forum/attachment/27163 "...keditcid17.jpg")

- [ ![FireShot&#95;Screen&#95;Capture&#95;370&#95;-&#95;Administration&#95;-&#95;Field&#95;&#95;&#95;salemethod&#95;-&#95;localhost&#95;sydney&#95;administrator&#95;index&#95;php&#95;optioncom&#95;hikashopctrlfieldtaskeditcid17.jpg](/forum/attachment/27163) ](/forum/attachment/27163 "...keditcid17.jpg") [ ](/forum/attachment/27163?download=1 "...keditcid17.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

11 years 1 week ago [\#217967](#217967) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#217967 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

Hi,

What is the exact error message ?
And what is the full code of the listing_price view file ?
(so that we know the exact line of the error)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")**
- [![teamtmedia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar39167.png)](/forum/user/39167-teamtmedia "View teamtmedia's Profile")
- [ Offline](/forum/user/39167-teamtmedia)

Less More

- Posts: 38
- Thank you received: 0
-
-
-
-

11 years 1 week ago -  11 years 1 week ago [\#218012](#218012) by [teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")  Replied by *[teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#218012 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

OK. Detailed.

I have, as you can see, copied your documentation to the point HOWEVER I would like to use the "per unit" values in the "price range" or "all" options. With the following "listing_price.php"
Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 2.6.0 * @author hikashop.com * @copyright (C) 2010-2015 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php $class =''; if(!empty($this-&gt;row-&gt;prices) &amp;&amp; count($this-&gt;row-&gt;prices)&gt;1){ $class = ' hikashop_product_several_prices'; } if(isset($this-&gt;element-&gt;main-&gt;product_msrp) &amp;&amp; !(@$this-&gt;row-&gt;product_msrp &gt; 0.0) ) $this-&gt;row-&gt;product_msrp = $this-&gt;element-&gt;main-&gt;product_msrp; if(isset($this-&gt;row-&gt;product_msrp) &amp;&amp; @$this-&gt;row-&gt;product_msrp &gt; 0.0 &amp;&amp; JRequest::getCmd('layout') == 'show' &amp;&amp; $this-&gt;params-&gt;get('from_module','') == ''){ ?&gt; &lt;span class="hikashop_product_msrp_price hikashop_product_price_full"&gt; &lt;span class="hikashop_product_msrp_price_title"&gt; &lt;?php echo JText::_('PRODUCT_MSRP_BEFORE'); ?&gt; &lt;/span&gt; &lt;span class="hikashop_product_price"&gt; &lt;?php $mainCurr = $this-&gt;currencyHelper-&gt;mainCurrency(); $app = JFactory::getApplication(); $currCurrency = $app-&gt;getUserState( HIKASHOP_COMPONENT.'.currency_id', $mainCurr ); $msrpCurrencied = $this-&gt;currencyHelper-&gt;convertUniquePrice($this-&gt;row-&gt;product_msrp,$mainCurr,$currCurrency); if($msrpCurrencied == $this-&gt;row-&gt;product_msrp) echo $this-&gt;currencyHelper-&gt;format($this-&gt;row-&gt;product_msrp,$mainCurr); else echo $this-&gt;currencyHelper-&gt;format($msrpCurrencied,$currCurrency).' ('.$this-&gt;currencyHelper-&gt;format($this-&gt;row-&gt;product_msrp,$mainCurr).')'; ?&gt; &lt;/span&gt; &lt;/span&gt; &lt;?php } ?&gt; &lt;span class="hikashop_product_price_full&lt;?php echo $class; ?&gt;"&gt; &lt;?php if(empty($this-&gt;row-&gt;prices)){ echo JText::_('FREE_PRICE'); }else{ $first = true; echo JText::_('PRICE_BEGINNING'); $i=0; if(isset($this-&gt;row-&gt;product_msrp) &amp;&amp; @$this-&gt;row-&gt;product_msrp &gt; 0.0 &amp;&amp; JRequest::getCmd('layout') == 'show' &amp;&amp; $this-&gt;params-&gt;get('from_module','') == ''){ echo '&lt;span class="hikashop_product_our_price_title"&gt;'.JText::_('PRODUCT_MSRP_AFTER').'&lt;/span&gt; '; } $config =&amp; hikashop_config(); if($this-&gt;params-&gt;get('price_with_tax',3)==3){ $this-&gt;params-&gt;set('price_with_tax',$config-&gt;get('price_with_tax')); } if($this-&gt;params-&gt;get('show_discount',3)==3){ $this-&gt;params-&gt;set('show_discount',$config-&gt;get('show_discount')); } if($this-&gt;params-&gt;get('show_original_price','-1')=='-1'){ $this-&gt;params-&gt;set('show_original_price',$config-&gt;get('show_original_price')); } if($this-&gt;params-&gt;get('show_original_price','-1')=='-1'){ $this-&gt;params-&gt;set('show_original_price',$config-&gt;get('show_original_price')); } foreach($this-&gt;row-&gt;prices as $k =&gt; $price){ if($first)$first=false; else echo JText::_('PRICE_SEPARATOR'); if(!empty($this-&gt;unit) &amp;&amp; isset($price-&gt;unit_price)){ $price =&amp; $price-&gt;unit_price; } $start = JText::_('PRICE_BEGINNING_'.$i); if($start!='PRICE_BEGINNING_'.$i){ echo $start; } if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $price-&gt;price_min_quantity&gt;1){ echo '&lt;span class="hikashop_product_price_with_min_qty hikashop_product_price_for_at_least_'.$price-&gt;price_min_quantity.'"&gt;'; } $classes = array('hikashop_product_price hikashop_product_price_'.$i); if(!empty($this-&gt;row-&gt;discount)){ $classes[]='hikashop_product_price_with_discount'; } if(!empty($this-&gt;row-&gt;discount)){ if($this-&gt;params-&gt;get('show_discount')==1){ echo '&lt;span class="hikashop_product_discount"&gt;'.JText::_('PRICE_DISCOUNT_START'); if(bccomp($this-&gt;row-&gt;discount-&gt;discount_flat_amount,0,5)!==0){ echo $this-&gt;currencyHelper-&gt;format(-1*$this-&gt;row-&gt;discount-&gt;discount_flat_amount,$price-&gt;price_currency_id); }elseif(bccomp($this-&gt;row-&gt;discount-&gt;discount_percent_amount,0,5)!==0){ echo -1*$this-&gt;row-&gt;discount-&gt;discount_percent_amount.'%'; } echo JText::_('PRICE_DISCOUNT_END').'&lt;/span&gt;'; }elseif($this-&gt;params-&gt;get('show_discount')==2){ echo '&lt;span class="hikashop_product_price_before_discount"&gt;'.JText::_('PRICE_DISCOUNT_START'); if($this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_value_without_discount_with_tax,$price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax')==2&#124;&#124;!$this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_value_without_discount,$price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value_without_discount_with_tax)){ echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_without_discount_with_tax,$price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax')==2&#124;&#124;!$this-&gt;params-&gt;get('price_with_tax') &amp;&amp; !empty($price-&gt;price_orig_value_without_discount)){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_without_discount,$price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo JText::_('PRICE_DISCOUNT_END').'&lt;/span&gt;'; }elseif($this-&gt;params-&gt;get('show_discount')==3){ } } echo '&lt;span class="'.implode(' ',$classes).'"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value_with_tax,$price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax')==2&#124;&#124;!$this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value,$price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value)){ echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_with_tax,$price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax')==2&#124;&#124;!$this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value,$price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '&lt;/span&gt; '; -----------------THIS SECTION------------------------ if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $this-&gt;params-&gt;get('per_unit',1)){ if($price-&gt;price_min_quantity&gt;1){ echo '&lt;span class="hikashop_product_price_per_unit_x"&gt;'.JText::_($this-&gt;element-&gt;salemethod).' '.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity).'&lt;/span&gt;'; }else{ if(isset($this-&gt;element-&gt;main)) echo JText::_($this-&gt;element-&gt;main-&gt;salemethod); elseif(isset($this-&gt;row)) echo JText::_($this-&gt;row-&gt;salemethod); else echo JText::_($this-&gt;element-&gt;salemethod); } } -----------------END SECTION------------------------ if($this-&gt;params-&gt;get('show_price_weight')){ if(!empty($this-&gt;element-&gt;product_id) &amp;&amp; isset($this-&gt;row-&gt;product_weight) &amp;&amp; bccomp($this-&gt;row-&gt;product_weight,0,3)){ echo JText::_('PRICE_SEPARATOR').'&lt;span class="hikashop_product_price_per_weight_unit"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')){ $weight_price = $price-&gt;price_value_with_tax / $this-&gt;row-&gt;product_weight; echo $this-&gt;currencyHelper-&gt;format($weight_price,$price-&gt;price_currency_id).' / '.JText::_($this-&gt;row-&gt;product_weight_unit); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax')==2&#124;&#124;!$this-&gt;params-&gt;get('price_with_tax')){ $weight_price = $price-&gt;price_value / $this-&gt;row-&gt;product_weight; echo $this-&gt;currencyHelper-&gt;format($weight_price,$price-&gt;price_currency_id).' / '.JText::_($this-&gt;row-&gt;product_weight_unit); } if($this-&gt;params-&gt;get('price_with_tax')==2){ echo JText::_('PRICE_AFTER_TAX'); } echo '&lt;/span&gt;'; } } if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $price-&gt;price_min_quantity&gt;1){ echo '&lt;/span&gt;'; } $end = JText::_('PRICE_ENDING_'.$i); if($end!='PRICE_ENDING_'.$i){ echo $end; } $i++; } echo JText::_('PRICE_END'); } ?&gt;&lt;/span&gt;

I have highlighted the adjusted code. As you can see I have placed
Code:

.JText::_($this-&gt;element-&gt;salemethod)

into the 1st if statement which generates the "price range" and "all" text. Sadly I haven't been able to define the value in this if statement.

The error I am getting is consistent with this.
Code:

&lt;b&gt;Notice&lt;/b&gt; : Undefined property: stdClass::$salemethod in &lt;b&gt;D:\xampp\htdocs\sydney\templates\"sitename removed for client confidentiality on a public forum"\html\com_hikashop\product\listing_price.php&lt;/b&gt; on line &lt;b&gt;162&lt;/b&gt;

Last edit: 11 years 1 week ago by [teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile"). Reason: Making section of faulty code clearer

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

11 years 6 days ago [\#218064](#218064) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#218064 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

Hi,

On the line 162 of your code, I only have that code:

---

THIS SECTION

---

So I still don't know what exact line is that error on.
Also, on which page that that error happen ? Could you give a link to it ?
Did you try with $this-&gt;row-&gt;salemethod instead of $this-&gt;element-&gt;salemethod ? Do you still get the error if you do ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")**
- [![teamtmedia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar39167.png)](/forum/user/39167-teamtmedia "View teamtmedia's Profile")
- [ Offline](/forum/user/39167-teamtmedia)

Less More

- Posts: 38
- Thank you received: 0
-
-
-
-

11 years 3 days ago [\#218419](#218419) by [teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")  Replied by *[teamtmedia](/forum/user/39167-teamtmedia "View teamtmedia's Profile")* on topic *[Price per Unit /Diferent Units](/forum/26-product-category-display/864207-price-per-unit-diferent-units#218419 "Hi, I'm starting a project on a pasta shop... So we have different products sold by different units... How do we show that unit and explain that the price is by that unit... I.E. Ravioli are sold by Sheet Caneloni by unit Spaguetti by weight Cheese by weight.. Cakes by slice or the whole cake....  So not all of them are a case of &quot;Give me one of that&quot;... What's the right way to handle this on HikaShop? Thanks in advance...")*

How simple was that?!

So the complete, working code, is
Code:

if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $this-&gt;params-&gt;get('per_unit',1)){ if($price-&gt;price_min_quantity&gt;1){ echo '&lt;span class="hikashop_product_price_per_unit_x"&gt;'.JText::_($this-&gt;row-&gt;salemethod).' '.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity).'&lt;/span&gt;'; }else{ if(isset($this-&gt;element-&gt;main)) echo JText::_($this-&gt;element-&gt;main-&gt;salemethod); elseif(isset($this-&gt;row)) echo JText::_($this-&gt;row-&gt;salemethod); else echo JText::_($this-&gt;element-&gt;salemethod); } }

for future reference

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjQyMDctcHJpY2UtcGVyLXVuaXQtZGlmZXJlbnQtdW5pdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.107 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
