0

I would like to get how many times a single product that was added to cart from sales_flat_quote_item table. Please guide me how do it achieve this. Thanks

1

directly on the db:

SELECT count(1) from sales_flat_quote_item where product_id = your product id here

or via code:

$productId = your product id here
$collection = Mage::getModel('sales/quote_item')->getCollection()
    ->addFieldToFilter('product_id', $productId);

$size = $collection->getSize();
1
  • also you can filter only active quotes items (i.e. shopping carts), join sales_flat_quote and filter by is_active = 1
    – Neklo.com
    May 19 '16 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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