我尝试使用bigcommerce api创建产品规则,但是我收到错误:
" array(1){[0] => object(stdClass)#1352(2){[" status"] => int(400)[" message"] =>字符串(55)"字段'调整器'此资源不支持。" "
这是我的代码:
$adjustor = new stdClass() ;
$adjustor->adjustor="absolute";
$adjustor->adjustor_value=14.25;
$rule = array(
"sort_order" => 0,
"is_enabled" => true,
"is_stop" => false,
"price_adjuster" => $adjustor,
"weight_adjuster" => null,
"is_purchasing_disabled" => false,
"purchasing_disabled_message" => "",
"is_purchasing_hidden" => false,
'conditions' => array($x, $y)
);
$result = Bigcommerce::createProductRule($productId, $rule);
echo '<pre>';
var_dump($result);
echo '</pre>';
if (!$result) {
$error = Bigcommerce::getLastError();
var_dump($error);
}
答案 0 :(得分:0)
这看起来像是一个错字。您拼写adjustor
而不是adjuster
。
应该是:
$adjustor->adjuster="absolute";
$adjustor->adjuster_value=14.25;