2

Can Magento make real-time calls to another system for item price and stock availability?

In other words, product catalog would be stored in Magento, but not pricing information, nor stock availability. These would be pulled from an external system.

Thank you.

2

Out of the box, no - but that's the beauty of Magento, its a modular platform you can extend to suit your needs.

You would have a few options for implementation (which would largely depend on the actual design requirements for the frontend of your site).

My advice would be to deliberately not include stock levels within the rendered HTML, and include a post-page load Ajax request to your stock system. This is a great way to ensure a quick TTFB and reduces the burden on your Magento server for stock lookup. Use simple JS validation to prevent adding to cart if the stock level is below zero. Then on the checkout, tie in proper server-side validation into the isSaleable() method.

1

While theoretically possible, you certainly don't want to call the external system on each page request. You would also have to change how price and stock index work, and there is much that can go wrong with price calculation.

Usually one would use a scheduled import or the Magento API for synchronisation with the external system. With the ImportExport module of Magento it is possible to update only chosen attributes. At least for prices I highly recommend this method.

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.