magento web service filter product list error Call to a member function getBackend() on a non-object

Using visual studio 2010 service reference to consume magento soap v2 api web service.

php 5.3.8, magento 1.6 install on windows 7 iis 7.5

I can log in and list all the product, but as soon as i put a filter there is an exception

Call to a member function getBackend() on a non-object

php error log:

PHP Fatal error: Call to a member function getBackend() on a non-object in C:\inetpub\wwwroot\Magento1620\app\code\core\Mage\Eav\Model\Entity\Abstract.php on line 816

the solution is to modify this file, change line 57-62

\app\code\core\Mage\Catalog\Model\Product\Api\V2.php

from

foreach ($filters->complex_filter as $_filter) {            	
                $_value = $_filter->value;
                $preparedFilters[$_filter->key] = array(
                    $_value->key => $_value->value
                );
            }

to

foreach ($filters->complex_filter as $_field => $_filter) {
            	$preparedFilters[$_field] = array(
            			$_filter->key => $_filter->value
            	);
            }
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s