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

#   Notice: Trying to get property of non-object

##

- **[Flooder](/forum/user/23280-flooder "View Flooder's Profile")**
- [![Flooder's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar23280.png)](/forum/user/23280-flooder "View Flooder's Profile") Topic Author
- [ Offline](/forum/user/23280-flooder)

Less More

- Posts: 263
- Thank you received: 11
-
-

12 years 5 months ago [\#158471](#158471) by [Flooder](/forum/user/23280-flooder "View Flooder's Profile")  *[Notice: Trying to get property of non-object](/forum/22-market-bug-report/868699-notice-trying-to-get-property-of-non-object#158471 "Hello there,  In my random products module, when i enable joomla debug mode, I get many messages like : Notice: Trying to get property of non-object in /home/lapagept/public&#95;html/pt4/administrator/components/com&#95;hikamarket/classes/discount.php on line 220  One message for each product in the module I believe...  Bye")* was created by *[Flooder](/forum/user/23280-flooder "View Flooder's Profile")*

Hello there,

In my random products module, when i enable joomla debug mode, I get many messages like :
Notice: Trying to get property of non-object in /home/lapagept/public_html/pt4/administrator/components/com_hikamarket/classes/discount.php on line 220

One message for each product in the module I believe...

Bye

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 5 months ago [\#158475](#158475) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Notice: Trying to get property of non-object](/forum/22-market-bug-report/868699-notice-trying-to-get-property-of-non-object#158475 "Hello there,  In my random products module, when i enable joomla debug mode, I get many messages like : Notice: Trying to get property of non-object in /home/lapagept/public&#95;html/pt4/administrator/components/com&#95;hikamarket/classes/discount.php on line 220  One message for each product in the module I believe...  Bye")*

Hi,

Which HikaMarket front-edition version number are you using ?

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[Flooder](/forum/user/23280-flooder "View Flooder's Profile")**
- [![Flooder's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar23280.png)](/forum/user/23280-flooder "View Flooder's Profile") Topic Author
- [ Offline](/forum/user/23280-flooder)

Less More

- Posts: 263
- Thank you received: 11
-
-

12 years 5 months ago [\#158478](#158478) by [Flooder](/forum/user/23280-flooder "View Flooder's Profile")  Replied by *[Flooder](/forum/user/23280-flooder "View Flooder's Profile")* on topic *[Notice: Trying to get property of non-object](/forum/22-market-bug-report/868699-notice-trying-to-get-property-of-non-object#158478 "Hello there,  In my random products module, when i enable joomla debug mode, I get many messages like : Notice: Trying to get property of non-object in /home/lapagept/public&#95;html/pt4/administrator/components/com&#95;hikamarket/classes/discount.php on line 220  One message for each product in the module I believe...  Bye")*

[ lapagept.com](http://lapagept.com)
Hikashop 2.3.1
Joomla 3.3.0
Hikamarket 1.4.0

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 5 months ago [\#158572](#158572) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Notice: Trying to get property of non-object](/forum/22-market-bug-report/868699-notice-trying-to-get-property-of-non-object#158572 "Hello there,  In my random products module, when i enable joomla debug mode, I get many messages like : Notice: Trying to get property of non-object in /home/lapagept/public&#95;html/pt4/administrator/components/com&#95;hikamarket/classes/discount.php on line 220  One message for each product in the module I believe...  Bye")*

Bonjour,

Merci de télécharger HikaMarket 1.4.1, le problème a été corrigé dans cette version.
La mise à jour automatique d'HikaMarket 1.4.1 devrait être activée prochainement.

Cordialement,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [Flooder](/forum/user/23280-flooder "View Flooder's Profile")

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

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile")
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 746
-
- [](http://www.inphase.one)
-

12 years 5 months ago [\#159758](#159758) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[Notice: Trying to get property of non-object](/forum/22-market-bug-report/868699-notice-trying-to-get-property-of-non-object#159758 "Hello there,  In my random products module, when i enable joomla debug mode, I get many messages like : Notice: Trying to get property of non-object in /home/lapagept/public&#95;html/pt4/administrator/components/com&#95;hikamarket/classes/discount.php on line 220  One message for each product in the module I believe...  Bye")*

Hi Jerome,

Found this thread after taking a quick look at my php_error.log, where I have many lines with the same notice - even after I had installed 1.4.1.

At this point I can't tell what triggers it. Any idea what to do?

Thanks!

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 5 months ago [\#159773](#159773) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Notice: Trying to get property of non-object](/forum/22-market-bug-report/868699-notice-trying-to-get-property-of-non-object#159773 "Hello there,  In my random products module, when i enable joomla debug mode, I get many messages like : Notice: Trying to get property of non-object in /home/lapagept/public&#95;html/pt4/administrator/components/com&#95;hikamarket/classes/discount.php on line 220  One message for each product in the module I believe...  Bye")*

Hi,

The problem has been fixed for HikaMarket front-end (where the discounts should not be managed by HikaMarket, there is no vendor filter to apply).
But I could reproduced the problem in my local website, I have some idea of what could happend but I can't reproduce it.

Can you please try this code (which will replace the onSelectDiscount one). Code:

public function onSelectDiscount(&amp;$product, &amp;$discountsSelected, &amp;$discounts, $zone_id, &amp;$parent) { $vendor_id = (int)$product-&gt;product_vendor_id; if($vendor_id == 0 &amp;&amp; !empty($parent)) $vendor_id = (int)$parent-&gt;product_vendor_id; foreach($discountsSelected as &amp;$discountSelected) { $this-&gt;recursiveSelectDiscount($vendor_id, $discountSelected); } unset($discountSelected); } protected function recursiveSelectDiscount($vendor_id, &amp;$discounts) { foreach($discounts as $k =&gt; $v) { if(is_array($v)) { $this-&gt;recursiveSelectDiscount($vendor_id, $discounts[$k]); if(empty($discounts[$k])) unset($discounts[$k]); } else { $discount_target = (int)$v-&gt;discount_target_vendor; if($discount_target &gt; 1 &amp;&amp; $vendor_id != $discount_target) unset($discounts[$k]); if($discount_target == 0 &amp;&amp; $vendor_id &gt; 1) unset($discounts[$k]); } } }

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile")
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 746
-
- [](http://www.inphase.one)
-

12 years 5 months ago [\#159775](#159775) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[Notice: Trying to get property of non-object](/forum/22-market-bug-report/868699-notice-trying-to-get-property-of-non-object#159775 "Hello there,  In my random products module, when i enable joomla debug mode, I get many messages like : Notice: Trying to get property of non-object in /home/lapagept/public&#95;html/pt4/administrator/components/com&#95;hikamarket/classes/discount.php on line 220  One message for each product in the module I believe...  Bye")*

Ok, used your code to replace the "old" onSelectDiscount block, and no more notices.

You might be well aware of it, but BTW, meanwhile I had figured that the notices were written into the log whenever I loaded a product listing page with discounted products - one line of notice for each discounted product.

Guess I'll leave the new code in... ![;)](/media/kunena/emoticons/24.png ";)")

Merci!

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

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

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

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

Time to create page: 0.078 seconds

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