0
以下代碼成功創建訂單。 ID爲「3889」的商品有三種尺寸:「7」,「8」,「9」。 但是這個項目添加到一個訂單沒有傳遞的大小「7」。 只在未指定結果大小。 Bigcommerce沒有錯誤。Bigcommerce API PHP使用選項創建訂單
問題:如何通過規模爲產品的順序?
<?php
require 'C:\wamp64\www\bigcommerceDemo\vendor\autoload.php';
require 'C:\wamp64\www\bigcommerceDemo\bg_api_connection\scripting.php';
use Bigcommerce\Api\Client as Bigcommerce;
Bigcommerce::verifyPeer(false);
$first_name = "example";
$last_name = "example";
$company = "";
$street_1 = "example";
$street_2 = "";
$city = "example";
$state = "example";
$zip = "example";
$country = "United States";
$country_iso2 = "";
$phone = "example";
$email = "example";
$object = array(
"customer_id" => "12610",
"status_id" => "7",
"date_created" => "Mon, 11 Sep 2017 19:26:23 +0000",
"billing_address" => array(
"first_name" => $first_name,
"last_name" => $last_name,
"company" => $company,
"street_1" => $street_1,
"street_2" => $street_2,
"city" => $city,
"state" => $state,
"zip" => $zip,
"country" => $country,
"phone" => $phone,
"email" => $email),
"products" => array(
0 => array(
"product_id" => 3889,
"quantity" => 1,
"product_options" => array(
0 => array(
"id" => 1267,
"value" => 7
)
)
),
1 => array(
"product_id" => 15805,
"quantity" => 1,
)
)
);
你確定你有正確的'ID產品選擇的價值? – ProEvilz
@ProEvilz它是這樣做的:我使用管理面板手動添加了ID爲「3889」的項目。然後我從這個訂單請求產品選項信息。而我得到了陣列的所有ID:[ID] => 7178 [option_id] => 1240 [order_product_id] => 9939 [product_option_id] => 1267 [DISPLAY_NAME] =>大小 [DISPLAY_VALUE] =>銀 [價值] => 7. 我試過其他的ID。有BG錯誤。 –