Storeden Help Center

Welcome,
search through the guides and find what you need.

Adding a product

Follow

For adding a product in the e-commerce you have to generate an xml feed following this format:

Source

<urn:products xsi:type="urn:Item">
  <product>
    <groupUID xsi:type="xsd:integer">30</groupUID>
    <category xsi:type="xsd:string">DONNA#SCARPE</category>
    <brand xsi:type="xsd:string">Acme Inc.</brand>
    <title xsi:type="xsd:string">Titolo del prodotto di esempio</title>
    <facebookenable>1</facebookenable>
    <description xsi:type="xsd:string">
      <![CDATA[<p>Descrizione del prodotto, anche in html</p>]]>
    </description>
    <taxable xsi:type="xsd:integer">0</taxable>
    <quantity xsi:type="xsd:integer">10</quantity>
    <price xsi:type="xsd:float">259.00</price>
    <discount xsi:type="xsd:integer">10</discount>
    <weight xsi:type="xsd:integer">1</weight>
    <volume>
      <w xsi:type="xsd:integer">15</w>
      <h xsi:type="xsd:integer">30</h>
      <z xsi:type="xsd:integer">100</z>
    </volume>
    <highview xsi:type="xsd:integer">0</highview>
    <sku xsi:type="xsd:string">TRACK_19aBN</sku>
    <images>
      <image xsi:type="xsd:string">http://domain.tld/products/acme-inc/00001.jpg</image>
      <image xsi:type="xsd:string">http://domain.tld/products/acme-inc/00002.jpg</image>
      <image xsi:type="xsd:string">http://domain.tld/products/acme-inc/00003.jpg</image>
      <image xsi:type="xsd:string">http://domain.tld/products/acme-inc/00004.jpg</image>
    </images>
    <var>
      <variation>
        <var_composite>
          <key xsi:type="xsd:string">37</key>
          <count xsi:type="xsd:integer">2</count>
          <price xsi:type="xsd:float">0</price>
          <sku xsi:type="xsd:string">CRS0025_NERO_37</sku>
        </var_composite>
        <var_composite>
          <key xsi:type="xsd:string">38</key>
          <count xsi:type="xsd:integer">1</count>
          <price xsi:type="xsd:float">0</price>
          <sku xsi:type="xsd:string">CRS0025_NERO_38</sku>
        </var_composite>
      </variation>
      <var_key>
        <var_name xsi:type="xsd:string">Taglia</var_name>
        <var_value>
          <value xsi:type="xsd:string">37</value>
          <value xsi:type="xsd:string">38</value>
          <value xsi:type="xsd:string">39</value>
        </var_value>
      </var_key>
    </var>
  </product>
</urn:products>

Inside the <urn:products> tag you can add the product's feed.

Notes

The "SKU" code is the primary key of the product. Each update will be performed following the product's code.

GroupUID

ID store where updating products.

Taxes

The <taxable> tag identifies whether the product has tax included or not (0 => Tax included in the price; 1 => Tax excluded).

Item discount

The <discount> tag identifies whether a discount should be applied before the visualization or not. This field accepts only integers. If set to 0, no discount will be applied before the visualization.

Categories

Insert the category tree separated by #. If the category tree is not present, it will be created.

Dimensions

Dimensions inserted into the xml feed are referred to the packaging. They are used in the calculation of shipping costs (W => Lenght H => Height Z => Width).

Variants

In case of variants, the quantity for buying the product is set into the <count> tag into the structure <var_composite>. As consequence, the field <quantity> will be ignored. If the product does not have variants, the <var> tag and all its content can be omitted into the feed and the available quantity will be managed by the <quantity> tag.

PHP

<?
$xml_params = file_get_contents('products_feed.xml');
$headers = array(
  "Content-type: text/xml;charset=\"utf-8\"",
  "Accept: text/xml",
  "Cache-Control: no-cache",
  "Pragma: no-cache"
);

$auth_user = 'YourEmail';
$auth_password = 'YourPassword';

/** PRECHECK **/
if ($auth_user == '' || $auth_password == '') {
  throw new Exception('No Auth key found');
}

$url = 'http://ws.storeden.com/external/postproduct';

$ch = curl_init();

curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0) ;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'StoredenExternalApi');
curl_setopt($ch, CURLOPT_USERPWD, $auth_user.":".$auth_password);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$str_result = curl_exec($ch);

curl_close($ch);
?>

CURL

Coming soon! Once completed the feed upload, the system will process the feed in background.

Was this article helpful?
0 out of 0 found this helpful

Comments

Don't wait, start now to sell with Storeden

Try it for free