Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

XML data feed to import pricing and stock levels


GLOPRO

Recommended Posts

My supplier supplies xml data feeds of their inventories, for my store. With their many products it is often time consuming to use standard oscommerce import methods.

 

How do i import the suppliers data via xml feed into the store?

 

Particularly the current pricing and stock levels?

 

Thanks :-"

Link to comment
Share on other sites

Nice Chris :)

 

I would probably recommend the parser as Chris suggests to initially import the catalog and then use the XML feed to check stock levels on page request or automatic cron update.

 

Bobby

Link to comment
Share on other sites

thanks! A few more Questions.

 

1.Would the XML feed also be able to list the product name and OSC place it into the correct category?

 

2.And if the supplier adds or removes products from the feed, how will i be alerted that has happened.

 

3.Presuming that only the product name, category. price and stock levels is imported from the feed, I presume that I would still need to fill in the product description individually? Is there any way around it?

Link to comment
Share on other sites

1.Would the XML feed also be able to list the product name and OSC place it into the correct category?

 

It depends on what the data looks like. If they give you products in categories, you'll need to come up with a category map, to map their categories to your categories. The map can be in a table in your osc database, but essentially, you'll need something within the data itself to use to be able to tell the parser what category to put it in.

 

 

2.And if the supplier adds or removes products from the feed, how will i be alerted that has happened.

 

Traditionally, this is done with a last update timestamp. Each time you upload the feed, you'll 'update' the timestamp on each product. After it's finished, it will disable all products that don't have today's timestamp. There are a few other ways to do this, but this is probalby the simplest.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Another viable solution is to write a script that converts the vendor's XML document to a CSV file.

The popular contribution Easy Populate can import CSV files with ease.

 

BTW, if your vendor does not provide descriptions you could place the product title or standard text blurb in it's place. However, I don't feel it looks professional.

 

HTH,

Robert

Link to comment
Share on other sites

Easy Populate is pretty straightforward once you do two things.

1. You install it and define your settings correctly

2. You convert the CSV file into a format that Easy Populate expects.

(It can be converted using Excel or other utility.)

 

It has the capability of Importing/Updating product records, but it won't disable products that have been removed.

I feel it's by design because you would essentially "kill" your store if you want to update a few records.

As with all limitations, there are several workarounds (some graceful... some not).

 

HTH,

Robert

Link to comment
Share on other sites

Easy Populate is pretty straightforward once you do two things.

1.  You install it and define your settings correctly

2.  You convert the CSV file into a format that Easy Populate expects.

    (It can be converted using Excel or other utility.)

 

It has the capability of Importing/Updating product records, but it won't disable products that have been removed.

I feel it's by design because you would essentially "kill" your store if you want to update a few records.

As with all limitations, there are several workarounds (some graceful... some not).

 

HTH,

Robert

 

I have just confirmed that they provide 2 types of CSV (ver 2.2) files, standard and custom as well as the XML 2.22 feed.

Link to comment
Share on other sites

Yes, EP would work, but as Robert suggested, only after you have parsed through the csv or xml, and 're-arranged' the data into the proper order and tables to be able to insert or update where appropriate.

 

If you have more than a few hundred products, then the method I suggested earlier of 'updating' the timestamp of each product would out a strain on your server, or would at least add unneccesary contention.

 

A better solution would be to use a script to create a file on your server with all of your products in it. Then the next time your 'sync' script ran it would compare that list to a new list created from the xml or csv. That's probably the most efficient way to do it, and it puts most of the work on the operating system rather than on the datbbase. PHP can sort and compare a whole lot quicker than MySQL, and with much lower cpu utilization.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

That makes sense to do it that way, and most changes would really be the stock levels, pricing would not change as much, and products added or removed would be highlighted using this method i presume.

 

How can i get my hands on something like that?

Link to comment
Share on other sites

Something like that would need to be custom written, as there is no way to generalize all possible data feeds.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...