0

如何动态创建可下载信息(小、中、大)(在上传图像并保存时),在保存产品之前,使用图像详细信息

4

2 回答 2

0
$items = Mage::getModel('cart/mycart')->getCollection()->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId()); foreach($items as $item) : $incrementId = Mage::getModel('sales/order')->load($item->getOrderId())->getIncrementId();//->addFieldToFilter('product_id',$item->getItemId());

$linkPurchased = Mage::getModel('downloadable/link_purchased')->load($incrementId, 'order_increment_id'); $downloadableItems = Mage::getResourceModel('downloadable/link_purchased_item_collection') ->addFieldToFilter('purchased_id', $linkPurchased->getPurchasedId()); //->addFieldToFilter('product_id', $item->getItemId()); $links = array(); foreach ($downloadableItems as $li): $links[] = Mage::getModel('core/url')->getUrl('downloadable/download/link', array('id' => $li->getLinkHash(), '_secure' => true)); endforeach; foreach($links as $link): ?> " target="_blank"> 
于 2012-12-14T11:25:46.013 回答
0

您可以使用 Magento API 动态创建可下载的产品信息。

于 2012-12-14T05:32:13.683 回答