0

I need to export products from Magento to 3rd party CMS, let's say Wordpress.

My store will look like this:

  • I don't need to integrate systems (neither sharing sessions, nor customers)
  • There would be only about 300 products with only limited information about the products (title, SKU, link, image, and description, so not cross-sells, any custom attributes, etc.)
  • There would be a multi-store view set up so it, probably, would be necessary to export products per store view.

This can be achieved by at least 3 options:

  1. Using default Export functionality (Advanced Profiles) (perhaps would need to add cron job feature for default functionality)

  2. Magento extension: public endpoint with export data + Wordpress extension that will grab generated .xml files

  3. Wordpress extension: using Magento SOAP API

What would be the right way to do this?

  • There is no right answer. Only you know what is the most appropriate solution for what you are trying to do. – Ben Lessani - Sonassi Feb 11 '13 at 9:32
  • Agreed that there is no right answer, but hope that someone can share their experience as this seems to be common task – Sergei Guk Feb 11 '13 at 16:26
  • We've done it countless times. But each type of integration warrants a difference interface. There is no right way. – Ben Lessani - Sonassi Feb 11 '13 at 16:35
2

hile there's not one "best" solution that fits all cases, there is definitely a best solution on a case-by-case basis. Generally, we approach these situations asking the question "What's the most efficient way to accomplish this task?". Let's look at the pros and cons for each situation:

Dataflow

Pros: Very flexible, easy to extend

Cons: Slow beyond belief, even on optimized systems

Magento Extension (Public XML endpoint)

Pros: Easy to accomplish, but could be slow to generate. You could do this so it's cached though. JSON would be better than XML. Fast

Cons: Two modules to manage - WP and Magento. This isn't the best solution from a financial perspective.

Wordpress extension using Magento SOAP API

Pros: Only one codebase to maintain, in WP

Cons: SOAP is notorious for having too much overhead, and is mainly used for Java, .NET, and legacy PHP projects or PHP projects consuming webservices. XML-RPC or REST would be faster.

Recommendation

Now that that is out of the way, we can look at which might be the best in this scenario. We've actually run into this. The way we did it was to create JSON handling in a Magento module. The data is handled by a model, then we convert the collection to JSON. We keep the output in a block. This allows us to cache the JSON since it's block output (just like you'd cache HTML) and reduces overhead.

  • ... and if the OP is using 1.7+ they have JSON API's available out-of-box. – philwinkle Feb 14 '13 at 20:56
  • Thanks for the detailed answer. I ended up with Soap API (added my won method to avoid multiple loops for retrieving descriptions and images' URLs) but will have a look at REST API with Json responses... – Sergei Guk Feb 14 '13 at 21:31
  • @Bob Brodie also if I use XML-RPC instead of SOAP. should I require_once "Zend/XmlRpc/Client.php in my Wordpress extension folder? – Sergei Guk Feb 14 '13 at 22:52
  • @philwinkle - They do have JSON APIs, but they require you to oAuth, we needed something that was public for everyone to use, and limited to only a few attributes. – Bob Brodie Feb 15 '13 at 14:58
  • @SergeiGuk You should definitely use Zend_XmlRpc_Client. There are some good examples here: magentocommerce.com/api/soap/… – Bob Brodie Feb 15 '13 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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