Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Create An Addon As A New Block Rate Topic   - - - - -

 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 26 August 2015 - 11:06 AM #1

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.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19833 posts

Posted 26 August 2015 - 11:21 AM #2

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 26 August 2015 - 12:34 PM #3

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.
 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19833 posts

Posted 26 August 2015 - 03:51 PM #4

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

 

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 27 August 2015 - 10:30 AM #5

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.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19833 posts

Posted 27 August 2015 - 12:13 PM #6

You are welcome!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 01 September 2015 - 07:15 AM #7

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.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19833 posts

Posted 01 September 2015 - 08:26 AM #8

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.