Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Data Feed How To
 
redegifts
Member
 
Total Posts:  34
Joined:  2007-12-04
 

I will be creating a website using the drop shipper TrademarkCommerce.  They currently have a XML inventory feed.  How would I go about setting this up so that inventory is kept up to date?  Do I need to import all the data first, and then reference by the item number?  I am extremely new to Magento and would be interested in finding out how to set this up. 

Russ Dyer

 
Magento Community Magento Community
Magento Community
Magento Community
 
RoyRubin
Magento Team
 
Avatar
Total Posts:  895
Joined:  2007-08-07
Los Angeles, CA
 

Hello Russ - Welcome to the Community!

You may want to start here - http://www.magentocommerce.com/boards/viewthread/1840/

 Signature 

Roy Rubin
Magento Team

 
Magento Community Magento Community
Magento Community
Magento Community
 
redegifts
Member
 
Total Posts:  34
Joined:  2007-12-04
 

I have looked at that post, but am highly confused. 

the XML product feed address is http://www.trademarkcommerce.com/merchants/files/feeds/tminv_feed.xml

With the post you forwarded me to, I have created the Curl.php file according to the example. 

The next step refers to a Dataflow.xml file.  Is this created by creating the import profile?  Can you walk me through how to point the profile to http://www.trademarkcommerce.com/merchants/files/feeds/tminv_feed.xml as the profile is looking in a local directory. 

Or, am I creating a Dataflow.xml file as in the example below (which was the next step in the post)??  Where is this file saved to??  This example uses a .csv file and mine would be a .xml file.  What changes need to be made??

<action type="varien/convert_adapter_http_curl" method="load">
<var name="uri">http://compgallery.hosting4less.com/ItemDataFiles/Gallery_Complete.csv</var>
</action>
<action type="varien/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="filename"><![CDATA[computer_gallery.csv]]></var>
</action>

Thank you for any help you can provide,

Russ Dyer

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ron Seigel
Guru
 
Avatar
Total Posts:  389
Joined:  2007-08-31
Ottawa, ON
 

@Russ

The process should be essentially the same for actually downloading the file via http.

Then the easiest way is to use the Profiles section (Admin > System > Import/Export > Profiles) to generate the XML to ultimately use to create an advanced profile that will do it all from start to finish.

The only changes to make in the example are the url for the file and the filename you’re saving it as (totally untested so you mileage may vary).

I’m sure there are much more advanced and interactive ways of using XML files that will ultimately come to light in the future.

Keep us posted as to how this is working for you.

Join the Drop Shipping group if you’d like to keep updated and contribute.

http://www.magentocommerce.com/group/view/164

 Signature 

Ron

 
Magento Community Magento Community
Magento Community
Magento Community
 
redegifts
Member
 
Total Posts:  34
Joined:  2007-12-04
 

was working according to example as far as saving .xml feed to magento folder. 

now, when i run the script, i receive the following error:

Fatal error: Cannot redeclare class Varien_Convert_Adapter_Http_Curl in /home/redegift/public_html/magento/lib/Varien/Http/Adapter/Curl.php on line 37

Any ideas?

Russ

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ron Seigel
Guru
 
Avatar
Total Posts:  389
Joined:  2007-08-31
Ottawa, ON
 

Which version of Magento are you using?

The latest version has the HTTP adapter included so you need to leave out that part of the instructions and just do the XML.

 Signature 

Ron

 
Magento Community Magento Community
Magento Community
Magento Community
 
redegifts
Member
 
Total Posts:  34
Joined:  2007-12-04
 

just downloaded on Sunday, version 0.6.13700

i see there is another version 0.6.14100

so with the newer version, I don’t need to create curl.php?

also, can the new version files just be copied over to update the version?

Russ

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ron Seigel
Guru
 
Avatar
Total Posts:  389
Joined:  2007-08-31
Ottawa, ON
 

No need to create curl.php in the new version. It’s already there.

I just nuke and reinstall when I update since things are going to change so much until there’s a production version. Dunno what would happen if you just copied over.

 Signature 

Ron

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ron Seigel
Guru
 
Avatar
Total Posts:  389
Joined:  2007-08-31
Ottawa, ON
 

Ok...I tried it using Trademark Commerce.

All works as expected except it adds:

HTTP/1.1 200 OK
Content
-Length1440343
Content
-Typetext/xml
Last
-ModifiedThu06 Dec 2007 15:23:58 GMT
Accept
-Rangesbytes
ETag
"607ee651c38c81:2a7"
ServerMicrosoft-IIS/6.0
X
-Powered-ByASP.NET
Date
Thu06 Dec 2007 15:34:19 GMT

to the top of the file (same problem I’m having with CSV files).

If you remove that it appears to be ok.

Here’s what I used for the XML:

<action type="varien/convert_adapter_http_curl" method="load">
    <var 
name="uri">http://www.trademarkcommerce.com/merchants/files/feeds/tminv_feed.xml</var>
</action>
<
action type="varien/convert_adapter_io" method="save">
    <var 
name="type">file</var>
    <var 
name="filename"><![CDATA[media/feeds/trademark_commerce.xml]]></var>
</
action>

Notice that I’m saving my feeds in media/feeds/ folder.

Have to wait till I get an answer about manipulating files to remove the stuff at the top.

Stay tuned....

 Signature 

Ron

 
Magento Community Magento Community
Magento Community
Magento Community
 
redegifts
Member
 
Total Posts:  34
Joined:  2007-12-04
 

question about the datafeed function.  will this update inventory fields in the products?  do i need to create the products first?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ron Seigel
Guru
 
Avatar
Total Posts:  389
Joined:  2007-08-31
Ottawa, ON
 

All that particular feed has is the Product Code and inventory level. Your products have to be already created to use it.

With Trademark Commerce, you can download the initial inventory file and then upload it using an Import Profile (it’s available as either a CSV or XML - either should wrok fine). Then the XML inventory feed can be used to keep inventory levels accurate.

This leaves the issue of what happens when they add new products to their inventory. I’m going to work on that soon hopefully.

 Signature 

Ron

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1771
Joined:  2007-08-07
Los Angeles
 

@Ron: you’ll need to edit Convert_Adapter_Http_Curl:

//after
        // read the remote file
        $data $http->read();

// add this
        
$data preg_split('/^\r?$/m'$data2);
        
$data trim($data[1]);

// right before
        // save contents into container
        
$this->setData($data);

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1771
Joined:  2007-08-07
Los Angeles
 

I’ve updated the code above, please note the changes.

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ron Seigel
Guru
 
Avatar
Total Posts:  389
Joined:  2007-08-31
Ottawa, ON
 

Holy crap! It worked! smile

Is this something that will work in every situation (as in will it be part of the core now) or is it specific to this?

Reason I ask is I’d hate it to get overwritten every time I upgrade.

Thoughts?

 Signature 

Ron

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1771
Joined:  2007-08-07
Los Angeles
 

I will see how it would affect already implemented API calls to integrate into Varien_Http_Adapter_Curl and post an update.

Now, are you going to write also parser for the XML you fetch, so it can be imported into catalog?

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ron Seigel
Guru
 
Avatar
Total Posts:  389
Joined:  2007-08-31
Ottawa, ON
 
Moshe - 06 December 2007 11:57 AM

I will see how it would affect already implemented API calls to integrate into Varien_Http_Adapter_Curl and post an update.

I can tell you it takes a LOT longer to process. Had to bump my max_execution_time to 240 (mind you it is a 4 meg file). Dunno how that could be improved or if it matters in the long run.

Moshe - 06 December 2007 11:57 AM

Now, are you going to write also parser for the XML you fetch, so it can be imported into catalog?

Correct! That should be the easy part (I hope). I’m doing the Computer Gallery one first so I’ll post more in that thread.

Thanks a million Moshe! So far so good. smile

 Signature 

Ron

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
52294 users|444 users currently online|105616 forum posts