如何在保存产品之前动态创建可下载的信息(小型,中型,大型)(在上传图像并保存时)。
答案 0 :(得分:0)
您可以使用Magento API动态创建可下载的产品信息。
答案 1 :(得分: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">