Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Change downloadable product url after successful order
 
devoluti0n
Jr. Member
 
Total Posts:  3
Joined:  2010-07-19
 

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 smile. See you’ !

 
Magento Community Magento Community
Magento Community
Magento Community
 
devoluti0n
Jr. Member
 
Total Posts:  3
Joined:  2010-07-19
 

sales_order_save_before is better cause it’s working, but it executes more than once :(.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top