Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. if($_product->getTypeId() == 'downloadable') {
  2. /** @var Mage_Downloadable_Model_Resource_Sample_Collection $samples */
  3. $samples = Mage::getModel('downloadable/sample')->getCollection()->addProductToFilter($product_id);
  4. if ($samples) {
  5. $_myprodsamples = Mage::getModel('downloadable/link');
  6. $_mySampleCollection = $_myprodsamples->getCollection()->addProductToFilter($_product->getId());
  7. foreach ($_mySampleCollection as $_sample){
  8. $_samplelink = $this->getUrl('downloadable/download/linkSample/link_id/'.$_sample ->getId());
  9. }
  10. }
  11. }
  12.  
  13.  
  14. <?php if($_samplelink): ?>
  15. <a href="<?php echo $_samplelink ?>" class="button btn-cart piwik_download" target="_blank">Downnload</a>
  16. <?php else: ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement