Advertisement
pharmokan

magento get data for indesign sale brochures

Mar 27th, 2020
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2. require_once 'app/Mage.php';
  3.  
  4. Mage::app()->setCurrentStore(3);
  5. ?>
  6.  
  7. <?php
  8. $copypasta = <<< EOC
  9. SKU1
  10. SKU2
  11. SKU3
  12. EOC;
  13. $skus = explode(PHP_EOL, $copypasta);
  14. ?>
  15.  
  16.  
  17. <?php
  18. foreach ($skus as $item):
  19. ?>
  20. <?php
  21. $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $item);
  22. ?>
  23.  
  24.  
  25. <?php
  26.  
  27. ?>
  28. <?php echo $product->getSku() . "#" . 'http://www.XXX.com/media/catalog/product' . $product->getImage() . "#" . $product->getName() . "#" . $product->getPrice() . "<br/>";?>
  29.  
  30.  
  31. <?php
  32. endforeach;
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement