【问题标题】:How to link into a cart outside of magento that was built with the cart api's如何链接到使用购物车 api 构建的 magento 之外的购物车
【发布时间】:2011-10-19 14:33:10
【问题描述】:

我正在为 Magento 构建一个自定义前端,用户可以在其中选择他们想要在 Magento 之外购买的产品。但接下来使用 Magento。

我已经使用产品 api 来提取 product_id/sku/name/price。所以我有一个 product_id 的列表可供购买。

我将使用 api 来创建和构建购物车。

我的问题是…… 使用 api 填充购物车并获得 shoppingcart_id 后,如何将用户直接重定向到 Magento 中的购物车页面?

感谢您的任何帮助或建议。

【问题讨论】:

    标签: php magento


    【解决方案1】:

    重定向很容易。这就是您在 Magento 1.5 中可以做到的方式。请注意,您需要在控制器操作中运行才能使其正常工作。

    $this->_redirect('checkout/cart');
    

    如果您想将用户引导至结帐页面,请尝试以下操作:

    $this->_redirect('checkout/onepage/');
    

    希望这会有所帮助!

    【讨论】:

    • 误读问题,抱歉!从概念上讲,您需要为当前用户创建一个结帐会话并将该会话传递给 Magento,以便它知道谁是当前购物车的所有者;您可能会将用户定向到example.com/checkout/cart
    猜你喜欢
    • 1970-01-01
    • 2012-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-06
    相关资源
    最近更新 更多