Jump to content

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

How To Add A Custom Admin Page To My Addon?

 
  • bububeti
  • Member
  • Trial users
  • Join Date: 28-Aug 20
  • 24 posts

Posted 06 September 2020 - 11:14 AM #1

I want to have two separate pages for my addon. One with settings and one with an input field (this will send a message). I know how to build the settings page, but I need a way to add a custom page to my addon right under the settings page. 

Why I need a separate page? Because this page will not have any settings in it. I will load a TPL file that will build a custom message based on the user input when it presses a custom made send button as well as other functionalities.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12107 posts

Posted 06 September 2020 - 06:16 PM #2

Have you read the developer documentation?

Basically every "mode" of a controller (addon) can have a corresponding template file that is loaded when the controller completes.

 

Most common template files that map to modes are:

+ manage

+ update

+ edit

+ import

+ etc

 

Hence a ?dispatch=my_addon.edit&id=123 would first execute app/addons/my_addon/controllers/backend/my_addon.php

It would act on the $mode, setting template variables, validating security, etc.

When my_addon.php returns, then design/backend/addons/my_addon/views/my_addon/edit.tpl would be loaded with the template variables set from my_addon.php.

 

For details, read the documentation. 


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • bububeti
  • Member
  • Trial users
  • Join Date: 28-Aug 20
  • 24 posts

Posted 08 September 2020 - 08:53 AM #3

Can you share the link to the docs that give more info about this? I know that my_addon.php is a controler but how it will run in the first place? I need to manualy add a button in the setting page that will redirect the user to that specific url?



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12107 posts

Posted 08 September 2020 - 05:50 PM #4

Just google "cs-cart developer documentation"


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • bububeti
  • Member
  • Trial users
  • Join Date: 28-Aug 20
  • 24 posts

Posted 09 September 2020 - 06:16 AM #5

I did and found it, but it says nothing clear about it... I read this but it says nothing about how to make the user go to that special link. https://docs.cs-cart...lers/index.html



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12107 posts

Posted 09 September 2020 - 08:19 PM #6

I explained in in #2 above.  It is not a 'link', it is a page within the controller (addon) based on the 'mode' passed to the controller.  Just go look at other addons that have multiple 'modes'.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • bububeti
  • Member
  • Trial users
  • Join Date: 28-Aug 20
  • 24 posts

Posted 14 September 2020 - 09:24 AM #7

Can you give me an example of such an addon? what I was able to find was only .post and .pre controllers



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12107 posts

Posted 14 September 2020 - 07:32 PM #8

Suggest you review an addon like app/addons/reward_points and follow the logic through and then go to the design/backend/templates/addons/reward_points and again follow the logic based on the 'mode' being used in the controller.  You will have pre/post controllers for other addons/controllers.  The controller for the specific addon will be named 'your_addon.php' where 'your_addon' is the name of your addon.

 

If you want, you can also hire an experienced developer to do what you need.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.