0
讓我知道如何從任何地方獲得購物車在magento中的狀態?我可以從任何地方獲得magento的狀態購物車
我的意思是說有可能得到類似 的錯誤 - 你的item "marlboro" count has been exceeded
!現在 。 沒有這麼多的股票,請降低它
感謝
讓我知道如何從任何地方獲得購物車在magento中的狀態?我可以從任何地方獲得magento的狀態購物車
我的意思是說有可能得到類似 的錯誤 - 你的item "marlboro" count has been exceeded
!現在 。 沒有這麼多的股票,請降低它
感謝
您可以使用類似的東西上是每一頁上觸發像controller_front_init_before事件
$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item) {
$product = $item->getProduct();
$stocklevel = (int)Mage::getModel('cataloginventory/stock_item')
->loadByProduct($product)->getQty();
if ($stocklevel<$item->getQty()){
...the logic that will permit to show the customer that the requested
product is not avaiable in this quantity...
}
}