like it says on the title, I want to 'customize' in a manner of speaking the reorder function that appears on the 'My Orders' section in the Customer Dashboard. What I have to do is to remove that link from that page and create a new 'sub menu' in the Dashboard (which I already have done) and list there only the last order and that's the one that will have the reorder function (this is a client's requirement). Is there any way to easily remove the 'reorder' link without tampering with Magento's core? I thought of creating a "preference" in the di.xml and do my own phtml without the link, but I think that there has to be a way to do it cleaner and more efficient, if so can anyone point me in the right direction? Also to only list the last order in the new section I created I thought of the same thing but I think that it wouldn't be efficient. Thanks in advance.
To disable reorder option you can do it by administrative panel:
- STORES -> Settings -> Configuration
- Click on Sales under Sale in left panel
- Go to Reorder section and set
If you want you can also do it by code copying the file from:
Then remove or customize conditional
<?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order->getEntityId())) : ?> .... <?php endif ?>