I have this task to do, but I'm stuck on it. Client wants to get a category name product was purchased at. This info normally is not set. So at first step I'm trying to capture event checkout_cart_product_add_after
and set a category for product.
So in my Observer.php
I try to get current category, by:
Mage::registry('current_category')->getName()
but it appears that current_category
object is not set in Mage registry. How can I add a category to a product in a different way? (Note that, product may belong to many categories, I just need the one at which it was purchased).
Regards, ventus