实际上我有一个商店我将产品导入我的商店所有产品数据都是插入和更新,但唯一的图片或图片网址不是插入和更新。
<Products_Joined>
<productcode>3710_012T</productcode>
<vendor_partno>EAH5450SILENT/DI/1GD3(LP)</vendor_partno>
<productname>Test Product TA</productname>
<hideproduct>N</hideproduct>
<stockstatus>20</stockstatus>
<lastmodified>1/5/2016 10:25:00 AM</lastmodified>
<lastmodby>2</lastmodby>
<productweight>0.9</productweight>
<productprice>100</productprice>
<productmanufacturer>ASUS TeK</productmanufacturer>
<vendor_price>32.69</vendor_price>
<numproductssharingstock>0</numproductssharingstock>
<categoryids>107</categoryids>
<producturl>http://tebkq.mvlce.servertrust.com/ProductDetails.asp?ProductCode=3710_012T</producturl>
<photourl>http://tebkq.mvlce.servertrust.com/v/vspfiles/templates/tlztech/images/3710_012T.gif</photourl>
<categorytree>New: Parts and Accessories</categorytree>
</Products_Joined>
<?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://mysitedomian/net/WebService.aspx?Login=xxxxxxxxxxx&EncryptedPassword=xxxxxxxxx&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;
?>
答案 0 :(得分:0)
我们可以通过两种方法添加图像,两种方法都是手动而不是通过API。
手动从Volusion的管理端。
通过FTP
FTP到:
vspfiles /照片
有关详细信息,请单击下面的链接。
http://adxmedia.com/articles/adding-images-to-your-volusion-store-products/