Bigcommmere Api creates a product with a link to an image

I want to create a product in a bigcommerce store using bigcommerce Api. The following code works great for creating a product in the Bc store

$product = array('name' => 'ABC Blocks', 'type' => 'physical', 'price' => '19.99', 'weight' => 2.3, 'categories' => array(26), 'availability' => 'available', 'is_visible' => true)); Bigcommerce_Api::createProduct($product);

How can I pass the url of the images? I am trying to execute the following codes but cannot create

$image = array('image_file'=>'https://developer.bigcommerce.com/assets/hero-image.png','is_thumbnail'=>false,'sort_order'=>1,'description'=>'');

$ 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 ($ product);

Any help would be greatly appreciated !! thanks

+4
1

api , .

"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"
    }

, .

+1

Source: https://habr.com/ru/post/1524814/


All Articles