I have a magento site in ver 2.3.5-p1
I want to redirect /checkout/cart/
this page to homepage, because my site is Quote only store and so no need of normal cart page. For that I have created a module to override Magento\Checkout\Controller\Cart\Index
this controller. Then added following code in my new controller:
namespace MyCompany\RedirectShoppingCart\Controller\Cart;
class Index extends \Magento\Checkout\Controller\Cart\Index
{
/**
* Shopping cart display action
*
* @return \Magento\Framework\View\Result\Page
*/
public function execute()
{
return $this->_response->setRedirect('/quotation/quote/', 301);
}
}
But this is giving following error:
Fatal error: Uncaught TypeError: Argument 2 passed to Amazon\Login\Plugin\CartController::afterExecute() must implement interface Magento\Framework\Controller\ResultInterface,
instance of Magento\Framework\App\Response\Http\Interceptor given, called in /var/www/html/vendor/magento/framework/Interception/Interceptor.php on line 146 and defined in /var/www/html/vendor/amzn/login-with-amazon-module/Plugin/CartController.php:44
Please help!