0

I have implemented solution for import product using XML. Code is working fine but the category is not assigned to product.

Here is my sample XML file for import product.

<?xml version="1.0" encoding="UTF-8"?>
<Import>
   <Products>
      <ProductID>360</ProductID>
      <productcode>0035</productcode>
      <vendor_partno>035</vendor_partno>
      <productname><![CDATA[product 1]]></productname>
      <listprice>6.95</listprice>
      <productprice>2</productprice>
      <vendor_price>3.83</vendor_price>
      <stockstatus>100</stockstatus>
      <upc_code>99999</upc_code>
      <categoryids>1814</categoryids>
      <productdescriptionshort />
      <productdescription />
      <productweight>0.00</productweight>
      <freeshippingitem />
      <minqty />
      <maxqty />
   </Products>
</Import>
Opal
  • 81,889
  • 28
  • 189
  • 210
  • You say the code is working fine so assuming you are right it would indicate an issue with your XML data. Have you read the documentation for Volusion? – Chris Pickford May 21 '15 at 11:27

4 Answers4

2

categoryids is a "virtual column" and not something you can import directly.

In order to assign categories to products or really products to categories you would have to do a separate import following the format shown here...

http://support.volusion.com/article/product-management-categories-products-link-developer

user357034
  • 10,731
  • 19
  • 58
  • 72
  • You can use the category-ids column as long as you use commas in-between your catid numbers and also import that into the view called products-joined. Products it's self is a user-table and correct it's a generated view, but it's generated from a stored procedure, and so it's not backwards compatible back to products joined in that direction. Hope that makes sense. – Tim Dec 06 '15 at 16:18
0

categoryids is a "virtual column" and not something you can import directly

That is true according to the documentation, but importing Category IDs works when you do a Standard Import with a CSV file.

Phil S
  • 179
  • 2
  • That may be true when using a CSV in the import section of the admin area however the OP asked specifically about using the API with XML data. – user357034 Oct 16 '15 at 00:18
0

You just have to pass the following XML code to your Volusion API.

<Categories_Products_Link>
    <CategoryID>Write your category id that you assign to the product here</CategoryID>
    <ProductID>Write your product id that you assign to the product here</ProductID>
</Categories_Products_Link>

How to check your product id please follow the below steps:

  1. Your admin click on Inventory.
  2. Click in drop down menu on Products
  3. Click on product
  4. In Advance Info click on Vendor.

You will see the Product ID

This is the screenshot.

enter image description here

Asif Rao
  • 199
  • 2
  • 15
Doulat Khan
  • 493
  • 5
  • 24
-1

I also had this issue and couldn't gain any clarity from that url posted above. You see the docs say that CategoryID and ProductID are required however we do not have product ID's only productCodes in the system. If you export the products table you will see no such ID column.

With that said I also went to export the Categories_Products_Link table and it only has 3 columns: ID, CategoryID, Auto_Maintenance_Column

So what data do we pass through for the ID column or is it actually ProductId?

I also wonder if maybe we should be using the aviary JSON API vs this old XML API?

Joseph Crawford
  • 1,470
  • 1
  • 15
  • 29