Thursday, 15 April 2010

php - Error: "Call to member function on a non-object..." in Magento -



php - Error: "Call to member function on a non-object..." in Magento -

when place next code @ bottom of new_grid.phtml template file, works fine, without whatever errors. when placed @ top of file, fatal error: "call fellow member function getrelatedlinkcollection() on non-object in c:\wamp\www\mysite\magento\app\design\frontend\mysite\default\template\catalog\product\widget\new\content\new_grid.phtml on line 32.

<?php foreach ($_product->getrelatedlinkcollection() $link) { $dats= $link->getlinkedproductid(); } ?>

i code working @ top of file, because i'd output generated html in particular structure. thought why i'm getting error , can right it?

thank you!

can post contents of new_grid.phtml file?

otherwise, create sure foreach loop after line contains $_product =

php magento

No comments:

Post a Comment