magento does not store product category name where user added it. You need to do customise it. For it you need to create custom column in order_item and quote_item table and with observer (**checkout_cart_product_add_before**) need to save current category name. Current category $category = Mage::registry('current_category'); $categoryid =$category->getId();