0

I am creating a drupal commerce module for tracking users. I want to access a hook in drupal commerce on product category page. Went through most of the documentation but was not able to find the hook to listen to for product category page view.

2

Well, since you're dealing with Drupal, there's no "product category page"s ... per say ... but there are taxonomy terms that are often used for catalogs and attributes. So, you could, in theory, use hook_entity_view() to tap into when a taxonomy term is being viewed.

https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_entity_view/7

If you're building a module, I could see you building an interface that lets people assign urls and taxonomy terms that would potentially "make" the catalog pages trigger whatever it is you want to trigger.

Ultimately, though, there's no hard and fast rule on how to build a commerce store, so there's nothing for you to hook into.

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.