dsfjk44656 2014-01-04 08:46
浏览 26

通过api接受产品Feed到magento(XML)

Is it possible to receive a product feed via external api? I've looked at the magento api and I can see how to produce an XML web service to feed products out, but I need to feed information into magento.

I have a supplier of products with an XML api (SOAP). Is it possible to connect my magento store to this api?

  • 写回答

1条回答 默认 最新

  • dongqiao8502 2014-01-07 02:32
    关注

    Magento by default does not support this and in my honest opinion I would not go down the route of doing this with magento. The best way I can see of doing this is the following;

    1) Create a custom module with a cron config and model (http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/how_to_setup_a_cron_job).

    2) In the model you created and the method you defined in the module config, load your data feed and loop through the items. Either create them in magento if they don't exist or update/enable/disable/remove the product in magento if they do.

    You can schedule the cron to run every few hours or more frequently if it's quick enough, well optimised and not too intensive. You can get clever and possibly have ajax stock check on product view page to give live stock on the product page. Or to ensure it is is in stock at time of order you could add an event observer for the checkout_cart_product_add_before and query the live stock to check it's actually there (but you need to create the event - magento did not create it Magento checkout_cart_product_add_before and get number of products added).

    This will essentially allow you to keep magento working normally without extensively extending and overriding the core files. You could of course have a separate app altogether (maybe java) which does the same via magento's SOAP API and the the third party api.

    评论

报告相同问题?

悬赏问题

  • ¥100 求数学坐标画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站