我创建了一个小脚本来将产品添加到prestashop商店。 现在我面临一个问题 - 试图将组合添加到产品中。 这是我的代码现在的样子。 后,我在这里补充该产品是我真的做什么,$ PRODUCT_ID是我的新创建的产品Prestashop添加产品组合
$xml = $webService->get(array('url' => SITE_URL.'/api/combinations?schema=blank'));
$combinations = $xml->children()->children();
$combinations->id_product = $product_id;
$combinations->minimal_quantity = 1;
$combinations->reference = 'dada';
$combinations->price = 99;
$combinations->default_on = 1;
$combinations->associations->product_option_values->product_option_value->id = 1;
$opt = array('resource' => 'products');
$opt['postXml'] = $xml->asXML();
,这是来自服务器的响应..
<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<combination>
<id></id>
<id_product></id_product>
<location></location>
<ean13></ean13>
<upc></upc>
<quantity></quantity>
<reference></reference>
<supplier_reference></supplier_reference>
<wholesale_price></wholesale_price>
<price></price>
<ecotax></ecotax>
<weight></weight>
<unit_price_impact></unit_price_impact>
<minimal_quantity></minimal_quantity>
<default_on></default_on>
<available_date></available_date>
<associations>
<product_option_values>
<product_option_value>
<id></id>
</product_option_value>
</product_option_values>
<images>
<image>
<id></id>
</image>
</images>
</associations>
</combination>
</prestashop>
你能解释一下这个问题吗?你能给我们发送错误信息吗? –
没有错误消息。 – nikksan