0

enter image description hereHow to put reorder link in magento 2 programmatically? I have find record and last column show reorder link how to in magento 2?

0

enter image description hereHi,

You can do it by

<?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order->getEntityId())) : ?>
                                <a href="#" data-post='<?php /* @escapeNotVerified */ echo
                                $this->helper(\Magento\Framework\Data\Helper\PostHelper::class)
                                    ->getPostData($block->getReorderUrl($_order))
                                ?>' class="action order">
                                    <span><?= /* @escapeNotVerified */ __('Reorder') ?></span>
                                </a>
                            <?php endif ?>

Please check vendor/magento/module-sales/view/frontend/templates/order/recent.phtml for more information.

Thanks

  • @ Moin malek it is not working – sanni kalariya Apr 29 at 11:10
  • Are you assign the order id? – Moin Malek Apr 29 at 11:58
  • where i have to pass order id ?? – sanni kalariya Apr 29 at 12:19
  • $_order->getEntityId() this one pass your order id – Moin Malek Apr 29 at 12:54
  • can you please send code of Magento\Sales\Helper\Reorder and \Magento\Framework\Data\Helper\PostHelper ? – sanni kalariya Apr 29 at 13:25

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.