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

Is there a way to set group price when creating a product with the SOAP v2 API? 
 
wsijordy
Jr. Member
 
Total Posts:  3
Joined:  2012-11-21
 

I’m trying to import products using the SOAP v2 API, which includes group pricing and custom attributes. I can figure out how to format the attributes in v2, but not the group pricing. Vise versa in v1. Anybody know how these arrays should be formatted to work with either version of the API? Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
wsijordy
Jr. Member
 
Total Posts:  3
Joined:  2012-11-21
 

Update: I was never able to set group pricing in v2 of the API. However, v1 does support group pricing, so I just split the product import into multiple steps, using v1 of the API to set group price, and using v2 to set the attributes.

After importing the product using v2 of the API, I update it, after reconnecting using v1. It looked something like this…

$group_price = array(
   array(
'website_id' => 0'cust_group' => 2'price' => number_format($row['PriceA']2)),
   array(
'website_id' => 0'cust_group' => 3'price' => number_format($row['PriceB']2)),
   array(
'website_id' => 0'cust_group' => 4'price' => number_format($row['PriceC']2)),
   array(
'website_id' => 0'cust_group' => 5'price' => number_format($row['PriceD']2))
);

$proxy->call($sessionId'catalog_product.update', array(
      
$row['sku'],
      array(
         
'price' => number_format($row['BasePrice']2),
         
'group_price' => $group_price
      
)
   )
);
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top