Is it possible to add additional (image with Image Uploader) attribute to the Catalog Price Rule? If it is, please, tell about it in details. Better with working code example.

What I have now

Now I have only field with image uploader, but it just shows spinner and nothing more.

enter image description here

enter image description here

Code example

        <field name="img">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Image</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="source" xsi:type="string">catalog_rule</item>
                    <item name="formElement" xsi:type="string">fileUploader</item>
                    <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                    <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item
                    <item name="uploaderConfig" xsi:type="array">
                    <item name="url" xsi:type="string">catalog_rule/promo_catalog/image</item>


I have no frontend/routes.xml in my module. module-catalog-rule also doesn't have it. I use DI to inject ModelCollectionFactory of this module, where I need it.

  • Add your fronted routes.xml code to question. – Suresh Chikani Oct 10 '16 at 10:07
  • @SHPatel I've updated the question. – D.R. Oct 11 '16 at 5:37
  • catalog_rule/promo_catalog/image you have used it but this path must be correct. run it direct form URL and check it controller action is call or not. add your image.php file code. you can get more information from here : magento.stackexchange.com/questions/138928/… – Suresh Chikani Oct 11 '16 at 6:18

Your Answer

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

Browse other questions tagged or ask your own question.