简体   繁体   English

如何获取购物车插入ID和更新的购物车ID magento

[英]How to get the Cart insert id and updated cart id magento

I am doing a magento customization site , am new to magento anyboby pls help to get the addtocart insert id and cart updated Id .what coding should i apply in controller 我正在做一个magento定制站点,是magento anyboby的新手,请帮助获取addtocart插入ID和购物车更新的ID。我应该在控制器中应用哪种编码

app\code\core\Mage\Checkout\controllers\CartController.php

or where should i found the cart insert operation. 还是我应该在哪里找到购物车插入操作。

To get the cart ID, after adding a product to cart, run the following statement: 在将产品添加到购物车后,要获取购物车ID,请运行以下语句:

<?php
$cart = Mage::getSingleton('checkout/session');
$cart_id = $cart->getQuote()->getId();
echo $cart_id;
?>

I did not test it. 我没有测试。 But hope it works. 但是希望它能起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM