Web Dev
Web Dev

Reputation: 67

Magento how to call phtml file as a block on cms page?

I am using magento 1.9.1 and trying to create a product link directly on cms page.I have created a custombutton.phtml file and add button code here.

<?php $formKey = Mage::getSingleton('core/session')->getFormKey(); ?>
<a class="animated infinite swing btn btn-yellow btn-lg m-r-2" role="button" href="abc.com/checkout/cart/add?product=401&qty=1&form_key=<?php echo $formKey ?>">Add to cart</a>

Now i am calling this phtml file as block on cms page.

  {{block type="core/template" name="custombutton" template="custombutton.phtml"}}

But sometimes it is showing button and sometimes not. Not getting the issue.

Upvotes: 0

Views: 1122

Answers (1)

MagentoDeveloper
MagentoDeveloper

Reputation: 38

Please give rights to block goto->system->permissions->block and add your block name. Hope this helps

Upvotes: 0

Related Questions