I want to skip some products whenever reorder. file path in vendor folder (vendor/magento/module-sales/Controller/AbstractController/Reorder.php:57) and it is an abstract Class.
I want simply add this code condition. if($item->getSku() != 'offer123') Is it possible by plugin ?
foreach ($items as $item) {
if($item->getSku() != 'offer123'){ // i want to apply this condition
try {
$cart->addOrderItem($item);
} catch (\Magento\Framework\Exception\LocalizedException $e) {
if ($this->_objectManager->get(\Magento\Checkout\Model\Session::class)->getUseNotice(true)) {
$this->messageManager->addNotice($e->getMessage());
} else {
$this->messageManager->addError($e->getMessage());
}
return $resultRedirect->setPath('*/*/history');
} catch (\Exception $e) {
$this->messageManager->addException($e, __('We can\'t add this item to your shopping cart right now.'));
return $resultRedirect->setPath('checkout/cart');
}
}
}
Thanks in advance.