All Questions
21 questions
1
vote
2
answers
2k
views
Magento 2 - How to allow certain html elements in system.xml config field?
I try to add this HTML (<span style='color:red'>*</span>)to the content of a field with type text.
But the html is getting stripped. How can I allow all secure html elements but disallow ...
1
vote
1
answer
861
views
Magento2 - Add custom javascript to 'My Account' page
I've been trying to find questions, articles, or documentation covering this, but haven't been able to find what I need or haven't understood it yet.
I have a custom module that a colleague wrote (...
0
votes
1
answer
2k
views
Magento 2.3: system.xml and config.xml: Default values not showing up in the admin
I'm developing a module for Magento 2.3 and can't get default config values to show up in the admin. To the best of my knowledge, I've followed all the documentation I can find. It's kind of driving ...
3
votes
1
answer
2k
views
How to refresh the module configuration after change the etc/config.xml?
I've created a module with default configurations into the etc/config.xml file, but I changed the default configuration and I'm not able to see them reflected into my module installed.
How could I ...
2
votes
0
answers
688
views
Syntax for overriding config.xml module configuration with config.php in magento2?
I have a module MyCompany_ExampleModule. Its etc/config.xml file:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/...
1
vote
2
answers
968
views
Constants in config.xml
Is it possible to use PHP class constants as values in the config.xml file?
For example, if we have this config.xml file:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/...
1
vote
0
answers
141
views
Ensure module is loaded after all magento 2 modules
I want to create a module that is loaded first after all the magento modules are loaded. Is there a list somewhere of all them magento 2 module sequence? Or is there any way to set a module to load ...
1
vote
1
answer
79
views
How to keep module enabled across instances in Magento 2?
is there any way to keep free contributed plugin (for example MageMonkey 2) to be enabled across different instances of website(dev, stage, prod), keeping the configuration?
1
vote
1
answer
516
views
Validating a textbox based on AJAX response before Save in Magento 2
In Admin Config, I have a textbox where i will enter a value.
When hitting on Save Config button.
The value from the Textbox is sent over through an AJAX call.
If the response is positive, it should ...
6
votes
1
answer
4k
views
How to rebuild the modules sequence
TL:DR;
How can I rebuild (automatically) the modules sequence stored in app/etc/config.php in Magento 2.
Long version:
I have 2 modules I'm working on.
I installed them in the order "Module 1", "...
7
votes
2
answers
6k
views
How to set cronjob dynamic schedule from database in Magento 2
I am working on a custom module for Magento 2. I did setup crontab there and it is working good with static schedule.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2
votes
2
answers
5k
views
Disable module and it's output programmatically in Magento 2
In magento 1 disable module and it's output programmatically
protected function _disableModule($moduleName) {
// Disable the module itself
$nodePath = "modules/$moduleName/active";
if (...
15
votes
2
answers
9k
views
How can I set configuration values in Magento 2?
Previously (in Magento 1, that is) we created a module called Setup which contained setting for the site. The upgrade scripts looks something like this:
$installer = $this;
$installer->startSetup()...
10
votes
1
answer
25k
views
How to add a custom helper in my module?
How to create new Helper or override/rewrite Core Helper in Magento 2 module?
I tried adding dependency into my module.xml of Custom Module, but it doesn't load Helper class at all.
Below is my ...
4
votes
4
answers
10k
views
Magento 2 module "Object domdocument should be created" error
I am getting above error when I run my module in browser as:
192.168.0.106/magento-2/module1/index/index
Below is my Controller code:
<?php
namespace Company1\Module1\Controller\Index;
class ...
4
votes
5
answers
3k
views
Magento 2 module version number not editable
I have just started exploring Magento 2 structure and code-flow, also module development.
When I created module from an online module generator and tried to change it's "setup_version" & "...
35
votes
2
answers
42k
views
Magento 2: Default Values for `system.xml` Configuration
In Magento 1, it was possible to
Configuration a user interface for the System Configuration section in etc/system.xml files
Set default values for those fields in the etc/config.xml files
Behind ...
19
votes
2
answers
5k
views
Magento 2: How to Check if a Module's Installed
In Magento 2, is it possible to check if a module's installed at runtime?
In Magento 1 I'd either use the isModuleEnabled helper method, or manually fetch the global configuration tree and check the ...
3
votes
1
answer
896
views
Where to store config passwords
I want to have a custom database connection with a module I am creating. I am following this tutorial which will work well:
http://fishpig.co.uk/magento/tutorials/create-external-database-connection/...
3
votes
3
answers
146
views
How to deal with site configuration when building new site
What is the best way to deal with site configurations when building a site?
I am currently religiously using upgrade and install scripts for everything, meaning a zero configuration state when moving ...
4
votes
2
answers
3k
views
Magento ensure module config is loaded last
Is there a way to ensure that a module and its config xml is loaded last in Magento, or at least after a specific other module?
I want to avoid using the <depends> tag because it may not be 100%...