Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
- $items->addFieldToFilter('sku', 75782007);
- foreach ($items as $item) {
- var_dump($item->getSku());
- }
- string '75782007' (length=8)
- string '32811969' (length=8)
- string 'hdd006' (length=6)
- $itemIds = $items->getAllIds();
- foreach ($items as $item) {
- if (in_array($item->getId(), $itemIds)) {
- var_dump($item->getSku());
- }
- }
- string '75782007' (length=8)
- SELECT `main_table`.* FROM `sales_flat_quote_item` AS `main_table`
- WHERE (`quote_id` = '757') AND (`sku` = '75782007') AND (`sku` = '75782007')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement