I want to save the customer_id and the product_id in a table after clicking a product and seeing its detail enter image description here


The product view controller triggers an event you can use:


See vendor/magento/module-catalog/Controller/Product/View.php

$this->_eventManager->dispatch('catalog_controller_product_view', ['product' => $product]);
| improve this answer | |
New contributor
Kristoffer is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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.