Talk:Products

From DevWiki

Jump to: navigation, search

When posting a product with the following code I get a "Success" returned but the product never shows up in inventory... Any Help?

           edi_url = "http://xxxxxxxxxxxxxxxx/net/WebService.aspx?Login=xxxxxxxxxxxxxxxxx&EncryptedPassword=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&Import=Update";
           edi_request = "";
           edi_request = edi_request + "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
           edi_request = edi_request + "<xmldata>";
           edi_request = edi_request + "   <Products>";
           edi_request = edi_request + "       <ProductCode>12</ProductCode>";
           edi_request = edi_request + "       <Vendor_PartNo>1YY67</Vendor_PartNo>";
           edi_request = edi_request + "       <ProductName>Corvette Passenger Side Rear Quarter Panel OEM </ProductName>";
           edi_request = edi_request + "       <ProductDescriptionShort>Corvette Passenger Side Rear Quarter Panel OEM</ProductDescriptionShort>";
           edi_request = edi_request + "       <ProductDescription>Item is used, taken off of a C5 Corvette 1997-2004. Has some small chips in paint (please see pictures)</ProductDescription>";
           edi_request = edi_request + "       <ProductWeight>6</ProductWeight>";
           edi_request = edi_request + "       <ListPrice></ListPrice>";
           edi_request = edi_request + "       <ProductPrice>170</ProductPrice>";
           edi_request = edi_request + "       <ProductCondition>Used - Take Off</ProductCondition>";
           edi_request = edi_request + "       <ProductManufacturer></ProductManufacturer>";
           edi_request = edi_request + "       <Length>48</Length>";
           edi_request = edi_request + "       <Width>3</Width>";
           edi_request = edi_request + "       <Height>20</Height>";
           edi_request = edi_request + "       <CategoryIDs>31</CategoryIDs>";
           edi_request = edi_request + "       <StockStatus>1</StockStatus>";
           edi_request = edi_request + "   </Products>";
           edi_request = edi_request + "</xmldata>";
           xml_http = new XMLHTTP();
           xml_http.open("POST", edi_url, false, "", "");
           xml_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
           xml_http.setRequestHeader("Content-Action", "Volusion_EDI");
           xml_http.send(edi_request);
           edi_response = xml_http.responseText;

Contents

update

It looks like you are using Import=Update. Since you say the product isn't showing up it sounds like it doesn't exist in your inventory. If you want to add a new product you must use you can use either the Insert or Insert_and_Update modes. Insert - Will only insert new records and ignore all others. Insert_and_Update - Will insert new records that don't exist and update any that already exist.

Showing All Products

I'm trying to pull up all products and their stock level. If I don't fill in the WHERE clause, it will only show it to me once. Is there a way around this?


Answer:

Not at this time. What happens is we send products once but if the last modified date of the product is after the last time the export was run then you would get the newly modified products to update your records. However when a product is ordered and the stock is modified by the order it does not update the last modified date of the product. What you need to do is loop through all your products and call the web service with the product code in the where clause and just get the stock status back.

This will allow you to maintain your products in sync with an external database.

Follow Up on All Products

You said "Not at this time." Is there a timeframe when the query will act like EVERY OTHER QUERY system in existence? Is there a way to turn this "helpful feature" off? I would like to update an external databse quite frequently. I don't like the idea of needing to iterate through 1600 individual products to first get the XML data, then update my external database another 1600 times. I'd much rather be able to download the entire products DB each time, and simply reload my external DB each time. It would save substantial time, code, and bandwidth.

Or could there at least be a programatic means of resetting the Export? On the Export page there is a way to reset so that your next export will contain all the products. Could there be a URL to accomplish this as well?

Deleted Products

How can we be notified of deleted products through this?

Import Query String

Here are the Import query string options that are available:

  1. Update
  2. Insert
  3. Insert_and_Update
  4. Delete

It looks like if you send an "Update" when the product does not exist, it still returns success. A "Delete" will actually delete the product.

Response For Insert/Update

When sending a insert or update, the response from the server will respond with the XML below even if it was not successful:

<?xml version="1.0" encoding="utf-8"?> <Volusion_API ImportMode="Update"> <Products> <Success>True</Success> <ProductCode>TEST</ProductCode> <ProductID>1861</ProductID> </Products> </Volusion_API>

Navigation