Editing
Extensions and Widgets Creation
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
'''Note: This manual is for osCommerce v4.''' '''Basic Provisions:''' # All extensions must be placed in separate folder. # The class file name must be the same as the folder name. # Templates must be placed in folder 'views'. //additional if you want to use widgets in extensions 1. Add method getWidgets with $type parameter and describe widgets in array example: return [ [ 'name' => 'CustomerLoyalty\ShoppingCart', 'title' => 'Customer Loyalty Info Box', 'description' => <nowiki>''</nowiki>, 'type' => 'cart', ], ]; in this case ShoppingCart (in subfolder \ShoppingCart) is widget ( ShoppingCart.php) can be used in customizing Themes 2. to show additional settings for widget use method showSettings example: public static function showSettings($settings){ return self::begin()->render('settings.tpl', ['settings' => $settings]); } extension installer: 1) extends \common\classes\modules\ModuleExtensions 2) install (example) public function install($platform_id){ parent::install($platform_id);// install in liek other modules // install extention envirenment $migration = new \common\classes\Migration; $migration->addTranslation(['admin/main'], [ //add keys ]); return; } 2) check extension enabled - use \common\helpers\Acl::checkExtensionAllowed($extName, 'allowed') public static function allowed() { return self::enabled(); }
Summary:
Please note that all contributions to osCommerce Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
OsCommerce Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information