Bigcommmere API来创建与影像产品链接 [英] Bigcommmere Api create product with images link
问题描述
我想用的Bigcommerce API中的Bigcommerce商店创建产品。继code正常工作在公元前店创建产品
I want to create product in bigcommerce store using bigcommerce Api. Following code works fine to create product in Bc store
$产品=阵列('名'=>'ABC块','型'=>'物理','价格'=> '19 .99','体重'=> 2.3,类别'=>阵列(26),'可用性'=>'可用','is_visible'=> TRUE));
Bigcommerce_Api :: createProduct($产品);
我如何能够通过图像的URL?我想下面的codeS,但无法创建
How can I pass images url ? I am trying following codes but unable to create
$图像=阵列('IMAGE_FILE'=>'的https://developer.bigcommerce.com/assets/hero-image.png','is_thumbnail'=>false,'sort_order'=>1,'description'=>'');
$image = array('image_file'=>'https://developer.bigcommerce.com/assets/hero-image.png','is_thumbnail'=>false,'sort_order'=>1,'description'=>'');
$产品=阵列('名'=>'ABC块','型'=>'物理','价格'=> '19 .99','体重'=> 2.3,'类'=>阵列( 26),'可用性'=>'可用','is_visible'=>真实的,'图像'=>阵列('IMAGE_FILE'=> $图片));
$product = array('name' => 'ABC Blocks', 'type' => 'physical', 'price' => '19.99', 'weight' => 2.3, 'categories' => array(26), 'availability' => 'available', 'is_visible' => true,'images' => array('image_file' => $image));
Bigcommerce_Api :: createProduct($产品);
Bigcommerce_Api::createProduct($product);
任何帮助将大大pciated !!感谢AP $ P $
Any help will be greatly appreciated!!thanks
推荐答案
下面是一个从API的示例结构有关数据如何主要看图像
Here's an example structure from the api about how primary image data should look.
"primary_image": {
"id": 247,
"zoom_url": "https://cdn.url.path/bcapp/et7xe3pz/products/32/images/247/in_123__14581.1393831046.1280.1280.jpg?c=1",
"thumbnail_url": "https://cdn.url.path/bcapp/et7xe3pz/products/32/images/247/in_123__14581.1393831046.220.290.jpg?c=1",
"standard_url": "https://cdn.url.path/bcapp/et7xe3pz/products/32/images/247/in_123__14581.1393831046.386.513.jpg?c=1",
"tiny_url": "https://cdn.url.path/bcapp/et7xe3pz/products/32/images/247/in_123__14581.1393831046.44.58.jpg?c=1"
}
使用这个弄清楚你的阵列结构。
Use this to figure out your array structure.
这篇关于Bigcommmere API来创建与影像产品链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!