For the pro collections I have a question for you !

I want to filter the cart collection items in checkout/cart.phtml like this:

$items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
$items->addFieldToFilter('sku', 123); 

var_dump($items->getSize()) renders me int(1) it's my filtered product that i want, while basically I have three items in a cart. Good.

Now if I do :

foreach ($items as $item) {

This renders me the three items ???

  • After playing arround yesterday I already asked this :) – sv3n Jul 22 '17 at 20:19
  • Ahhh, I didn't know, and I left you a message that I will ask this question, no problem, I'll delete it ;) – PЯINCƏ Jul 22 '17 at 20:24

I don't have answer of your question. But in such issues I always use ->getSelect() ->__toString() for collection. It helps me to understand which sql query magento uses right now. So it helps to debug.

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.