无法通过API创建产品变体

时间:2013-05-05 03:41:44

标签: api product shopify variant

似乎无法使用shopify api创建新的产品变体。

这是我的代码:

global  $shopifyClient;

$config['shopify_api_product_price'] = "/admin/products/128671451/variants.json";  

$variant = array 
( 
    'variant' => array ('price' => '3.00', 'option1' => 'test')
); 

if( $shopifyClient == null )
    return;

try{
    $postVariant = $shopifyClient->call('POST', $config['shopify_api_product_price'], $variant);

    return $postVariant;

}catch( ShopifyApiException $e ){
    $e->getMessage();
}
return false;   

提前致谢!

0 个答案:

没有答案