Editing Extensions and Widgets Creation
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{#seo:|title=Extensions and Widgets Creation }} | |||
{{#seo:|description=his page describes the process of creating extensions and Widgets on the osCommerce version 4.x website.}} | |||
{{#seo:|keywords=Extension, Widget, Create}} | |||
'''Note: This manual is for osCommerce v4.''' | '''Note: This manual is for osCommerce v4.''' | ||
'''Basic Provisions:''' | <h2>'''Basic Provisions:'''</h2> | ||
# All extensions must be placed in separate folder. | # <h3>All extensions must be placed in separate folder.</h3> | ||
# The class file name must be the same as the folder name. | # <h3>The class file name must be the same as the folder name.</h3> | ||
# Templates must be placed in folder 'views'. | # <h3>Templates must be placed in folder 'views'.</h3> | ||
//additional | <h4>//additional</h4> | ||
if you want to use widgets in extensions | <h4>if you want to use widgets in extensions</h4> | ||
1. Add method getWidgets with $type parameter and describe widgets in array | <h3>1. Add method getWidgets with $type parameter and describe widgets in array</h3> | ||
example: | <h4>example:</h4> | ||
return [ | return [ | ||
Line 24: | Line 27: | ||
]; | ]; | ||
in this case ShoppingCart (in subfolder \ShoppingCart) is widget ( ShoppingCart.php) can be used in customizing Themes | <h4>in this case ShoppingCart (in subfolder \ShoppingCart) is widget ( ShoppingCart.php) can be used in customizing Themes</h4> | ||
2. to show additional settings for widget use method showSettings | <h3>2. to show additional settings for widget use method showSettings</h3> | ||
example: | <h4>example:</h4> | ||
public static function showSettings($settings){ | public static function showSettings($settings){ | ||
Line 36: | Line 39: | ||
} | } | ||
extension installer: | <h4>extension installer:</h4> | ||
1) extends \common\classes\modules\ModuleExtensions | <h3>1) extends \common\classes\modules\ModuleExtensions</h3> | ||
2) install (example) | <h3>2) install (example)</h3> | ||
public function install($platform_id){ | public function install($platform_id){ | ||
Line 60: | Line 63: | ||
} | } | ||
2) check extension enabled - use \common\helpers\Acl::checkExtensionAllowed($extName, 'allowed') | <h3>2) check extension enabled - use \common\helpers\Acl::checkExtensionAllowed($extName, 'allowed')</h3> | ||
public static function allowed() { | public static function allowed() { |