Import KITS and KITLNKS into Volusion using some imported way (API or other?)

71 views Asked by At

I'd like to import KITS/KITLNKS into the VOLUSION platform.

We have been manually importing CSV files, exported from our own database, into volusion platform. The following files: Products, Kits, Kitlnks, Options, OptionCategories, and Categories

This works, however we need to speed up the process to work faster.

We use the API to export orders to import them into our database, which works great.

So I tried to use the API to import instead of the CSV import. Products, got it to work fine. Kits? Doesn't appear to be a way to import via API. Read online, seems like it's a well know issue.

Emailed support, bounced back.. Chatted with support, and they said it's possible, but that question is beyond the supports scope. So not very helpful, IMO.

They did suggested I use a .SQL and .XSD file to my schema/Generic folder, which I did, and I was able to return the KITS records, but not insert or update them. I think I am missing something to do this. Unfortunately I don't think support is going to help me.

Unfortunately, if I can't get this to function automatically, I will have to switch ecom providers. I am lazy, and hoping someone might be able to help here.

Any help would be appreciated,

Documentation is very hard to find, only examples/help I was able to find here on stackoverflow. Links to some documentation would be helpful as well. Doesn't have to be an API, I wouldn't mind if there was a way to FTP the CSV files and kick off an import of some sort.

Thanks for any help!

1

There are 1 answers

0
theCodeWhisperer On

I've had to do the same. (A lot of this is in the article user357034 linked to) Here is step 1 - calling an ASP file that creates a .sql file on the volusion folder that you'll execute later - note this SQL is custom for my settings - you'll have to modify it for your needs, but it should create the necessary table entries. This is the code in the ASP file. My products have 4 options or "conditions"....

' get the variables we need...
productCode= Request.QueryString("productCode")

sql =   " insert into Options_ApplyTo select 183, p.ProductCode from Products_Joined p left outer join Options_ApplyTo k on k.ProductCode = p.ProductCode and 183 = k.OptionID where p.ProductCode in ( " & productCode & " ) and k.ProductCode is null; " & _
        " insert into Options_ApplyTo select 184, p.ProductCode from Products_Joined p left outer join Options_ApplyTo k on k.ProductCode = p.ProductCode and 184 = k.OptionID where p.ProductCode in ( " & productCode & " ) and k.ProductCode is null; " & _
        " insert into Options_ApplyTo select 185, p.ProductCode from Products_Joined p left outer join Options_ApplyTo k on k.ProductCode = p.ProductCode and 185 = k.OptionID where p.ProductCode in ( " & productCode & " ) and k.ProductCode is null; " & _
        " insert into Options_ApplyTo select 186, p.ProductCode from Products_Joined p left outer join Options_ApplyTo k on k.ProductCode = p.ProductCode and 186 = k.OptionID where p.ProductCode in ( " & productCode & " ) and k.ProductCode is null; " & _
        " insert into KITS select 'wiz', p.IsChildOfProductCode, p.ProductCode, 1, null, null, case when RIGHT(p.ProductCode, 4) = '0001' then 0 when RIGHT(p.ProductCode, 4) = '0002' then 1 when RIGHT(p.ProductCode, 4) = '0003' then 2 else 3 end from Products_Joined p left outer join KITS k on k.KIT_IsProductCode = p.ProductCode where p.IsChildOfProductCode in ( " & productCode & " ) and k.KIT_IsProductCode is null; " & _
        " insert into KitLnks select kits.KIT_ID, null, case when RIGHT(kits.KIT_IsProductCode, 4) = '0001' then 186 when RIGHT(kits.KIT_IsProductCode, 4) = '0002' then 185 when RIGHT(kits.KIT_IsProductCode, 4) = '0003' then 184 else 183 end, null, null, null, null from KITS kits left outer join KitLnks lnks on lnks.kit_id = kits.KIT_ID where lnks.kit_id is null and KIT_ProductCode in ( " & productCode & " )    "

set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile(Server.MapPath("./addKITSinfo.sql"),2,true)
f.WriteLine(sql)
f.Close
set f=Nothing
set fs=Nothing

make sure there's a addKITSinfo.xsd file in the same folder (v/vspfiles/schema/Generic). And also be sure you are aware of SQL injection and such.

And then Step 2 - call the API to execute the SQL in the file you just created. Something like....

http://www.yoursite.com/net/[email protected]&EncryptedPassword=XXXXXXXXX&EDI_Name=Generic\addKITSinfo