3
사실 저장소를 가지고 있고 내 공급 업체의 스토어에서 제품과 카테고리를 모두 내 스토어로 가져올 때 제품이 성공적으로 삽입되고 업데이트되지만 범주가 삽입되거나 업데이트되지 않습니다.Volusion API를 사용하여 Volusion에서 새 카테고리를 생성하는 방법
API를 통해 새로운 카테고리를 생성/추가하고 싶습니다.
내 category.txt 파일
<?xml version="1.0"?>
<Volusion_API>
<Categories_Products_Link>
<CategoryID>107</CategoryID>
<ProductID>63015</ProductID>
</Categories_Products_Link>
</Volusion_API>
<?php
$file = file_get_contents('category.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;
?>
category.txt 파일을 게시하십시오. –
댓글이나 질문에 있으십니까? –
물론 질문이 있습니다. –