Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am new to this whole website design and API bit. My husband has bought a license for the program InkSoft. Their site does not offer very much customization, so we decided to buy a Wordpress.org site that is hosted through godaddy.

With all of that said, I am trying to figure out a way to take the products that are on InkSoft's website, which get their information from the suppliers' warehouses (for things like inventory), and put them on the Wordpress site.

There is an area on InkSoft where I can access "Store API...API feeds." I guess I am just confused on where to put this type of stuff in the WordPress site or how to put it in there?

If I go to the "Products" area on this Store API, I am given a URL that deals with the product stuff and I am also given a HUGE list of stuff that contains stuff such as:

<ProductCategoryList>
<vw_product_categories product_category_id="1000076" name="Most Popular" path="Most Popular" thumburl_front="REPLACE_DOMAIN_WITH/images/publishers/2433/ProductCategories/Most_Popular/80.gif" />

How to use all this stuff?

share|improve this question
add comment

1 Answer

I'm not familiar with InkSoft so can only really talk about generalities; however it should give you a pointer in the right direction!

What you've got there is XML; presumably you can tweak your requests to the API by expressing a different URL - and can get different responses, or responses showing different data.

XML is a markup language, just like the HTML that your Wordpress front-end is built in - and all other web pages. Whereas HTML is used for the presentation of a page, XML is used for structuring of data - and in some cases the presentation too. (Some microsoft office formats are actually XML based under the hood - amongst many many other file formats)

Now Wordpress is built in PHP and is surprisingly easy to customise.. When you get to grips with it at least. You can write plugins or widgets with ease, and depending upon how you want to display the data - this could be the way forward.

Alternatively you can build the functionality straight in to your theme by editing the functions.php file in your theme directory. As a rule of thumb this is bad for maintenance, and I'd recommend you looking at the Wordpress documentation on plugins and widgets. There's even some good boilerplate code available if you google "Wordpress widget boilerplate". (I would link you to it but I'm replying from my iPhone whilst sitting on a sunny beach in Croatia!)

Now as I said before, Wordpress is built with PHP. It just so happens that PHP is very good when it comes to requesting, parsing and extracting data from XML. A quick google of SimpleXML may give you some information there.

At an estimation something like this could take a seasoned developer a few hours, as I get the feeling you're quite new to this - it could take a fair bit longer! It will be satisfying and interesting though :)

So in short, if I was you - I'd grab some Wordpress boilerplate code; Widget if you want it on a sidebar or plugin if you want a whole page. (You can register a "shortcode" that will replace something like [myinksoftfeed] with the content you want, this means you can change theme and not have to worry about your InkSoft data being too tightly coupled to the theme.) Then look at SimpleXML and see some PHP examples with it.

I must also add - Wordpress generally has good documentation with examples and a very active community. Similarly, PHP has some good documentation - and if you read the comments of the documentation people are very quick to give examples or point out pitfalls. PHP also has quite a common syntax which is quite easy to pick up.

As a side note, I mention it not being good practice to edit your themes function.php file to implement this - its something which is generally acceptable, and I've worked at an agency which has regularly done it. In my mind it's a bad habit and you really don't gain any speed of development from it; should you wish to change theme it can create a fair few issues.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.