How can I change an existing modal in Magento 2?Magento 2.1 adding new component type problemMagento 2.1 : Try to load a listing component for a custom model on the product edit pageHow to close a modal in Magento 2Change button text in modal popup minicartMagento2 add new field in bundle item (in option selection)DynamicRows - underscore's function last() is not definedMagento 2 declaring modifier PHP Fatal Error: null given in $modifiersMissing required argument $modifiers of MagentoUiDataProviderModifierPoolGrid action column custom callback with multiple params in magento2
What is an equivalently powerful replacement spell for Yuan-Ti's Suggestion spell?
What is a Samsaran Word™?
Is it "common practice in Fourier transform spectroscopy to multiply the measured interferogram by an apodizing function"? If so, why?
Does the Idaho Potato Commission associate potato skins with healthy eating?
Use of noexpand in the implementation of TextOrMath for eTeX
Does int main() need a declaration on C++?
What Exploit Are These User Agents Trying to Use?
Notepad++ delete until colon for every line with replace all
How does a dynamic QR code work?
Were days ever written as ordinal numbers when writing day-month-year?
How obscure is the use of 令 in 令和?
My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?
How to compactly explain secondary and tertiary characters without resorting to stereotypes?
Avoiding the "not like other girls" trope?
Bullying boss launched a smear campaign and made me unemployable
Which ISO should I use for the cleanest image?
How dangerous is XSS
How can saying a song's name be a copyright violation?
How to install cross-compiler on Ubuntu 18.04?
How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?
Did 'Cinema Songs' exist during Hiranyakshipu's time?
What are the G forces leaving Earth orbit?
Knowledge-based authentication using Domain-driven Design in C#
Is there a hemisphere-neutral way of specifying a season?
How can I change an existing modal in Magento 2?
Magento 2.1 adding new component type problemMagento 2.1 : Try to load a listing component for a custom model on the product edit pageHow to close a modal in Magento 2Change button text in modal popup minicartMagento2 add new field in bundle item (in option selection)DynamicRows - underscore's function last() is not definedMagento 2 declaring modifier PHP Fatal Error: null given in $modifiersMissing required argument $modifiers of MagentoUiDataProviderModifierPoolGrid action column custom callback with multiple params in magento2
I'm trying to change the behaviour of a Modal (not Model) in Magento 2.
The modal in question is advanced_inventory_modal, declared in module-catalog-inventory/view/adminhtml/ui_component/product_form.xml.
Now I know I can use a Modifier in the product-form-modifier-pool:
<virtualType name="MagentoCatalogUiDataProviderProductFormModifierPool">
<arguments>
<argument name="modifiers" xsi:type="array">
<item name="hf_quantity" xsi:type="array">
<item name="class" xsi:type="string">VendorModuleUiDataProviderProductFormModifierQuantity</item>
<item name="sortOrder" xsi:type="number">100</item>
</item>
</argument>
</arguments>
</virtualType>
... and use the modifyMeta()-method in my modifier to manipulate the XML configuration, but for some reason, the inventory modal is not present in the data that is provided here. It's also not a The sortOrder-related problem, since I already set that way high.sortOrder-attribute might have something to do with it.
So what gives? Can anyone tell me what's the proper way to modify the content of an existing modal in Magento 2?
Edit:
I found a solution or workaround (not sure yet) on how to achieve what I am trying to achieve. It turns out that if I set sortOrder to 10000 I have some data in my modifyMeta()-method that I can use:
public function modifyMeta(array $meta)
if ($path = $this->arrayManager->findPath('quantity_and_stock_status_qty', $meta, null, 'children'))
$this->arrayManager->remove(
$path . '/children/qty/arguments/data/config/validation/validate-digits',
$meta
);
if ($path = $this->arrayManager->findPath('advanced_inventory_modal', $meta))
$meta = $this->arrayManager->merge(
$path . '/children/stock_data/children/qty/arguments/data/config',
$meta,
['validation' => ['validate-digits' => false]]
);
return $meta;
Note that the `advanced_inventory_modal` node is not yet complete, but my best guess is that the later addition of the modal merges with these settings, but doesn't override it. Could be wrong though, perhaps someone could share some more light on how this mechanism works?
magento2 modal
add a comment |
I'm trying to change the behaviour of a Modal (not Model) in Magento 2.
The modal in question is advanced_inventory_modal, declared in module-catalog-inventory/view/adminhtml/ui_component/product_form.xml.
Now I know I can use a Modifier in the product-form-modifier-pool:
<virtualType name="MagentoCatalogUiDataProviderProductFormModifierPool">
<arguments>
<argument name="modifiers" xsi:type="array">
<item name="hf_quantity" xsi:type="array">
<item name="class" xsi:type="string">VendorModuleUiDataProviderProductFormModifierQuantity</item>
<item name="sortOrder" xsi:type="number">100</item>
</item>
</argument>
</arguments>
</virtualType>
... and use the modifyMeta()-method in my modifier to manipulate the XML configuration, but for some reason, the inventory modal is not present in the data that is provided here. It's also not a The sortOrder-related problem, since I already set that way high.sortOrder-attribute might have something to do with it.
So what gives? Can anyone tell me what's the proper way to modify the content of an existing modal in Magento 2?
Edit:
I found a solution or workaround (not sure yet) on how to achieve what I am trying to achieve. It turns out that if I set sortOrder to 10000 I have some data in my modifyMeta()-method that I can use:
public function modifyMeta(array $meta)
if ($path = $this->arrayManager->findPath('quantity_and_stock_status_qty', $meta, null, 'children'))
$this->arrayManager->remove(
$path . '/children/qty/arguments/data/config/validation/validate-digits',
$meta
);
if ($path = $this->arrayManager->findPath('advanced_inventory_modal', $meta))
$meta = $this->arrayManager->merge(
$path . '/children/stock_data/children/qty/arguments/data/config',
$meta,
['validation' => ['validate-digits' => false]]
);
return $meta;
Note that the `advanced_inventory_modal` node is not yet complete, but my best guess is that the later addition of the modal merges with these settings, but doesn't override it. Could be wrong though, perhaps someone could share some more light on how this mechanism works?
magento2 modal
1
That's the only way so far to customise kind of Ui component like this. The PHP modifiers.
– Toan Nguyen
Jul 18 '17 at 4:24
2
@Giel Berkers Your question is good but unfortunately I don't know how to answer it. Fortunately I have enough reputations to place bounty on your question to attract someone who knows to answer your question. My kind.
– Farewell Stack Exchange
Sep 4 '17 at 22:34
add a comment |
I'm trying to change the behaviour of a Modal (not Model) in Magento 2.
The modal in question is advanced_inventory_modal, declared in module-catalog-inventory/view/adminhtml/ui_component/product_form.xml.
Now I know I can use a Modifier in the product-form-modifier-pool:
<virtualType name="MagentoCatalogUiDataProviderProductFormModifierPool">
<arguments>
<argument name="modifiers" xsi:type="array">
<item name="hf_quantity" xsi:type="array">
<item name="class" xsi:type="string">VendorModuleUiDataProviderProductFormModifierQuantity</item>
<item name="sortOrder" xsi:type="number">100</item>
</item>
</argument>
</arguments>
</virtualType>
... and use the modifyMeta()-method in my modifier to manipulate the XML configuration, but for some reason, the inventory modal is not present in the data that is provided here. It's also not a The sortOrder-related problem, since I already set that way high.sortOrder-attribute might have something to do with it.
So what gives? Can anyone tell me what's the proper way to modify the content of an existing modal in Magento 2?
Edit:
I found a solution or workaround (not sure yet) on how to achieve what I am trying to achieve. It turns out that if I set sortOrder to 10000 I have some data in my modifyMeta()-method that I can use:
public function modifyMeta(array $meta)
if ($path = $this->arrayManager->findPath('quantity_and_stock_status_qty', $meta, null, 'children'))
$this->arrayManager->remove(
$path . '/children/qty/arguments/data/config/validation/validate-digits',
$meta
);
if ($path = $this->arrayManager->findPath('advanced_inventory_modal', $meta))
$meta = $this->arrayManager->merge(
$path . '/children/stock_data/children/qty/arguments/data/config',
$meta,
['validation' => ['validate-digits' => false]]
);
return $meta;
Note that the `advanced_inventory_modal` node is not yet complete, but my best guess is that the later addition of the modal merges with these settings, but doesn't override it. Could be wrong though, perhaps someone could share some more light on how this mechanism works?
magento2 modal
I'm trying to change the behaviour of a Modal (not Model) in Magento 2.
The modal in question is advanced_inventory_modal, declared in module-catalog-inventory/view/adminhtml/ui_component/product_form.xml.
Now I know I can use a Modifier in the product-form-modifier-pool:
<virtualType name="MagentoCatalogUiDataProviderProductFormModifierPool">
<arguments>
<argument name="modifiers" xsi:type="array">
<item name="hf_quantity" xsi:type="array">
<item name="class" xsi:type="string">VendorModuleUiDataProviderProductFormModifierQuantity</item>
<item name="sortOrder" xsi:type="number">100</item>
</item>
</argument>
</arguments>
</virtualType>
... and use the modifyMeta()-method in my modifier to manipulate the XML configuration, but for some reason, the inventory modal is not present in the data that is provided here. It's also not a The sortOrder-related problem, since I already set that way high.sortOrder-attribute might have something to do with it.
So what gives? Can anyone tell me what's the proper way to modify the content of an existing modal in Magento 2?
Edit:
I found a solution or workaround (not sure yet) on how to achieve what I am trying to achieve. It turns out that if I set sortOrder to 10000 I have some data in my modifyMeta()-method that I can use:
public function modifyMeta(array $meta)
if ($path = $this->arrayManager->findPath('quantity_and_stock_status_qty', $meta, null, 'children'))
$this->arrayManager->remove(
$path . '/children/qty/arguments/data/config/validation/validate-digits',
$meta
);
if ($path = $this->arrayManager->findPath('advanced_inventory_modal', $meta))
$meta = $this->arrayManager->merge(
$path . '/children/stock_data/children/qty/arguments/data/config',
$meta,
['validation' => ['validate-digits' => false]]
);
return $meta;
Note that the `advanced_inventory_modal` node is not yet complete, but my best guess is that the later addition of the modal merges with these settings, but doesn't override it. Could be wrong though, perhaps someone could share some more light on how this mechanism works?
magento2 modal
magento2 modal
edited Mar 12 at 10:45
magefms
2,2302426
2,2302426
asked Nov 11 '16 at 12:45
Giel BerkersGiel Berkers
7,09424281
7,09424281
1
That's the only way so far to customise kind of Ui component like this. The PHP modifiers.
– Toan Nguyen
Jul 18 '17 at 4:24
2
@Giel Berkers Your question is good but unfortunately I don't know how to answer it. Fortunately I have enough reputations to place bounty on your question to attract someone who knows to answer your question. My kind.
– Farewell Stack Exchange
Sep 4 '17 at 22:34
add a comment |
1
That's the only way so far to customise kind of Ui component like this. The PHP modifiers.
– Toan Nguyen
Jul 18 '17 at 4:24
2
@Giel Berkers Your question is good but unfortunately I don't know how to answer it. Fortunately I have enough reputations to place bounty on your question to attract someone who knows to answer your question. My kind.
– Farewell Stack Exchange
Sep 4 '17 at 22:34
1
1
That's the only way so far to customise kind of Ui component like this. The PHP modifiers.
– Toan Nguyen
Jul 18 '17 at 4:24
That's the only way so far to customise kind of Ui component like this. The PHP modifiers.
– Toan Nguyen
Jul 18 '17 at 4:24
2
2
@Giel Berkers Your question is good but unfortunately I don't know how to answer it. Fortunately I have enough reputations to place bounty on your question to attract someone who knows to answer your question. My kind.
– Farewell Stack Exchange
Sep 4 '17 at 22:34
@Giel Berkers Your question is good but unfortunately I don't know how to answer it. Fortunately I have enough reputations to place bounty on your question to attract someone who knows to answer your question. My kind.
– Farewell Stack Exchange
Sep 4 '17 at 22:34
add a comment |
2 Answers
2
active
oldest
votes
You can set <sequence> in module.xml of CatalogInventory module. After that, you can create product_form.xml under
app/code/Your/Module/view/adminhtml/ui_component/product_form.xml
With the same path as it is in the CatalogInventory. This will replace the configuration you needed.
I would like to provide any examples but I don't know what you need here.
P.S. you don't need to add other elements you don't need in your XML. they will be taken from parent xml configuration.
add a comment |
There is a two way:
1) Create a new Model(through new module creation in local pool)
2) To override the existing Model of specific module which you want.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f145338%2fhow-can-i-change-an-existing-modal-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can set <sequence> in module.xml of CatalogInventory module. After that, you can create product_form.xml under
app/code/Your/Module/view/adminhtml/ui_component/product_form.xml
With the same path as it is in the CatalogInventory. This will replace the configuration you needed.
I would like to provide any examples but I don't know what you need here.
P.S. you don't need to add other elements you don't need in your XML. they will be taken from parent xml configuration.
add a comment |
You can set <sequence> in module.xml of CatalogInventory module. After that, you can create product_form.xml under
app/code/Your/Module/view/adminhtml/ui_component/product_form.xml
With the same path as it is in the CatalogInventory. This will replace the configuration you needed.
I would like to provide any examples but I don't know what you need here.
P.S. you don't need to add other elements you don't need in your XML. they will be taken from parent xml configuration.
add a comment |
You can set <sequence> in module.xml of CatalogInventory module. After that, you can create product_form.xml under
app/code/Your/Module/view/adminhtml/ui_component/product_form.xml
With the same path as it is in the CatalogInventory. This will replace the configuration you needed.
I would like to provide any examples but I don't know what you need here.
P.S. you don't need to add other elements you don't need in your XML. they will be taken from parent xml configuration.
You can set <sequence> in module.xml of CatalogInventory module. After that, you can create product_form.xml under
app/code/Your/Module/view/adminhtml/ui_component/product_form.xml
With the same path as it is in the CatalogInventory. This will replace the configuration you needed.
I would like to provide any examples but I don't know what you need here.
P.S. you don't need to add other elements you don't need in your XML. they will be taken from parent xml configuration.
edited Dec 26 '18 at 5:11
Chirag Patel
2,468423
2,468423
answered Oct 15 '18 at 20:03
AleksLiAleksLi
111
111
add a comment |
add a comment |
There is a two way:
1) Create a new Model(through new module creation in local pool)
2) To override the existing Model of specific module which you want.
add a comment |
There is a two way:
1) Create a new Model(through new module creation in local pool)
2) To override the existing Model of specific module which you want.
add a comment |
There is a two way:
1) Create a new Model(through new module creation in local pool)
2) To override the existing Model of specific module which you want.
There is a two way:
1) Create a new Model(through new module creation in local pool)
2) To override the existing Model of specific module which you want.
edited 16 hours ago
Ashish Viradiya
1,0811830
1,0811830
answered Mar 13 at 7:16
Naresh PrajapatiNaresh Prajapati
164
164
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f145338%2fhow-can-i-change-an-existing-modal-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
That's the only way so far to customise kind of Ui component like this. The PHP modifiers.
– Toan Nguyen
Jul 18 '17 at 4:24
2
@Giel Berkers Your question is good but unfortunately I don't know how to answer it. Fortunately I have enough reputations to place bounty on your question to attract someone who knows to answer your question. My kind.
– Farewell Stack Exchange
Sep 4 '17 at 22:34