{"id":305689,"date":"2021-09-16T13:08:02","date_gmt":"2021-09-16T13:08:02","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=305689"},"modified":"2021-09-16T13:08:06","modified_gmt":"2021-09-16T13:08:06","slug":"create-your-own-console-command-in-prestashop-1-7","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/","title":{"rendered":"Create your own console command in PrestaShop 1.7"},"content":{"rendered":"\n<p>In this blog, we are going to learn how to create your own console command in PrestaShop. PrestaShop uses the <a href=\"https:\/\/symfony.com\/doc\/current\/components\/console.html\" target=\"_blank\" rel=\"noreferrer noopener\">Symfony Console<\/a> component and provides its own set of <a href=\"https:\/\/devdocs.prestashop.com\/1.7\/development\/components\/console\/\" target=\"_blank\" rel=\"noreferrer noopener\">commands<\/a>.<\/p>\n\n\n\n<p>Since version 1.7 of PrestaShop, you have access to the PrestaShop console using the following instruction in a terminal:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">.\/bin\/console<\/pre>\n\n\n\n<p>You can list all available commands in PrestaShop using the below command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/console list<\/pre>\n\n\n\n<p>If you want to manage your modules via command line, you can write the command in the below format:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/console prestashop:module &lt;action&gt; &lt;module-name&gt; &#091;&lt;file-path&gt;]<\/pre>\n\n\n\n<p>Where:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Argument<\/td><td>Description<\/td><\/tr><tr><td>action<\/td><td>Action to execute (Allowed actions: install \/ uninstall \/ enable \/ disable \/ enable_mobile \/ disable_mobile \/ reset \/ upgrade \/ configure).<\/td><\/tr><tr><td>module-name<\/td><td>The module on which action will be executed<\/td><\/tr><tr><td>file-path<\/td><td>YML file path for configuration<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>ie.<\/strong> If you want to disable the newsletter module, you need to write the below command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/console prestashop:module disable ps_emailsubscription<\/pre>\n\n\n\n<p>You will get the below message on the console once this module has been disabled:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">Disable action on module ps_emailsubscription succeeded.<\/pre>\n\n\n\n<p>Since version 1.7.5, you can create your own console command in PrestaShop using modules. So let&#8217;s create a module to list the details of registered customers in the PrestaShop.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Create a console command in the module<\/h2>\n\n\n\n<p>Let&#8217;s say the module name is &#8220;customerconsolecommand&#8221; and the module folder structure is:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">customerconsolecommand\r\n|\r\n+---config\r\n|       |- index.php\r\n|       |- services.yml\r\n|       \r\n\\---src\r\n|    |- index.php\r\n|    |   \r\n|    \\---Command\r\n|           |- index.php\r\n|           |- ListCustomersCommand.php\r\n|\r\n|- composer.json\r\n|- customerconsolecommand.php\r\n|- index.php\r\n|- logo.png<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Create composer file<\/h3>\n\n\n\n<p>First of all, you need to create a composer file &#8216;composer.json&#8217;:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">{\r\n    &quot;name&quot;: &quot;webkul\/customerconsolecommand&quot;,\r\n    &quot;license&quot;: &quot;AFL-3.0&quot;,\r\n    &quot;authors&quot;: &#091;\r\n        {\r\n            &quot;name&quot;: &quot;Webkul IN&quot;,\r\n            &quot;email&quot;: &quot;test@webkul.com&quot;\r\n        },\r\n        {\r\n            &quot;name&quot;: &quot;Webkul IN&quot;\r\n        }\r\n    ],\r\n    &quot;autoload&quot;: {\r\n        &quot;psr-4&quot;: {\r\n            &quot;PrestaShop\\\\Module\\\\CustomerConsoleCommand\\\\&quot;: &quot;src\/&quot;\r\n        },\r\n        &quot;config&quot;: {\r\n            &quot;prepend-autoloader&quot;: false\r\n        },\r\n        &quot;type&quot;: &quot;prestashop-module&quot;\r\n    }\r\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Create main module file<\/h3>\n\n\n\n<p>Module main file name will be &#8216;customerconsolecommand.php&#8217;:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\r\n\r\nif (!defined(&#039;_PS_VERSION_&#039;)) {\r\n    exit;\r\n}\r\n\r\nrequire_once __DIR__.&#039;\/vendor\/autoload.php&#039;;\r\n\r\nclass CustomerConsoleCommand extends Module\r\n{\r\n    public function __construct()\r\n    {\r\n        $this-&gt;name = &#039;customerconsolecommand&#039;;\r\n        $this-&gt;author = &#039;Webkul&#039;;\r\n        $this-&gt;version = &#039;1.0.0&#039;;\r\n        $this-&gt;ps_versions_compliancy = array(&#039;min&#039; =&gt; &#039;1.7.7.0&#039;, &#039;max&#039; =&gt; _PS_VERSION_);\r\n\r\n        parent::__construct();\r\n\r\n        $this-&gt;displayName = $this-&gt;l(&#039;Lists customer via command line&#039;);\r\n        $this-&gt;description = $this-&gt;l(&#039;Example of how to create you own console command in PrestaShop&#039;);\r\n    }\r\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Creation of the command<\/h3>\n\n\n\n<p>At this moment, the only requirement is that your PHP file needs to be a class that extends &#8220;Symfony\\Component\\Console\\Command&#8221;. We need to display output in the table format hence extends &#8220;Symfony\\Component\\Console\\Helper\\Table&#8221; class as well. Extended the &#8220;Customer&#8221; class to get customer information:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\r\n\r\nnamespace PrestaShop\\Module\\CustomerConsoleCommand\\Command;\r\n\r\nuse Customer;\r\nuse Symfony\\Component\\Console\\Command\\Command;\r\nuse Symfony\\Component\\Console\\Helper\\Table;\r\nuse Symfony\\Component\\Console\\Input\\InputInterface;\r\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\r\n\r\nclass ListCustomersCommand extends Command\r\n{\r\n    \/**\r\n     * {@inheritdoc}\r\n     *\/\r\n    protected function configure()\r\n    {\r\n        \/\/ The name of the command (the part after &quot;bin\/console&quot;)\r\n        $this-&gt;setName(&#039;wk:list-customers&#039;)\r\n            -&gt;setDescription(&#039;List of existing customers&#039;);\r\n    }\r\n\r\n    protected function execute(InputInterface $input, OutputInterface $output)\r\n    {\r\n        $customers = Customer::getCustomers();\r\n\r\n        if (!$customers) {\r\n            $output-&gt;writeln(&#039;&lt;comment&gt;No customers available.&lt;\/comment&gt;&#039;);\r\n\r\n            return 0;\r\n        }\r\n\r\n        $data = array();\r\n        foreach ($customers as $customer) {\r\n            $data&#091;] = array(\r\n                $customer&#091;&#039;id_customer&#039;],\r\n                $customer&#091;&#039;firstname&#039;],\r\n                $customer&#091;&#039;lastname&#039;],\r\n                $customer&#091;&#039;email&#039;],\r\n            );\r\n        }\r\n\r\n        $table = new Table($output);\r\n\r\n        $table-&gt;setHeaders(array(&#039;id&#039;, &#039;firstname&#039;, &#039;lastname&#039;, &#039;email&#039;))\r\n            -&gt;setRows($data)\r\n            -&gt;render();\r\n\r\n        return 0;\r\n    }\r\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Registration of the command<\/h3>\n\n\n\n<p>In order to make this command available in the console, we register it in the &#8216;services.yml&#8217; file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">services:\r\n    PrestaShop\\Module\\CustomerConsoleCommand\\Command\\ListCustomersCommand:\r\n        class: PrestaShop\\Module\\CustomerConsoleCommand\\Command\\ListCustomersCommand\r\n        tags:\r\n            { name: &#039;console.command&#039; }<\/pre>\n\n\n\n<p>Now, install this module in PrestaShop and go to the module folder and run the &#8216;composer install&#8217; command. <\/p>\n\n\n\n<p>Now, when you run the &#8216;php bin\/console list&#8217; command, the &#8216;wk:list-customers&#8217; command will be listed:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"636\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-1200x636.png\" alt=\"list-command\" class=\"wp-image-305766\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-1200x636.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-300x159.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-250x132.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-768x407.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command.png 1525w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><figcaption>List of commands<\/figcaption><\/figure>\n\n\n\n<p>When we run the &#8216;wk:list-customers&#8217; command, it lists available customers id, first name, last name, and email in the table format:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/console wk:list-customers<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"592\" height=\"147\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/customer-list.png\" alt=\"customer-list\" class=\"wp-image-305767\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/customer-list.png 592w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/customer-list-300x74.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/customer-list-250x62.png 250w\" sizes=\"(max-width: 592px) 100vw, 592px\" loading=\"lazy\" \/><figcaption>Customer lists<\/figcaption><\/figure>\n\n\n\n<p>That\u2019s all about this blog.<\/p>\n\n\n\n<p>If any issue or doubt please feel free to mention it in the comment section. <\/p>\n\n\n\n<p>I would be happy to help.<\/p>\n\n\n\n<p>Also, you can explore our <a href=\"https:\/\/webkul.com\/prestashop-development\/\">PrestaShop Development Services<\/a> &amp; a large range of quality <a href=\"https:\/\/store.webkul.com\/PrestaShop-Extensions.html\">PrestaShop Modules<\/a>.<\/p>\n\n\n\n<p>For any doubt contact us at <a href=\"mailto:support@webkul.com\">support@webkul.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we are going to learn how to create your own console command in PrestaShop. PrestaShop uses the Symfony Console component and provides its own set of commands. Since version 1.7 of PrestaShop, you have access to the PrestaShop console using the following instruction in a terminal: You can list all available commands <a href=\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":384,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[209],"tags":[2065,289],"class_list":["post-305689","post","type-post","status-publish","format-standard","hentry","category-prestashop","tag-prestashop","tag-prestashop-module"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create your own console command in PrestaShop 1.7 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Since PrestaShop version 1.7.5, you can create and provide your own console commands into the PrestaShop console using modules.\" \/>\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-your-own-console-command-in-prestashop-1-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create your own console command in PrestaShop 1.7 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Since PrestaShop version 1.7.5, you can create and provide your own console commands into the PrestaShop console using modules.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/\" \/>\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=\"2021-09-16T13:08:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-16T13:08:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-1200x636.png\" \/>\n<meta name=\"author\" content=\"Ajeet Chauhan\" \/>\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=\"Ajeet Chauhan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/\"},\"author\":{\"name\":\"Ajeet Chauhan\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/7eee8f48857441660231d6a643103357\"},\"headline\":\"Create your own console command in PrestaShop 1.7\",\"datePublished\":\"2021-09-16T13:08:02+00:00\",\"dateModified\":\"2021-09-16T13:08:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/\"},\"wordCount\":416,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-1200x636.png\",\"keywords\":[\"prestashop\",\"prestashop module\"],\"articleSection\":[\"prestashop\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/\",\"url\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/\",\"name\":\"Create your own console command in PrestaShop 1.7 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-1200x636.png\",\"datePublished\":\"2021-09-16T13:08:02+00:00\",\"dateModified\":\"2021-09-16T13:08:06+00:00\",\"description\":\"Since PrestaShop version 1.7.5, you can create and provide your own console commands into the PrestaShop console using modules.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command.png\",\"width\":1525,\"height\":808,\"caption\":\"list-command\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create your own console command in PrestaShop 1.7\"}]},{\"@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\/7eee8f48857441660231d6a643103357\",\"name\":\"Ajeet Chauhan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e97b5fe8122a2283f5fe35ae6fca4725ac46026413ce7959b575f842f6bd6c92?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\/e97b5fe8122a2283f5fe35ae6fca4725ac46026413ce7959b575f842f6bd6c92?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Ajeet Chauhan\"},\"description\":\"Ajeet is a talented Software Engineer specializing in the PrestaShop platform. With expertise in PrestaShop Shipping &amp; Payments Integration, Marketplace Development, and Headless services, he delivers innovative solutions that enhance eCommerce functionality, driving seamless operations for businesses and their customers.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/ajeetchauhan-symfony143\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create your own console command in PrestaShop 1.7 - Webkul Blog","description":"Since PrestaShop version 1.7.5, you can create and provide your own console commands into the PrestaShop console using modules.","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-your-own-console-command-in-prestashop-1-7\/","og_locale":"en_US","og_type":"article","og_title":"Create your own console command in PrestaShop 1.7 - Webkul Blog","og_description":"Since PrestaShop version 1.7.5, you can create and provide your own console commands into the PrestaShop console using modules.","og_url":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-09-16T13:08:02+00:00","article_modified_time":"2021-09-16T13:08:06+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-1200x636.png","type":"","width":"","height":""}],"author":"Ajeet Chauhan","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Ajeet Chauhan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/"},"author":{"name":"Ajeet Chauhan","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/7eee8f48857441660231d6a643103357"},"headline":"Create your own console command in PrestaShop 1.7","datePublished":"2021-09-16T13:08:02+00:00","dateModified":"2021-09-16T13:08:06+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/"},"wordCount":416,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-1200x636.png","keywords":["prestashop","prestashop module"],"articleSection":["prestashop"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/","url":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/","name":"Create your own console command in PrestaShop 1.7 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command-1200x636.png","datePublished":"2021-09-16T13:08:02+00:00","dateModified":"2021-09-16T13:08:06+00:00","description":"Since PrestaShop version 1.7.5, you can create and provide your own console commands into the PrestaShop console using modules.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/list-command.png","width":1525,"height":808,"caption":"list-command"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/create-your-own-console-command-in-prestashop-1-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create your own console command in PrestaShop 1.7"}]},{"@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\/7eee8f48857441660231d6a643103357","name":"Ajeet Chauhan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e97b5fe8122a2283f5fe35ae6fca4725ac46026413ce7959b575f842f6bd6c92?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\/e97b5fe8122a2283f5fe35ae6fca4725ac46026413ce7959b575f842f6bd6c92?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Ajeet Chauhan"},"description":"Ajeet is a talented Software Engineer specializing in the PrestaShop platform. With expertise in PrestaShop Shipping &amp; Payments Integration, Marketplace Development, and Headless services, he delivers innovative solutions that enhance eCommerce functionality, driving seamless operations for businesses and their customers.","url":"https:\/\/webkul.com\/blog\/author\/ajeetchauhan-symfony143\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305689","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\/384"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=305689"}],"version-history":[{"count":17,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305689\/revisions"}],"predecessor-version":[{"id":305773,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305689\/revisions\/305773"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=305689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=305689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=305689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}