2

I am using Ultimo theme for my website and I want to use their featured product slider shortcode in product pages.

{{block type="ultimo/product_list_featured" template="catalog/product/list_featured_slider.phtml" category_id="4" product_count="8" size="size-xs" is_random="1" block_name="Random Products"}}

I can get the shortcode work by doing adding it from layout.xml and calling the block from view.phtml, what I couldn't do or don't know how to assign the category_id, product_count, is_random parts to the layout.xml or in view.phtml while calling the block.

I want to assign the category_id with the current product's category id and set the number of products in the slider, also the slider products must come randomly with each page refresh. (product_count and is_random can be set via layout.xml)

1 Answer 1

1

you can get category from registry and call the phtml grammatically

<?php $catid = Mage::registry('current_category') ? Mage::registry('current_category')->getId() : null;
  echo $this->getLayout()->createBlock('ultimo/product_list_featured')->setCategoryId($catid)->setProductCount(8)->setSize('size-xs')->setIsRandom(1)->setTemplate('catalog/product/list_featured_slider.phtml')->toHtml();
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.