2

I need to trigger an event if an user click a downloadable product, i mean the document (pdf, word, etc...) included because i need my customer read those documents, and after that i need to do some action Is there any event dispatched by downloadable product or i need to create a custom event?

Thank you very much

2

When you check on linkAction()(This action is responsible when you click on download) from

app\code\core\Mage\Downloadable\controllers\DownloadController.php . From this action, I can say that there is no event used by Magento. I think you need to overwrite this action to dispatch your event to perform some action.

| improve this answer | |
  • Your suggestion is right but dispatching the event inside linkAction() doesn't work. Instead it work if for example i dispatch the event inside getBasePath() in app\code\core\Mage\Downloadable\Model\Sample.php – Ivan Dec 22 '17 at 13:52
  • Could you please post your code which you have written for dispatch event @Ivan – Keyur Shah Dec 22 '17 at 14:05
  • accept the answer If you find It helpful @Ivan – Keyur Shah Jan 12 '18 at 10:22

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.