I've looked high and low for this but have had no luck.

I need to get the category of the page that the product was added from. I have written an Observer that hooks into the add to cart event that would hopefully get the category of the page and then store it in the quote to use later in the checkout.

We have a lot of configurable products on this site that can be in 30+ different categories as it is for a school wear site that has generic products that are later badged for that school.

The problem comes from that I have a shipping method we have written that depends on whether an option is turned on in the category, however I can't get the correct category to check whether the option is on as the configurable products just return all categories they're in.

The registry is now deprecated, and I have no other options to get the category to add into the quote as additional data to use for later.

Thanks in advance.


Your Answer

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

Browse other questions tagged or ask your own question.