0

Hi Guys I am just wondering how I can display a specific product on a CMS page and display it's attributes?

Any ideas on how how this can be done?

Marius
  • 197,939
  • 53
  • 422
  • 830
Christopher
  • 33
  • 1
  • 4

1 Answers1

1

You can do that with a widget.

How the widget is build you can see with the default widget "product link" and expand that to more product attributes.

Another way is to write your own widget, within an extension. Am example on how to build a widget is here: http://www.spinonesolutions.com/2010/10/magento-custom-widget/

You can do then something like this in the widget template:

  <?php
$sku_list = $this->getData('sku_list');
$productSkus = explode(",",$sku_list);
$productCollection=Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToFilter('sku', array('in' => $productSkus))
    ->addAttributeToFilter('status', 1)
    ->addAttributeToSelect('*')
    ->addUrlRewrite();
<?php $i=1; foreach($productCollection as $_product): ?>
 <a class="brandpage-product-large" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'thumbnail'), null, true) ?>" class="product-image"><img class="img-responsive" src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize($imageRenderSize['x'],$imageRenderSize['y']); ?>" alt="<?php echo $_product->getName();?>" title="<?php echo $_product->getName();?>" />
                </div>
            </a>
Bernhard Prange
  • 677
  • 4
  • 19