Today we launched OpenCart code snippets VSCode extensions which you can find at https://marketplace.visualstudio.com/items?itemName=webocreationcom.ocsnippets, We published OpenCart code snippets VScode extensions for OpenCart developers. It contains some OpenCart code snippets for PHP and Twigs. Github repository for this https://github.com/rupaknepali/opencartsnippetsvscode.
How to use Opencart code snippets VSCode extensions?
- Find “Opencart code snippets” extensions to install using the Extensions View.
- Install an extension.
- Once you installed the “Opencart Code snippets”, open ***.php or ***.twig or ***.xml
- Then start typing oc… then you will see a list of Opencart related code snippets available.
- For example, create a file called install.xml, then start typing oc, it will show ocmod and ocmodf, these are the Opencart code snippets available in the VScode extensions that you installed.
- Once you finished the word like ocmod then it creates the codes automatically.
- It highlights the word to be changed, enter the word that you need and click tab, then it will highlights the another words to be change
In this way, you can use the OpenCart Code snippets for rapid development.
Creating and publishing Visual Studio code extensions
Creating and publishing Visual Studio code extensions is easy than I thought just follow https://code.visualstudio.com/api/get-started/your-first-extension and https://code.visualstudio.com/api/working-with-extensions/publishing-extension
Opencart Snippets for Visual Studio Code
This VSCode extension is for OpenCart developer which has a collection of OpenCart snippets. This is just starting, Please let us know if need to add more Contact Us
All snippets start with oc. Some of the snippets are:
PHP page supported snippets:
- occ: It creates a new Controller class
- ocm: It creates a new Method or function
- occm: It creates new starter Model class
- ocl: It creates new variables for language files
- ocprf: It creates print_r with pre
Twig page supported snippets:
- oct: It creates starting template layouts in twig files
- octfor: It creates for loop in twig files
- octif: It creates if statement in twig files
- ocbtn: It creates button markup
- ocimg: It creates image markup
- ocbc: It creates breadcrumbs loop in twig files
OCMOD XML page supported snippets:
- ocmod: It creates OCMOD XML code boilerplate
- ocmodf: It creates OCMOD XML code boilerplate for files only
Users appreciate release notes as you update your extension.
– OCMOD support added.
– ocmod- for install.xml boilerplate creation
– ocmodf- OCMOD XML file boilerplate
– ocprf- print_r with pre
- The initial release of Opencart Snippets for vscode
- Added some snippets. Others are coming soon.
For more information
Please install the extension, try it out and share it with other Opencart developers which may help the development speed. It is free and open-source. Any suggestions, feedback, and other code snippets of Opencart are appreciated.