Thursday, November 19, 2015

Get cms page url in magento

<?php
$pageid=1;
echo Mage::helper('cms/page')->getPageUrl($pageid); ?>

Or
In controller or .phtml file:
<?php echo $this->getUrl('whats_new');?>

or
<?php echo Mage::helper('cms/page')->getPageUrl('url_key'); ?>

Or
In CMS Page
{{store _direct="url_key"}}

Wednesday, November 4, 2015

Call Newsletter form anywhere in magento

<?php 
echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); 
?>

Fatal error: Class Zend\Stdlib\Parameters contains 1 abstract method... magento 2

Fatal error: Class Zend\Stdlib\Parameters contains 1 abstract method and must therefore be declared abstract or implement the remaining met...