Create new addons

Addons allow easy modification, customization, and enhancement of a design tool. Instead of changing the core programming of design tool, you can add functionality with addon.

Step by step to create addon of T-Shirt eCommerce

Addons Files:

  • tshirtecommerce/addons/css/your-file.css

[sourcecode language=”plain”]
//Your CSS
[/sourcecode]

  • tshirtecommerce/addons/js/your-file.js

You can use all hooks in this file.

[code lang=”js”]
// url use with ajax call to file tshirtecommerce/addons/ajax/method.php
var url = siteURL + "ajax.php?type=method&params=string";

//Your code
[/code]

  • tshirtecommerce/addons/language/language.ini

[sourcecode language=”plain”]
my_addon_title="My Addon"
[/sourcecode]

  • tshirtecommerce/addons/ajax/method.php

[php]

// read language
$addons = $GLOBALS[‘addons’];
echo $addon->__(‘my_addon_title’);

// call settings
$settings = $GLOBALS[‘settings’];

// call product
$product = $GLOBALS[‘product’];
[/php]

  • wp-content/plugins/tshirtecommerce/includes/file.php

You can use all hooks, action of wordpress

 

Note: Please look more files in folder: tshirtecommerce/addons