{"id":70059,"date":"2017-01-05T08:49:12","date_gmt":"2017-01-05T08:49:12","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=70059"},"modified":"2021-07-16T12:15:17","modified_gmt":"2021-07-16T12:15:17","slug":"create-first-basic-module-opencart","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/","title":{"rendered":"Create your first basic module in Opencart"},"content":{"rendered":"\n<p>The Opencart is&nbsp;one of the&nbsp;great examples of MVC framework as it provides separate folders for controller,&nbsp;model, view and language.&nbsp;In order to start creating your first Opencart module, you must know the basic fundamentals of Opencart. You can learn the basic fundamentals of Opencart by visiting <a href=\"http:\/\/docs.opencart.com\/\" target=\"_blank\" rel=\"noopener\">Opencart documentation<\/a>. For creating&nbsp;a module in Opencart, you have to follow a directory structure. You can learn about the directory structure <a href=\"http:\/\/docs.opencart.com\/developer\/module\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n\n\n\n<p>So, in order to start module development in&nbsp;Opencart, you have to create a file in module folder of each controller, language and view. You don&#8217;t need to create a model file in module development as your values of the module will be stored in a table named setting. The queries for saving the values in setting table is written in admin-&gt;model-&gt;setting-&gt;setting.php&nbsp;file.<\/p>\n\n\n\n<p>We will first learn the module development in Opencart 2.2.0.0.&nbsp;The development details and change in the code according to other versions will be provided&nbsp;in the comments part of the code provided by us.<\/p>\n\n\n\n<p>First, we will create the module&#8217;s language file named first_module.php in admin-&gt;language-&gt;en-gb-&gt;module folder. This path will be for the Opencart version 2.2.0.0. For Opencart version 2.3.0.0 and above, we have to create the file in admin-&gt;language-&gt;en-gb-&gt;extension-&gt;module. For Opencart version under 2.2.0.0, we have to create the file in admin-&gt;language-&gt;english-&gt;module.<\/p>\n\n\n\n<p>In this file, we will assign the languages to the indexes of an array. Please mind that $_ is the name of the array. Here, is the language, we shall need in the module creation.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category Webkul\n * @package Opencart Module Tutorial\n * @author Webkul\n * @copyright Copyright (c) 2010-2016 Webkul Software Private Limited (https:\/\/webkul.com)\n * @license https:\/\/store.webkul.com\/license.html\n *\/\n\/\/ Heading\n$_['heading_title']    = 'First Module';\n\n$_['text_module']      = 'Modules';\n$_['text_success']     = 'Success: You have modified \"First Module\" module!';\n$_['text_edit']        = 'Edit \"First Module\" Module';\n\n\/\/ Entry\n$_['entry_status']     = 'Status';\n\n\/\/ Error\n$_['error_permission'] = 'Warning: You do not have permission to modify \"First Module\" module!';<\/pre>\n\n\n\n<p>After creating&nbsp;the language, we will head towards the controller. So, we will&nbsp;create a file named first_module.php in admin-&gt;controller-&gt;module folder. For 2.3.0.0 and upper versions, you have to&nbsp;create the file in admin-&gt;controller-&gt;extension-&gt;module folder.<\/p>\n\n\n\n<p>Here, I&#8217;m providing the controller code along with the comments.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category Webkul\n * @package Opencart Module Tutorial\n * @author Webkul\n * @copyright Copyright (c) 2010-2016 Webkul Software Private Limited (https:\/\/webkul.com)\n * @license https:\/\/store.webkul.com\/license.html\n *\/\n\/**\n * The controller class must extend the parent class i.e. Controller\n * The controller name must be like Controller + directory path (with first character of each folder in capital) + file name (with first character in capital)\n * For version 2.3.0.0 and upper, the name of the controller must be ControllerExtensionModuleFirstModule\n *\/\nclass ControllerModuleFirstModule extends Controller {\n\t\/**\n\t * property named $error is defined to put errors\n\t * @var array\n\t *\/\n\tprivate $error = array();\n\t\/**\n\t * Basic function of the controller. This can be called using route=module\/first_module\n\t *\/\n\tpublic function index() {\n\t\t\/**\n\t\t * Loads the language file. Path of the file along with file name must be given\n\t\t *\/\n\t\t$this-&gt;load-&gt;language('module\/first_module');\n\t\t\/**\n\t\t * Sets the title to the html page\n\t\t *\/\n\t\t$this-&gt;document-&gt;setTitle($this-&gt;language-&gt;get('heading_title'));\n\t\t\/**\n\t\t * Loads the model file. Path of the file to be given\n\t\t *\/\n\t\t$this-&gt;load-&gt;model('setting\/setting');\n\t\t\/**\n\t\t * Checks whether the request type is post. If yes, then calls the validate function.\n\t\t *\/\n\t\tif (($this-&gt;request-&gt;server['REQUEST_METHOD'] == 'POST') &amp;&amp; $this-&gt;validate()) {\n\t\t\t\/**\n\t\t\t * The function named 'editSetting' of a model is called in this way\n\t\t\t * The first argument is the code of the module and the second argument contains all the post values\n\t\t\t * The code must be same as your file name\n\t\t\t *\/\n\t\t\t$this-&gt;model_setting_setting-&gt;editSetting('first_module', $this-&gt;request-&gt;post);\n\t\t\t\/**\n\t\t\t * The success message is kept in the session\n\t\t\t *\/\n\t\t\t$this-&gt;session-&gt;data['success'] = $this-&gt;language-&gt;get('text_success');\n\t\t\t\/**\n\t\t\t * The redirection works in this way.\n\t\t\t * After insertion of data, it will redirect to extension\/module file along with the token\n\t\t\t * The success message will be shown there\n\t\t\t *\/\n\t\t\t$this-&gt;response-&gt;redirect($this-&gt;url-&gt;link('extension\/module', 'token=' . $this-&gt;session-&gt;data['token'], true));\n\t\t}\n\t\t\/**\n\t\t * Putting the language into the '$data' array\n\t\t * This is the way how you get the language from the language file\n\t\t *\/\n\t\t$data['heading_title'] = $this-&gt;language-&gt;get('heading_title');\n\n\t\t$data['text_edit'] = $this-&gt;language-&gt;get('text_edit');\n\t\t$data['text_enabled'] = $this-&gt;language-&gt;get('text_enabled');\n\t\t$data['text_disabled'] = $this-&gt;language-&gt;get('text_disabled');\n\n\t\t$data['entry_status'] = $this-&gt;language-&gt;get('entry_status');\n\n\t\t$data['button_save'] = $this-&gt;language-&gt;get('button_save');\n\t\t$data['button_cancel'] = $this-&gt;language-&gt;get('button_cancel');\n\t\t\/**\n\t\t * If there is any warning in the private property '$error', then it will be put into '$data' array\n\t\t *\/\n\t\tif (isset($this-&gt;error['warning'])) {\n\t\t\t$data['error_warning'] = $this-&gt;error['warning'];\n\t\t} else {\n\t\t\t$data['error_warning'] = '';\n\t\t}\n\t\t\/**\n\t\t * Breadcrumbs are declared as array\n\t\t *\/\n\t\t$data['breadcrumbs'] = array();\n\t\t\/**\n\t\t * Breadcrumbs are defined\n\t\t *\/\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' =&gt; $this-&gt;language-&gt;get('text_home'),\n\t\t\t'href' =&gt; $this-&gt;url-&gt;link('common\/dashboard', 'token=' . $this-&gt;session-&gt;data['token'], true)\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' =&gt; $this-&gt;language-&gt;get('text_module'),\n\t\t\t'href' =&gt; $this-&gt;url-&gt;link('extension\/module', 'token=' . $this-&gt;session-&gt;data['token'], true)\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' =&gt; $this-&gt;language-&gt;get('heading_title'),\n\t\t\t'href' =&gt; $this-&gt;url-&gt;link('module\/first_module', 'token=' . $this-&gt;session-&gt;data['token'], true)\n\t\t);\n\t\t\/**\n\t\t * Form action url is created and defined to $data['action']\n\t\t *\/\n\t\t$data['action'] = $this-&gt;url-&gt;link('module\/first_module', 'token=' . $this-&gt;session-&gt;data['token'], true);\n\t\t\/**\n\t\t * Cancel\/back button url which will lead you to module list\n\t\t *\/\n\t\t$data['cancel'] = $this-&gt;url-&gt;link('extension\/module', 'token=' . $this-&gt;session-&gt;data['token'], true);\n\t\t\/**\n\t\t * checks whether the value exists in the post request\n\t\t *\/\n\t\tif (isset($this-&gt;request-&gt;post['first_module_status'])) {\n\t\t\t$data['first_module_status'] = $this-&gt;request-&gt;post['first_module_status'];\n\t\t} else {\n\t\t\/**\n\t\t * if the value do not exists in the post request then value is taken from the config i.e. setting table\n\t\t *\/\n\t\t\t$data['first_module_status'] = $this-&gt;config-&gt;get('first_module_status');\n\t\t}\n\t\t\/**\n\t\t * Header data is loaded\n\t\t *\/\n\t\t$data['header'] = $this-&gt;load-&gt;controller('common\/header');\n\t\t\/**\n\t\t * Column left part is loaded\n\t\t *\/\n\t\t$data['column_left'] = $this-&gt;load-&gt;controller('common\/column_left');\n\t\t\/**\n\t\t * Footer data is loaded\n\t\t *\/\n\t\t$data['footer'] = $this-&gt;load-&gt;controller('common\/footer');\n\t\t\/**\n\t\t * Using this function tpl file is called and all the data of controller is passed through '$data' array\n\t\t * This is for Opencart 2.2.0.0 version. There will be minor changes as per the version.\n\t\t *\/\n\t\t$this-&gt;response-&gt;setOutput($this-&gt;load-&gt;view('module\/first_module', $data));\n\t}\n\t\/**\n\t * validate function validates the values of the post and also the permission\n\t * @return boolean return true if any of the index of $error contains value\n\t *\/\n\tprotected function validate() {\n\t\t\/**\n\t\t * Check whether the current user has the permissions to modify the settings of the module\n\t\t * The permissions are set in System-&gt;Users-&gt;User groups\n\t\t *\/\n\t\tif (!$this-&gt;user-&gt;hasPermission('modify', 'module\/first_module')) {\n\t\t\t$this-&gt;error['warning'] = $this-&gt;language-&gt;get('error_permission');\n\t\t}\n\n\t\treturn !$this-&gt;error;\n\t}\n}<\/pre>\n\n\n\n<p>With the above code, you would learn many other things about the Opencart as well like how to load language, model etc and how to make their use.<\/p>\n\n\n\n<p>After the controller, we have to go for the view file. So, we will&nbsp;create a file named first_module.tpl in admin-&gt;view-&gt;template-&gt;module folder. For 2.3.0.0 and upper versions, you have to&nbsp;create the file in admin-&gt;view-&gt;template-&gt;extension-&gt;module folder.<\/p>\n\n\n\n<p>Here&#8217;s the&nbsp;view file code.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;!-- \n\/**\n * Webkul Software.\n *\n * @category Webkul\n * @package Opencart Module Tutorial\n * @author Webkul\n * @copyright Copyright (c) 2010-2016 Webkul Software Private Limited (https:\/\/webkul.com)\n * @license https:\/\/store.webkul.com\/license.html\n *\/\n --&gt;\n&lt;!-- merging the 'header' and 'column left' part with this template --&gt;\n&lt;?php echo $header; ?&gt;&lt;?php echo $column_left; ?&gt;\n&lt;div id=\"content\"&gt;\n  &lt;div class=\"page-header\"&gt;\n    &lt;div class=\"container-fluid\"&gt;\n      &lt;div class=\"pull-right\"&gt;\n        &lt;!-- Form submit button --&gt;\n        &lt;button type=\"submit\" form=\"form-first-module\" data-toggle=\"tooltip\" title=\"&lt;?php echo $button_save; ?&gt;\" class=\"btn btn-primary\"&gt;&lt;i class=\"fa fa-save\"&gt;&lt;\/i&gt;&lt;\/button&gt;\n        &lt;!-- Back button --&gt;\n        &lt;a href=\"&lt;?php echo $cancel; ?&gt;\" data-toggle=\"tooltip\" title=\"&lt;?php echo $button_cancel; ?&gt;\" class=\"btn btn-default\"&gt;&lt;i class=\"fa fa-reply\"&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/div&gt;\n      &lt;!-- Heading is mentioned here --&gt;\n      &lt;h1&gt;&lt;?php echo $heading_title; ?&gt;&lt;\/h1&gt;\n      &lt;!-- Breadcrumbs are listed here --&gt;\n      &lt;ul class=\"breadcrumb\"&gt;\n        &lt;?php foreach ($breadcrumbs as $breadcrumb) { ?&gt;\n        &lt;li&gt;&lt;a href=\"&lt;?php echo $breadcrumb['href']; ?&gt;\"&gt;&lt;?php echo $breadcrumb['text']; ?&gt;&lt;\/a&gt;&lt;\/li&gt;\n        &lt;?php } ?&gt;\n      &lt;\/ul&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div class=\"container-fluid\"&gt;\n    &lt;!-- if it contains a warning then it will be visible as an alert --&gt;\n    &lt;?php if ($error_warning) { ?&gt;\n    &lt;div class=\"alert alert-danger\"&gt;&lt;i class=\"fa fa-exclamation-circle\"&gt;&lt;\/i&gt; &lt;?php echo $error_warning; ?&gt;\n      &lt;button type=\"button\" class=\"close\" data-dismiss=\"alert\"&gt;&amp;times;&lt;\/button&gt;\n    &lt;\/div&gt;\n    &lt;?php } ?&gt;\n    &lt;div class=\"panel panel-default\"&gt;\n      &lt;div class=\"panel-heading\"&gt;\n        &lt;h3 class=\"panel-title\"&gt;&lt;i class=\"fa fa-pencil\"&gt;&lt;\/i&gt; &lt;?php echo $text_edit; ?&gt;&lt;\/h3&gt;\n      &lt;\/div&gt;\n      &lt;div class=\"panel-body\"&gt;\n        &lt;!-- form starts here --&gt;\n        &lt;form action=\"&lt;?php echo $action; ?&gt;\" method=\"post\" enctype=\"multipart\/form-data\" id=\"form-first-module\" class=\"form-horizontal\"&gt;\n          &lt;div class=\"form-group\"&gt;\n            &lt;!-- Entry label is mentioned here --&gt;\n            &lt;label class=\"col-sm-2 control-label\" for=\"input-status\"&gt;&lt;?php echo $entry_status; ?&gt;&lt;\/label&gt;\n            &lt;div class=\"col-sm-10\"&gt;\n              &lt;!-- The name of the form inputs must start with the controller file name followed by a underscore\n              like in this case \"first_module_\" after that status is added --&gt;\n              &lt;select name=\"first_module_status\" id=\"input-status\" class=\"form-control\"&gt;\n                &lt;?php if ($first_module_status) { ?&gt;\n                &lt;option value=\"1\" selected=\"selected\"&gt;&lt;?php echo $text_enabled; ?&gt;&lt;\/option&gt;\n                &lt;option value=\"0\"&gt;&lt;?php echo $text_disabled; ?&gt;&lt;\/option&gt;\n                &lt;?php } else { ?&gt;\n                &lt;option value=\"1\"&gt;&lt;?php echo $text_enabled; ?&gt;&lt;\/option&gt;\n                &lt;option value=\"0\" selected=\"selected\"&gt;&lt;?php echo $text_disabled; ?&gt;&lt;\/option&gt;\n                &lt;?php } ?&gt;\n              &lt;\/select&gt;\n            &lt;\/div&gt;\n          &lt;\/div&gt;\n        &lt;\/form&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;!-- merges the footer with the template --&gt;\n&lt;?php echo $footer; ?&gt;<\/pre>\n\n\n\n<p>So, here we&nbsp;complete with the module coding part. Now, you have to visit Extensions-&gt;Modules, where you can see the &#8220;First Module&#8221; in the modules listing. From there you can&nbsp;install the module and then configure it.<\/p>\n\n\n\n<p>You can also&nbsp;optimise your code by following <a href=\"http:\/\/webkul.com\/blog\/optimize-your-opencart-code\/\">this<\/a>.<\/p>\n\n\n\n<p>Hope, you learn something from this blog. Keep following our blog, to know more about the Opencart.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Opencart is&nbsp;one of the&nbsp;great examples of MVC framework as it provides separate folders for controller,&nbsp;model, view and language.&nbsp;In order to start creating your first Opencart module, you must know the basic fundamentals of Opencart. You can learn the basic fundamentals of Opencart by visiting Opencart documentation. For creating&nbsp;a module in Opencart, you have to <a href=\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":70,"featured_media":41008,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4300,4299,2059,2071],"class_list":["post-70059","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-basic","tag-beginner","tag-module","tag-opencart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create your first basic module in Opencart - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create your first basic module in Opencart - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"The Opencart is&nbsp;one of the&nbsp;great examples of MVC framework as it provides separate folders for controller,&nbsp;model, view and language.&nbsp;In order to start creating your first Opencart module, you must know the basic fundamentals of Opencart. You can learn the basic fundamentals of Opencart by visiting Opencart documentation. For creating&nbsp;a module in Opencart, you have to [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-05T08:49:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-16T12:15:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vikhyat Sharma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vikhyat Sharma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\"},\"author\":{\"name\":\"Vikhyat Sharma\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/af7160d2546c64a1856ab1b5ce77d9b0\"},\"headline\":\"Create your first basic module in Opencart\",\"datePublished\":\"2017-01-05T08:49:12+00:00\",\"dateModified\":\"2021-07-16T12:15:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\"},\"wordCount\":508,\"commentCount\":14,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"keywords\":[\"basic\",\"beginner\",\"module\",\"opencart\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\",\"url\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\",\"name\":\"Create your first basic module in Opencart - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"datePublished\":\"2017-01-05T08:49:12+00:00\",\"dateModified\":\"2021-07-16T12:15:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"width\":825,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create your first basic module in Opencart\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/af7160d2546c64a1856ab1b5ce77d9b0\",\"name\":\"Vikhyat Sharma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7c9c700cc2d7120c9faf1ab3392b4e533808ba197f58c0441d6caecc68179e12?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7c9c700cc2d7120c9faf1ab3392b4e533808ba197f58c0441d6caecc68179e12?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Vikhyat Sharma\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/vikhyat-sharma83\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create your first basic module in Opencart - Webkul Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/","og_locale":"en_US","og_type":"article","og_title":"Create your first basic module in Opencart - Webkul Blog","og_description":"The Opencart is&nbsp;one of the&nbsp;great examples of MVC framework as it provides separate folders for controller,&nbsp;model, view and language.&nbsp;In order to start creating your first Opencart module, you must know the basic fundamentals of Opencart. You can learn the basic fundamentals of Opencart by visiting Opencart documentation. For creating&nbsp;a module in Opencart, you have to [...]","og_url":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2017-01-05T08:49:12+00:00","article_modified_time":"2021-07-16T12:15:17+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","type":"image\/png"}],"author":"Vikhyat Sharma","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Vikhyat Sharma","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/"},"author":{"name":"Vikhyat Sharma","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/af7160d2546c64a1856ab1b5ce77d9b0"},"headline":"Create your first basic module in Opencart","datePublished":"2017-01-05T08:49:12+00:00","dateModified":"2021-07-16T12:15:17+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/"},"wordCount":508,"commentCount":14,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","keywords":["basic","beginner","module","opencart"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/","url":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/","name":"Create your first basic module in Opencart - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","datePublished":"2017-01-05T08:49:12+00:00","dateModified":"2021-07-16T12:15:17+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","width":825,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create your first basic module in Opencart"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/af7160d2546c64a1856ab1b5ce77d9b0","name":"Vikhyat Sharma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7c9c700cc2d7120c9faf1ab3392b4e533808ba197f58c0441d6caecc68179e12?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7c9c700cc2d7120c9faf1ab3392b4e533808ba197f58c0441d6caecc68179e12?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Vikhyat Sharma"},"url":"https:\/\/webkul.com\/blog\/author\/vikhyat-sharma83\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/70059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=70059"}],"version-history":[{"count":5,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/70059\/revisions"}],"predecessor-version":[{"id":296530,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/70059\/revisions\/296530"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/41008"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=70059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=70059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=70059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}