How to get downloadable product links after successfull order

前端 未结 2 1019
长发绾君心
长发绾君心 2021-01-24 13:08

After a successfull order I would like to propose directly the downloadable URL for products buyer bought in the success.phtml file.

I wrote this piece of code to know p

2条回答
  •  不思量自难忘°
    2021-01-24 13:39

    This worked for me:

    $links = Mage::getModel('downloadable/link_purchased_item')->getCollection()
     ->addFieldToFilter('order_item_id', $item->getId());
    foreach ($links as $link) {
     echo Mage::helper('downloadable')->__('download') .
      $this->getUrl('downloadable/download/link', 
      array('id' => $link->getLinkHash(), '_store' => $order()->getStore(), 
      '_secure' => true, '_nosid' => true));
    }
    

提交回复
热议问题