私は、製品を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();
であり、これはサーバからの応答で、I`mがやって何
<?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