似乎无法使用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;
提前致谢!