I need to show small image of product on cart page.Cart info is not giving any information for image of product. So I have tried overriding cart.info method.

My config.xml(/etc/config.xml) is like:

 <?xml version="1.0"?>

My wsdl.xml(/etc/wsdl.xml) is like:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
         name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
        <import namespace="http://schemas.xmlsoap.org/soap/encoding/"
        <complexType name="shoppingCartProductEntity">
                <element name="small_image" type="xsd:string" minOccurs="0"/>


My V2.php file (/namespacename/modulename/Model/Checkout/Cart/Product/Api/V2.php) is like:

class Customsoapcart_Checkoutsoap_Model_Checkout_Cart_Product_Api_V2 extends Mage_Checkout_Model_Cart_Product_Api_V2
* Retrieve full order information
* @param string $orderIncrementId
* @return array

public function items($quoteId, $store = null)
$productsResult = parent::items($quoteId, $store = null);
    return $productsResult;

Now when I call my web service in my script:

 $proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl', array('trace' => 1, 'cache_wsdl' => 0)); // TODO : change url
$sessionId = $proxy->login('username', 'apikey'); // TODO : change login and pwd if necessary

$result = $proxy->shoppingCartInfo($sessionId, '320');
echo '<pre>';print_r($result);

I am not getting extra field image in the result. I think something is wrong with wsdl.xml which I am missing something in wsdl.xml but cant able to figure out it.


I have figured out another way to solve the problem. I have made custom module in rest api for giving cart information.Web service will take quote_id as parameter and it will return cart information in reponse.

For example: My web service request is http://magentohost/api/rest/cartcollection/:cart_id

$cartId = $this->getRequest()->getParam('cart_id');
    $quoteCollection = Mage::getModel('sales/quote_item')->getCollection();
    $quoteCollection->addFieldToFilter('quote_id', $cartId);

Then it will fetch information from sales/quote_item table and return the collection of quote.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.