Showing posts with label magento frontend developer. Show all posts
Showing posts with label magento frontend developer. Show all posts

Monday, 16 February 2015

Show Address Fields in Customer Registration - Magento

show address field in signup form magento

In order to show address fields in Magento customer registration forms you only need to enable the attribute 
setShowAddressField.

To do so either add the following in your template local.xml(/app/design/frontend/base/default/layout/local.xml):
1
2
3
4
5
6
<customer_account_create>
  <reference name="customer_form_register">  
    <action method="setShowAddressFields">
      <param>true</param></action>   
  </reference>
</customer_account_create>
As always, make sure to reload your cache afterwards.
This setting will enable to execution of
1
<?php if($this->getShowAddressFields()): ?>
in register.phtml (/app/design/frontend/base/default/template/customer/form/register.phtml).

Sunday, 26 October 2014

Call / Get static block as html in a phtml file Magento

It regularly happens that Magento webshop administrators like to mention additional information on a product page. Think about upfront shipping information or extra service information to gain trust from the potential customer. Magento does not provide a default option for this. You could insert it within the product (short) description but then you should repeat/change this for every product. So, that's not a practical option.


You can add call it two way:

Option 1

In the layout (app/design/frontend/your_theme/layout/default.xml):
<default>
    <cms_page> <!-- need to be redefined for your needs -->
        <reference name="content">
            <block type="cms/block" name="cms_newest_product" as="cms_newest_product">
                <action method="setBlockId"><block_id>newest_product</block_id></action>
            </block>
        </reference>
    </cms_page>
</default>
In your phtml template:
<?php echo $this->getChildHtml('newest_product'); ?>




Option 2

Following code will work when you Call CMS-Static Block directly from .phtml file in Magento.
<?php echo 

$this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml();

?>

 


Fix The Magento. All rights reserved. ©