实际上,我正在尝试使用products将产品导入到我的volusion商店,产品是成功地插入和更新的,但是在类别和图像方面存在问题。没有插入图像和类别。
当我打开我的管理,类别和图像是不分配的。直到我手动分配,然后它显示在前端。
任何人都知道请帮帮我。我的代码如下..。
<?xml version="1.0" encoding="utf-8"?>
<product>
<productcode>960BX2SSD1</productcode>
<upc_code>649528774156</upc_code>
<productmanufacturer>Crucial</productmanufacturer>
<category>SATA3</category>
<categorytree></categorytree>
<productprice>259</productprice>
<stockstatus>Y</stockstatus>
<productweight>0.25</productweight>
<length>0</length>
<width>0</width>
<height>0</height>
<photo_alttext>960BX2SSD1.JPG</photo_alttext>
<photourl>http://www.malabs.com/i/960BX2SSD1.JPG</photourl>
<productdescription><p><b>SpecificationS</b></p><ul><li><strong>Mfr Part Number:</strong> CT960BX200SSD1</li><li><strong>Capacity:</strong> 960 GB</li><li><strong>Form Factor:</strong>;</productdescription>
</product>
<?php
$file = file_get_contents('dataPro.txt', true);
// Create the Xml to POST to the Webservice
$Xml_to_Send = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
$Xml_to_Send .= "<Volusion_API>";
// $Xml_to_Send .= "<!--";
$Xml_to_Send .= $file;
// $Xml_to_Send .= "\"\"";
// $Xml_to_Send .= "-->";
$Xml_to_Send .= "</Volusion_API>";
$url = "http://xxxxxxxxxxxxx/net/WebService.aspx?Login=xxxxxxxxxxxxx&EncryptedPassword=xxxxxxxxxxx&Import=Insert-Update";
// Create the Header
// Post and Return Xml
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $Xml_to_Send);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type:application/x-www-form-urlencoded; charset=utf-8", "Content-Action:Volusion_API"));
$data = curl_exec($ch);
// Check for Errors
if (curl_errno($ch)){
print curl_error($ch);
} else {
curl_close($ch);
}
// Display the Xml Returned on the Browser
echo $data;
?>图像和类别丢失的错误在哪里?
发布于 2016-11-03 13:43:03
根据Volusion文档,类别、分类树和photourl是虚拟列,不能导入。
它确实可以使用CSV导入,但是它没有得到官方的支持。
我以前从未使用过它,但是如果您的类别已经存在于管理员中,并且您试图为这些类别分配新产品,请查看以下文档:
我更喜欢使用CSV导入方法。每个事务不限于100条记录,您可以像类别ID列表一样插入/更新虚拟字段。我从我使用的任何后端系统开始,然后动态地生成一个CSV文件。
https://stackoverflow.com/questions/40398298
复制相似问题