Saturday, February 21, 2015

Redirect to Same Page in magento

In your controller's action means in module/controller/action,call following function:
$this->_redirectReferer();

call newsletter block in footer in magento

You can do this in local.xml

I had done following code for local.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
<!-- remove the newsletter block from left navigation -->
        <remove name="left.newsletter" /> 
        <!-- call newsletter block in footer -->
        <reference name="footer">
            <block type="newsletter/subscribe" name="newsletter" as="newsletter" template="newsletter/subscribe.phtml" before="-" />
        </reference>
    </default>
</layout>

change layout of category page in magento

You can do this either in catalog.xml or in local.xml

I had done following code for local.xml

<?xml version="1.0"?>
<layout version="0.1.0">
   <catalog_category_default translate="label">
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
    </reference>
   </catalog_category_default>
</layout>

call static block in magento

You can call static blocks by using following ways:
1) In CMS page or block:
{{block type="cms/block" block_id="custom_block_id"}}

2) In PHP code:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('custom_block_id')->toHtml(); ?>

3) In XML file:
<block type="cms/block" name="custom_block_id" after="-">
      <action method="setBlockId"><block_id>custom_block_id</block_id></action>
</block>

Remove block from magento left or right column

In your layout.xml
<remove name="block.name" />

Following code will remove default sidebar blocks:

<default>

<remove name="customer_account_navigation"/><!--Customer navigation-->
<remove name="sale.reorder.sidebar"/><!--Sales reorder sidebar when customer logged in Dashboard-->

<remove name="catalog.product.related"/><!--Related products sidebar-->
<remove name="catalog.compare.sidebar"/><!--Compare product sidebar-->
<remove name="catalog.leftnav"/><!--Layered navigation-->
<remove name="catalogsearch.leftnav"/><!--Layered navigation on search result page-->

<remove name="right.permanent.callout"/><!--Right Callout Sample Data-->
<remove name="right.reports.product.viewed"/><!--Recently Viewed Products-->
<remove name="right.reports.product.compared"/><!--Compared Products-->
<remove name="right.poll"/><!--Poll-->

<remove name="left.newsletter"/><!--Sidebar Newsletter-->
<remove name="left.permanent.callout"/><!--Left Callout Sample Data-->

<remove name="wishlist_sidebar"/><!--Wishlist Sidebar-->
<remove name="paypal.partner.right.logo"/><!--Paypal logo Sample Data-->

<remove name="tags_popular"/><!--Popular Tags-->
<remove name="cart_sidebar"/><!--Cart sidebar-->

</default>

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...