1

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>
                    </item>
                </item>
            </argument>
        </field>

[UPD]

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.

3
  • Add your fronted routes.xml code to question. Commented Oct 10, 2016 at 10:07
  • @SHPatel I've updated the question.
    – D.R.
    Commented Oct 11, 2016 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/… Commented Oct 11, 2016 at 6:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.