Magento 中的添加到购物车 API
我需要知道如何使用 API 将产品添加到购物车。我有一个包含详细信息的产品列表,我正在尝试从 Magento 外部调用 API。 Magento的哪个核心类实现了这个功能?
提前致谢..
I need to know how can I add products into cart using API. I have a list of products with details, I am trying to call the API from outside Magento. In which Magento's core class implements this function??
Thanks in Advance..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
magento 使用 MVC,通过查看购物车链接,您可以提取模块的路径,但是这
是您正在寻找的方法,请记住它取决于会话
magento uses MVC and by looking at the cart link you can extract the path to the module, however
is the method you are looking for , remember that it is depending on session
为了添加到购物车,您必须实现自己的 API。这可能很困难,因为正如安东提到的,这取决于会话。
曾经有一个项目, Mammoth Web Services,由英国的一些人开发,但该项目已经沉寂了。
In order to add to the cart you're going to have to implement your own API. That can be difficult because as Anton mentioned, it depends on session.
There was a project out there at one time, Mammoth Web Services, by some guys in the UK, but the project has gone silent.
如果您的产品有 magento id,这相当简单
http ://yoursite.com/index.php/checkout/cart/add?product=product_id&qty=qty
If you have magento id's for your products this is fairly simple
http://yoursite.com/index.php/checkout/cart/add?product=product_id&qty=qty
http ://www.magentocommerce.com/download/release_notes#Release%20Notes%20-%20Magento%201.4.2.0%20%28December%208,%202010%29
显然包含在 1.4.2.0 中,尽管不在官方API文档尚未发布
http://www.magentocommerce.com/download/release_notes#Release%20Notes%20-%20Magento%201.4.2.0%20%28December%208,%202010%29
included in 1.4.2.0 apparently, though not on the official API documentation yet