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

#   error on characteristic override

##

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

Less More

- Posts: 32
- Thank you received: 2
-
-

13 years 8 months ago -  13 years 8 months ago [\#91243](#91243) by [nibel59](/forum/user/13747-nibel59 "View nibel59's Profile")  *[error on characteristic override](/forum/2-general-talk-about-hikashop/78592-error-on-characteristic-override#91243 "Hi All,  I'm trying to produce a characteristic override to show price near the radio button.  I'm not a php expert (and english also :dry: ), but I have already override some view.  On my first step on override I have this error: Notice: Trying to get property of non-object in .../html/hikashop&#95;characteristics.php on line 7  My code, where on &quot;PREZZO&quot; (on line #56) I would like insert the unit price:")* was created by *[nibel59](/forum/user/13747-nibel59 "View nibel59's Profile")*

Hi All,

I'm trying to produce a characteristic override to show price near the radio button.

I'm not a php expert (and english also :dry: ), but I have already override some view.

On my first step on override I have this error:
Notice: Trying to get property of non-object in .../html/hikashop_characteristics.php on line 7

My code,
where on "PREZZO" (on line #56) I would like insert the unit price:
Code:

&lt;?php function hikashop_characteristics_html(&amp;$element,&amp;$params,&amp;$obj) { switch($params-&gt;get('characteristic_display')){ case 'table': if(count($obj-&gt;characteristics)==2){ $html = ''; $firstCharacteristic = reset($obj-&gt;characteristics); $secondCharacteristic = end($obj-&gt;characteristics); $html.= '&lt;table class="hikashop_product_characteristic_chooser"&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;'; if(empty($secondCharacteristic-&gt;values)){ }else{ foreach($secondCharacteristic-&gt;values as $value){ $html.='&lt;td&gt;'.$value-&gt;characteristic_value.'&lt;/td&gt;'; } } $html.='&lt;/tr&gt;'; $obj-&gt;options=' onclick="return hikashopUpdateVariantData(this.value);"'; $size=0; if(!empty($firstCharacteristic-&gt;values)){ foreach($firstCharacteristic-&gt;values as $value){ $html.='&lt;tr&gt;&lt;td style="text-align:right"&gt;'.$value-&gt;characteristic_value.'&lt;/td&gt;'; if(strlen($value-&gt;characteristic_value)&gt;$size)$size=strlen($value-&gt;characteristic_value); if(!empty($secondCharacteristic-&gt;values)){ foreach($secondCharacteristic-&gt;values as $value2){ $class = ''; $classspan = ''; foreach($element-&gt;variants as $k =&gt; $variant){ $char1 = false; $char2 = false; foreach($variant-&gt;characteristics as $variantCharacteristic){ if($variantCharacteristic-&gt;characteristic_id==$value-&gt;characteristic_id){ $char1 = true; }elseif($variantCharacteristic-&gt;characteristic_id==$value2-&gt;characteristic_id){ $char2 = true; } if($char1&amp;&amp;$char2){ if(!$variant-&gt;product_published &#124;&#124; $variant-&gt;product_quantity==0){ $class = ' hikashop_product_variant_out_of_stock'; $classspan=' hikashop_product_variant_out_of_stock_span'; } break 2; } } } $name = '_'.$value-&gt;characteristic_id.'_'.$value2-&gt;characteristic_id; $radio="\n\t&lt;span class=\"hikashop_product_characteristic_span".$classspan."\"&gt;&lt;input type=\"radio\" class=\"hikashop_product_characteristic".$class."\" name=\"hikashop_product_characteristic\" id=\"hikashop_product_characteristic".$name."\" value=\"".$name."\" ".$obj-&gt;options; if($obj-&gt;characteristics[$value-&gt;characteristic_parent_id]-&gt;default-&gt;characteristic_id==$value-&gt;characteristic_id &amp;&amp; !empty($obj-&gt;characteristics[$value2-&gt;characteristic_parent_id]-&gt;default-&gt;characteristic_id) &amp;&amp; $obj-&gt;characteristics[$value2-&gt;characteristic_parent_id]-&gt;default-&gt;characteristic_id==$value2-&gt;characteristic_id){ $radio.=' checked'; } $radio.=" /&gt;&lt;/span&gt;"; $html.='&lt;td&gt;'.$radio.' PREZZO&lt;/td&gt;'; } } $html.='&lt;/tr&gt;'; } } $html.='&lt;/table&gt;'; if($params-&gt;get('characteristic_display_text')){ $space = ''; for($i=0;$i&lt;=$size;$i++){ $space.='&amp;nbsp;&amp;nbsp;'; } $html='&lt;table class="hikashop_product_characteristic_chooser"&gt;&lt;tr&gt;&lt;td&gt;&lt;/td/&gt;&lt;td&gt;'.$space.$secondCharacteristic-&gt;characteristic_value.'&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;'.$firstCharacteristic-&gt;characteristic_value.'&lt;/td&gt;&lt;td&gt;'.$html.'&lt;/td&gt;&lt;/table&gt;'; } break; } default: case 'radio': case 'dropdown': $main_html = '&lt;table class="hikashop_product_characteristics_table"&gt;'; $config =&amp; hikashop_config(); foreach($obj-&gt;characteristics as $characteristic){ $main_html.='&lt;tr&gt;'; $values = array(); if(!empty($characteristic-&gt;values)){ foreach($characteristic-&gt;values as $k =&gt; $value){ if(!$config-&gt;get('show_out_of_stock')){ $hasQuantity = false; foreach($element-&gt;variants as $variant){ foreach($variant-&gt;characteristics as $variantCharacteristic){ if($variantCharacteristic-&gt;characteristic_id==$value-&gt;characteristic_id){ if($variant-&gt;product_quantity != 0 &#124;&#124; $element-&gt;product_id==$variant-&gt;product_id){ $hasQuantity = true; } } } } if(!$hasQuantity) continue; } $values[$k]=$value-&gt;characteristic_value; } } $html=$obj-&gt;display($characteristic-&gt;characteristic_id,@$characteristic-&gt;default-&gt;characteristic_id,$values,$params-&gt;get('characteristic_display')); if($params-&gt;get('characteristic_display_text')){ $html=$characteristic-&gt;characteristic_value.'&lt;/td&gt;&lt;td&gt;'.$html; } $main_html.='&lt;td&gt;'.$html.'&lt;/td&gt;&lt;/tr&gt;'; } $main_html.='&lt;/table&gt;'; $html = $main_html; break; } } ?&gt;

Last edit: 13 years 8 months ago by [nibel59](/forum/user/13747-nibel59 "View nibel59's Profile"). Reason: I tried to change category forum to "how to"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4NTkyLWVycm9yLW9uLWNoYXJhY3RlcmlzdGljLW92ZXJyaWRlP3RtcGw9bWFya2Rvd24=) 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
-
-
-

13 years 8 months ago -  13 years 8 months ago [\#91325](#91325) 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 *[error on characteristic override](/forum/2-general-talk-about-hikashop/78592-error-on-characteristic-override#91325 "Hi All,  I'm trying to produce a characteristic override to show price near the radio button.  I'm not a php expert (and english also :dry: ), but I have already override some view.  On my first step on override I have this error: Notice: Trying to get property of non-object in .../html/hikashop&#95;characteristics.php on line 7  My code, where on &quot;PREZZO&quot; (on line #56) I would like insert the unit price:")*

Hi,

I think that you'll have to add your code through the "show_block_characteristic" or "show_default" file of your product view ("*Hikashop-&gt;Display-&gt;Views*").

Hope this will help you.

Last edit: 13 years 8 months ago by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile").

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

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

Less More

- Posts: 32
- Thank you received: 2
-
-

13 years 8 months ago [\#91464](#91464) by [nibel59](/forum/user/13747-nibel59 "View nibel59's Profile")  Replied by *[nibel59](/forum/user/13747-nibel59 "View nibel59's Profile")* on topic *[error on characteristic override](/forum/2-general-talk-about-hikashop/78592-error-on-characteristic-override#91464 "Hi All,  I'm trying to produce a characteristic override to show price near the radio button.  I'm not a php expert (and english also :dry: ), but I have already override some view.  On my first step on override I have this error: Notice: Trying to get property of non-object in .../html/hikashop&#95;characteristics.php on line 7  My code, where on &quot;PREZZO&quot; (on line #56) I would like insert the unit price:")*

thanks Mohamed,
I'll take a look to those files

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4NTkyLWVycm9yLW9uLWNoYXJhY3RlcmlzdGljLW92ZXJyaWRlP3RtcGw9bWFya2Rvd24=) 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.047 seconds

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