Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($_product->getTypeId() == 'downloadable') {
- /** @var Mage_Downloadable_Model_Resource_Sample_Collection $samples */
- $samples = Mage::getModel('downloadable/sample')->getCollection()->addProductToFilter($product_id);
- if ($samples) {
- $_myprodsamples = Mage::getModel('downloadable/link');
- $_mySampleCollection = $_myprodsamples->getCollection()->addProductToFilter($_product->getId());
- foreach ($_mySampleCollection as $_sample){
- $_samplelink = $this->getUrl('downloadable/download/linkSample/link_id/'.$_sample ->getId());
- }
- }
- }
- <?php if($_samplelink): ?>
- <a href="<?php echo $_samplelink ?>" class="button btn-cart piwik_download" target="_blank">Downnload</a>
- <?php else: ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement