如何使用BigCommerce api PHP库以编程方式创建新订单时设置订单的送货方式: 以下是我用于创建订单的代码:
$createFields = array(
"customer_id"=>0,
"status_id"=> 1,
"date_created"=> $o_date,
"subtotal_ex_tax"=> strip_tags($xmlObj1->itemsTotal->asXML()),
"subtotal_inc_tax"=> floatval(strip_tags($xmlObj1->itemsTotal->asXML())) + floatval(strip_tags($xmlObj1->dutyTaxesTotal->asXML())),
"base_shipping_cost"=> strip_tags($xmlObj1->shippingTotal->asXML()),
"shipping_cost_ex_tax"=> strip_tags($xmlObj1->shippingTotal->asXML()),
"shipping_cost_inc_tax"=> strip_tags($xmlObj1->shippingTotal->asXML()),
//"base_handling_cost"=> 0,
//"handling_cost_ex_tax"=> 0,
//"handling_cost_inc_tax"=> 0,
//"base_wrapping_cost"=> 0,
//"wrapping_cost_ex_tax"=> 0,
//"wrapping_cost_inc_tax"=> 0,
"total_ex_tax"=> floatval(strip_tags($xmlObj1->grandTotal->asXML())) - floatval(strip_tags($xmlObj1->dutyTaxesTotal->asXML())),
"total_inc_tax"=> strip_tags($xmlObj1->grandTotal->asXML()),
//"refunded_amount"=> 0,
//"order_is_digital"=> false,
"staff_notes"=> strip_tags($xmlObj1->shippingCarrierServiceLevel->asXML()),
//"customer_message"=> "",
//"discount_amount"=> 10,
"billing_address"=> array(
"first_name"=> $billing_name[0],
"last_name"=> $billing_name[1],
"company"=> strip_tags($xmlObj1->company->asXML()),
"street_1"=> strip_tags($xmlObj1->billingAddress1->asXML()),
"street_2"=> strip_tags($xmlObj1->billingAddress2->asXML()),
"city"=> strip_tags($xmlObj1->billingCity->asXML()),
"state"=> strip_tags($xmlObj1->billingState->asXML()),
"zip"=> strip_tags($xmlObj1->billingZip->asXML()),
"country"=> strip_tags($xmlObj1->billingCountryName->asXML()),
"country_iso2"=> strip_tags($xmlObj1->billingCountryCode->asXML()),
"phone"=> strip_tags($xmlObj1->billingPhone->asXML()),
"email"=> strip_tags($xmlObj1->email->asXML())
),
"shipping_addresses"=> array(
array(
"first_name"=> $name[0],
"last_name"=> $name[1],
"company"=> strip_tags($xmlObj1->company->asXML()),
"street_1"=> strip_tags($xmlObj1->address1->asXML()),
"street_2"=> strip_tags($xmlObj1->address2->asXML()),
"city"=> strip_tags($xmlObj1->city->asXML()),
"state"=> strip_tags($xmlObj1->state->asXML()),
"zip"=> strip_tags($xmlObj1->zip->asXML()),
"country"=> strip_tags($xmlObj1->countryName->asXML()),
"country_iso2"=> strip_tags($xmlObj1->countryCode->asXML()),
"phone"=> strip_tags($xmlObj1->phone->asXML()),
"email"=> strip_tags($xmlObj1->email->asXML())
)
),
"products"=> $products,
"external_source"=> "iGlobal",
);
$bc_order_created = Bigcommerce::createOrder($createFields);
是否有一个字段可以设置送货方式,还是应该使用另一个api电话?
答案 0 :(得分:1)
送货方式不是属于订单资源的属性。您希望将其指定为货件的一部分。