I’m having a lot of trouble to change a downloadable product url after a successful order.
Right now I’m listening “sales_model_service_quote_submit_after” and trough :
$order = $observer->getEvent()->getOrder();
$items = $order->getAllItems();
foreach ($items as $product)
$links = $product->getProduct()->getDownloadableLinks();
foreach ($links as $link)
$link->setLinkUrl('My New Url');
I’m trying to set a new one. It works but it seems to be reset to the original value later. I may need to find an another observer event, but I’ve no idea which one is the right one. I also tried the “before”, and “success” ones.
Thanks for your precious help . See you’ !