5

I am facing some issues in Magento2 EE default RMA extension.

In create new return under "Return item information".

1) Form is not getting validated: reason to order, item condition, resolution are required yet form gets submitted and request is created.

2) On "Add item to return": I do not found any option to delete that added item.

3) On successful submitting RMA form getting error : "We can't create a return right now. Please try again later.".

Has anyone else have faced same issue.

Any help.

[edit]:

Figured out the 3 rd point, this error is occurring as sendNewRmaEmail() function is called on creating rma. So as emails were not been send so it was throwing error. But yet first two problems still persists.

3

You can try this way if it works for you. Its just a fixed.

1) Override module-rma/view/frontend/templates/form/renderer/select.phtml in your theme or module. add data-validate="{required:true}" for required attributes.

select.phtml.

<?php
     /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */

      // @codingStandardsIgnoreFile

 ?>
<?php
      /**
       * Create account form template
      /* @var $block \Magento\Rma\Block\Form\Renderer\Select */
      $validate = ($block->isRequired()) ? 'data-validate="{required:true}"' : '';
       ?>
      <div class="field <?= $block->getHtmlId() ?><%- data._index_ %><?php if ($block->isRequired()) {
      echo ' required' ?>">
      <label for="items:<?= $block->getHtmlId() ?><%- data._index_ %>" class="label"><span><?= /* @escapeNotVerified */ $block->getLabel() ?></span></label>
      <div class="control">
        <select id="items:<?= $block->getHtmlId() ?><%- data._index_ %>" name="items[<%- data._index_ %>][<?= /* @escapeNotVerified */ $block->getFieldName() ?>]"<?php if ($block->getFieldName() == 'reason'): ?> data-args='{"index":<%- data._index_ %>}' <?php endif;
    } ?> <?=$validate?> >
            <?php foreach ($block->getOptions() as $option):?>
                <option value="<?= /* @escapeNotVerified */ $option['value'] ?>"<?php if ($option['value'] == $block->getValue()):?> selected="selected"<?php endif;?>><?= $block->escapeHtml($option['label']) ?></option>
            <?php endforeach;?>
            <?php if ($block->getFieldName() == 'reason'): ?>
                <?php $attribute = $block->getAttribute('reason_other'); ?>
                <?php if ($attribute): ?>
                    <option value="other"<?php if ($option['value'] == 'other'):?> selected="selected"<?php endif;?>><?= $block->escapeHtml($attribute->getStoreLabel()) ?></option>
                <?php endif; ?>
            <?php endif; ?>
        </select>
    </div>
</div>

2) For second issue please add below html before fieldset ends in create.phtml.

<div class="actions-toolbar text-right">
        <div class="secondary" id="delete<%- data._index_ %>">
            <button type="button" class="action remove delete"><span><?= /* @escapeNotVerified */ __('Remove') ?></span></button>
        </div>
</div>

3) For third issue I think if point 1 resolved from this fix then you won't face this issue anymore.

I hope it will work for you, Let me know if you face any further issue from these fixes.

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.