Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Create Cart and add product to cart
 
mahdi68
Jr. Member
 
Total Posts:  4
Joined:  2013-12-07
 

I am trying to create a shopping cart via the API and then add a product to it, but when I get the shopping cart info or when I look into the database the values of price and subtotal are set to zero : ["subtotal"]=> float(0)

My code is as follows:

$proxy = new SoapClient('http://host.com/api/v2_soap/?wsdl'); 
$sessionID $proxy->login('pass''123456');
try{
    $result 
$proxy->shoppingCartCreate($sessionID'1');  
    
$result $proxy->shoppingCartProductAdd($sessionID$result, array(array(
        
'product_id' => '2',
        
'sku' => '001',
        
'qty' => '15',
        
'options' => null,
        
'bundle_option' => null,
        
'bundle_option_qty' => null,
        
'links' => null
    
)));            
catch(SoapFault $e){
   $result 
$e->getMessage();

var_dump
($result);

and use this code to get cart info :

$result $proxy->shoppingCartInfo($sessionID'1634');
When I try to add product to cart on my Magento store website it`s placed true value of field in database but when I try it with my code price and subtotal are zero.

Can any body help me?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mahdi68
Jr. Member
 
Total Posts:  4
Joined:  2013-12-07
 

no one has any idea on this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anatol NEKLO
Member
 
Avatar
Total Posts:  38
Joined:  2011-02-07
NEKLO LLC
 

Did you receive any errors or Exceptions?  And what kind of product did you try to add??
Please analyze this info, probably you didn’t specify any product parameters.

NEKLO LLC

+1-855-380-5958
1001 Bayhill Drive, 2nd Floor, San Bruno, 94066 California, United States of America

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top