Magento:更新购物车项目总数返回0

时间:2016-08-05 12:00:16

标签: php ajax magento

我正在尝试使用ajax显示添加到购物车的商品数量。并且显示的值始终为0.

以下是我的ajax调用的内容:

    include 'app/Mage.php';
    Mage::init();
    $cart = Mage::getModel('checkout/cart')->getQuote();
    $nb_items = count($cart->getAllItems());
    echo(strval ($nb_items));

update_cart.php代码如下所示:

Error creating bean with name 'scopedTarget.itemizedReader' defined in billing.BillingConfig: Unsatisfied dependency expressed through method 'itemizedReader' parameter 1: No qualifying bean of type [java.lang.String]

返回给ajax函数的值始终为0.非常感谢任何帮助。

0 个答案:

没有答案