How To Create An Addon As A New Block

Hi,

I created a new addon. It was working well when it was installed from the admin panel.

Now i want to convert my new addon as a block, Which i can add it in any grid from the administration panel.

I want to work my new addon as a block {eg., just like the Currencies, Checkout, Gift Certificates, My Account...etc present in the new block categories of the blocks present in the layout page of the admin panel}, So that i want to install my addon in a particular grid only which i was selected.

Please help me to fix this issue, It is a very high priority to me. Thanks in advance.

Regards,

Satya.

To create a new status block just create the following file:

design\themes\YOUR_THEME\templates\addons\YOUR_ADDON\blocks\static_templates\my_custom_block.tpl

Then clear the cache. The new block will be available in the list of templates for the block with the Template filling type

To create a new status block just create the following file:

design\themes\YOUR_THEME\templates\addons\YOUR_ADDON\blocks\static_templates\my_custom_block.tpl

Then clear the cache. The new block will be available in the list of templates for the block with the Template filling type

Hi eComLabs,

As per your suggestion, I created the coupon_promotions.tpl file in the following location,

design\themes\responsive\templates\addons\MY_ADDON\blocks\static_templates\coupon_promotions.tpl

the code in that file is as follows,

{** block-description:coupon_promotion **}

{include file="hooks/checkout/applied_discount_coupons.post.tpl" location="sidebox" additional_id=$block.block_id}

And i cleared the cache, But still it was not appearing in the new blocks section.

Please help me to resolve the issue.

Regards,

Satya.

Please select Template at first (see at the bottom right section)

http://clip2net.com/s/3mEteHe

Please select Template at first (see at the bottom right section)

http://clip2net.com/s/3mEteHe

Hi eComLabs,

Thank's a lot for your support. It works nice... :-)

Regards,

Satya.

You are welcome!

You are welcome!

Hi eComLabs,

Once again thanks for your help. Now i need to know how this Newly Created Block is placed automatically in the Sidebox Grid of the Checkout Page Layout, Whenever the addon is installed.

Please do this help to me.

Regards,

Satya.

You can export the layout for the checkout page, rename the generated file to layouts.xml and put it to the add-on directory. Here are some examples:

app\addons\blog\layouts.xml

app\addons\gift_certificates\layouts.xml

But please note if the custom layout is used by the customer, it will be overrided by the new one