3

I am new developer of Magento 2.

Is Magento provided a way to set default value of quantity in admin new product page? enter image description here

6

I found solution:

your_module_dir/view/adminhtml/ui_component/product_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <modal name="advanced_inventory_modal">
        <fieldset name="stock_data">
            <field name="qty">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="value" xsi:type="string">1</item>
                    </item>
                </argument>
            </field>
        </fieldset>
    </modal>
</form>

Don't forget clear cache. I hope it will help.

0

Please refer below URL for customization in admin product form

http://devdocs.magento.com/guides/v2.1/howdoi/customize_product.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.