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错误。 –