I am new to Magento. I need to override a html file in a project. The project using an extension called 'Amitshree'. I need to override an email template created in this extension in my project. I need a step by step solution because I am not a magento developer. I went through some solutions in this platform, but couldn't resolve my task. The project is developed in Magento 2.
Email templates are located in different modules, let's say you want to override new order template.
Locate the phtml file, in that case
vendor/magento/module_sales/email/order_new.phtml
Copy it to app/design/frontend/[YourCompany]/[Your_Theme]/Magento_Sales/email.
Change whatever you want.
Related
I recently had a task dumped on me, all I need to do is add a link header to a template in joomla. I'm able to do this directly inside the default.php in
/modules/mod_articles_category/tmpl/default.php
but of course it shows up in any module that uses that template, which isn't acceptable.
I havn't touched joomla before yesterday and I'm suprised at how painful this has become!
I've been following tutorials, creating an override template in
templates/template_name/html/mod_articles_category/default.php
but I dont see any option to utilize this override template in the module options of the admin console.
I also tried creating a duplicate of the module itself with the link header simply added into the default.php file but don't have any option to have this module installed since there is no module manager extension, just barebones joomla 3. What I'd like to do is use the override template, since it seems like the simplest solution.
What am i doing wrong that I cant see any effect from my override template?
Rename the file templates/template_name/html/mod_articles_category/default.php to something custom like templates/template_name/html/mod_articles_category/linkInHeader.php then save it.
Go to your module manager and open that module. GO to Advanced tab & select linkInHeader in Alternative Layout dropdown. This should do the tricks.
I am creating the theme for Opencart 2.2.
While creating a Opencart theme do I always need to copy the files from the default theme? What about I want to create my own layout? Is there any good tutorial are available for creating a opencart theme without using the default theme?
Looking for your reply.
Thanks and Regards,
Chirag
If you are creating your own new custom OpenCart theme, use default theme folder structure. If you want to change/improve functionality of your template, you need to edit controller and models too.
But do not change core files. Always use virtual mode to modify files.
In OpenCart, there are four ways to modify its core functionality:
vQmod, OCMOD, Override Engine and Event Handlers
vQMOD / OCMOD / Override engine / Event handlers allows developer to modify files without changing any of core file. This means that if a modification is removed none of the original OpenCart files need to be restored or fixed.
Creating a new theme for OpenCart 1.5 used to be pretty easy - make a folder in the theme directory and copy only the files from the default theme that you want to change. And that was about it.
OpenCart 2 is now outdated, 3 should be used for new builds ...
OpenCart 3 brings new features, but creating a theme is a little more difficult.
There are instructions and a free downloadable template theme here:
https://www.antropy.co.uk/blog/how-to-create-an-opencart-3-theme/
I have installed Opencart 2.0.3.1.
vqmod 2.5.1.5 for Opencart,
vqmod manager 3.0,
and ProductQuestionsAndAnswers_v1.8.2_oc2.0.x.x
These have all been uploaded manually via ftp, i've followed the simple instructions for vqmod's installation to rewrite part of the index.php and admin/index.php which seems to have created all of the required cache files.
The module is installed, enabled and visible in the modules section and in the vqmod manager, however when I try adding the module to the theme layout there is no option for this module.
Everything appears to be working fine other than for not being able to insert the module into a layout.
Not all modules for Opencart have that option to add it in a layout.A big portion of the modules in opencart are made by students or people that are learning to code most of the free modules don't even have that option. Now that we have this out of the way.
Other solutions to this problem.
If you are using a custom /admin panel lets say your admin is called bestbanana
You need to open the VqMOD xml file that is located in the VQmod/xml folder
and change all the values that contain admin to bestbanana
Or if you are using a custom theme that has different structure than the default opencart one,than you need to modify it a little bit more.
Since VqMOD works as a search engine it searches/replaces adds and so forth bu it searches by exact words. e.g peaces of code.
but without posting any code or something similar there is nothing much that anyone can help you with.
Hope that this will help you
I am trying to include the Redux Framework in my theme. I decided to try the online builder of Redux Framework: http://build.reduxframework.com/ to generate the necessary files for me.
The builder of Redux provides two options:
(1). To generate and export the admin folder.
(2). To generate and export a starter theme with the Redux settings.
I think i need option (1) since i have a theme already in my hands.
The admin folder contains the following:
(1). The Redux Builder generated (.Json) file.
(2). The admin folder itself - which contains the framework and extensions folders along with two (.php) files: (admin-init.php) and (options-init.php).
The documentation of Redux Framework teaches us how to load the config file of the framework inside our theme. It does not inform us through what to do with the exported admin folder and how to use it in our theme - in case we chose to use the online builder.
The online builder of Redux framework states the following:
Download just the admin folder portion. This will provide you with a
folder you can place in a theme or plugin and include
~/admin/admin-init.php to initate it.
Side note: It is written as "initate" instead of "initiate". If any of the developers happen to read this question, it may be a nice thing to correct this small typing mistake.
My Question:
(Q1). How should i initiate the admin file? I couldn't find that in the documentation. Is it about copying its content to the (functions.php) file after fixing the directories? Or something else is required?
Include the Redux framework.
Copy the generated admin folder to your theme.
Copy the contents of admin-init.php to functions.php file of your theme.
Fix the directories names and files depending on your theme's structure.
Is that right or i am missing something up there?
Any clarifications, answers or comments will be greatly appreciated.
Thanks in advance for your help!
There is another way to initiate, i don't know if it's the best way or not
in my themes, i add :
require get_template_directory() . '/admin/admin-init.php'; )
in my function.php so i don't have to fix the directories files and names in redux admin folder depending on my themes.
Lead dev of Redux here. Good call on the spelling check.
Just include that file and that's it! :)
I am developing mobile application for existing magento website and the mobile application has its own web admin and web admin developed in core php (not in magento). Can we put the core php web admin code to magento /app/code/local/ folder ? and is it work with magento ?
Please help me on this.
We can consider Magento as an application that is constituted by modules. Each of this module does different functionalities, but still they are independent to each other. This property makes Magento highly extendable and powerful.
By default, Magento comes with lot of such individual modules. These modules are located inside app/code/core. Note that, this folder only holds Model and Controller logic parts. View logics are separated from this and it normally lies in app/design and skin folders.
If you need to extend Magento core functionality or if you need to add any new functionality, you have two options available.
Use an extension
Develop your own custom modules
For extension/pluggin, Magento uses app/code/community directory. This way core modules are seperated from extensions and it gives us lot of flexibility.
When you use your own modules to add any functionality, you probably need to add your module in app/code/local. This way, custom modules are seperated from both core and extensions.
When Magento looks for a module, it will first check that module in local directory. If it is not there, then it will check in community directory. If it is not there, again it will check in core directory. Finally it will check it in lib directory. This callback mechanism is the core concept that you need to understand , before start to develop your own extensions.
It is not necessary to put your custom module in app/code/local directory. You can put it in community or in core directory. This is because, the callback mechanism can pick up your module, irrespective of these three locations. However as I said earlier, three of this directories has its own purpose. So better use them properly as it demands.
Hope that makes lot of sense
From Magento Wiki,
Every custom module will be created in the directory:
/app/code/local
And this is the directory structure that you use to create one:
/app/code/local/<Namespace>/<Module>/
That way, we can have multiple modules under a single namespace.
Naresh, /app/code/local/ is used to put your custom developed plugin/extension for magento. it's main aim to have custom developed code and core code separate.
If in future you upgrade the version of magento than it overwrite/delete the code written in /app/code/core/ but leave the code as it is in /app/code/local/ and it's place where you can override the core block/helper/model as well.
you can't copy your code directly in to core, you have to create module/plugin to club your existing code with magento.