Creating A Functional Button

[quote name='wjdwndud' timestamp='1435601912' post='220894']

  1. How do I check if the controller is being called?

    [/quote]



    Add the following line of code to the controller:



fn_print_die($_REQUEST);




And run the following URL in the browser



http://you_domian.com/index.php?dispatch=myaddon.button&product_id=111&user_id=222



[quote name='wjdwndud' timestamp='1435601912' post='220894']

2. Why do I need both frontend and common folder for the controllers for cscart to find them?

[/quote]



It is not necessary condition. Looks like permissions issue.


[quote name='wjdwndud' timestamp='1435601912' post='220894']

3. How do I check if any of my files are not working or returns an error because of wrong syntax and such?

[/quote]



In the config.local.php file replace:



error_reporting(E_ALL);
ini_set('display_errors', 0);




with



error_reporting(E_ALL);
ini_set('display_errors', 1);
define('DEVELOPMENT', true);



[quote name='wjdwndud' timestamp='1435611845' post='220903']

Also, What does


if (!defined('BOOTSTRAP')) { die('Access denied'); }


check for? The init.php, func.php, and controllers have them

[/quote]



This string is required to restrict direct access to the file. E.g.



http://domain.com/app/addons/myaddon/controllers/frontend/myyaddon.php