shopware - 创建订单时如何更新商店软件的自由文本字段中的值
问题描述
我正在使用 1 个第三方 API 将订单导入我的购物软件,并且正在使用以下方法。
$client_shopware->post('orders', ["customerId" => $customer_id,
"paymentId" => $paymentId,
"dispatchId" => $dispatchId,
"partnerId" => "",
"shopId" => $shopId,
"invoiceAmount" => 0,
"invoiceAmountNet" => 0,
"invoiceShipping" => 0,
"invoiceShippingNet" => 0,
"orderTime" => $order_time,
"net" => $TotalOrderAmount,
"taxFree" => 0,
"languageIso" => "1",
"currency" => "EUR",
"currencyFactor" => 1,
"referer" => "Channel advisor",
"remoteAddress" => "155.155.155.155",
"details" => $JsonArray,
"documents" => $documents,
"billing" => $billing,
"shipping" => $shipping,
"paymentStatusId" => $paymentStatusId,
"orderStatusId" => $orderStatusId,
]);
但我担心的是,在创建订单后,我想为该订单更新“自由文本字段”的值。那么有人可以帮我解决这个问题吗?</p>
解决方案
我将有关相同的问题发布到支持论坛,并得到如下答复:
'attribute' => ['attribute1' => 'some value']
您需要一个关键属性,它是一个包含属性数据的数组。所以我以下面的方式使用它,它起作用了。
$client_shopware->post('orders', [
"customerId" => $customer_id,
"paymentId" => $paymentId,
"dispatchId" => $dispatchId,
"partnerId" => "",
"shopId" => $shopId,
"invoiceAmount" => 0,
"invoiceAmountNet" => 0,
"invoiceShipping" => 0,
"invoiceShippingNet" => 0,
"orderTime" => $order_time,
"net" => $TotalOrderAmount,
"taxFree" => 0,
"languageIso" => "1",
"currency" => "EUR",
"currencyFactor" => 1,
"referer" => "Channel advisor",
"remoteAddress" => "155.155.155.155",
"orders.attributes.attribute1" => "test",
"details" => $JsonArray,
"documents" => $documents,
"billing" => $billing,
"shipping" => $shipping,
"paymentStatusId" => $paymentStatusId,
"orderStatusId" => $orderStatusId,
'attribute' => [
'attribute1' => '12345test',
],
]);
推荐阅读
- python - 为什么随机生成器不起作用?Python
- ruby-on-rails - 如何使 activerecord-import 使用序列
- javascript - 在jQuery中通过width()输出错误的div宽度
- c# - Xamarin 表单:如何在列表视图中搜索
- javascript - InvalidSessionDescriptionError:答案更改中间级别,为“3”,现在为“0”
- reactjs - ReactJS 预加载导航元素
- php - 致命错误:未捕获的错误:调用成员函数 close() on
- java - 连接到 WiFi 时检查互联网连接
- yadcf - 过滤器字段在表格重绘时重置
- python - 如何从python列表中任何特定索引处的句子中提取特定字符串?