1

        $fieldset->addField('media_gallery', 'note',
        [
            'label' => '',
            'title' => __('Media Gallery'),
            'name'  => 'media_gallery',
            // 'required' => true,
            'text'      => $this->getContentHtml(),
        ]
    );

    $fieldset->addField('media_gallery_mobile', 'note',
        [
            'label' => '',
            'title' => __('Media Gallery For Mobile'),
            'name'  => 'media_gallery_mobile',
            // 'required' => true,
            'text'      => $this->getContentHtml(),
        ]
    );

I have two fields like this in form, how can I save 2 different photos, hope anyone help me. Thank you.

3
  • This all depends on how the extension has been built, as if it was specifically made for a single image then the upload functionality may be coded to only use the media_gallery variable if that is the case you would either need to change it to allow any variable that is posted or create new upload functionality that will allow you to upload a mobile image Commented Aug 19, 2019 at 7:19
  • can you give me an example? Thank you.
    – MichaelHa
    Commented Aug 19, 2019 at 9:49
  • Rather than reinvent the wheel please look at magento.stackexchange.com/questions/184731/… for reference Commented Aug 19, 2019 at 10:21

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.