Question

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!

Was it helpful?

Solution

because my site is Quote only store and so no need of normal cart page.

Based on your statement above - I'm assuming that you DONT need/leverage the Amazon modules that ship OOTB with Magento 2.3.5.

If that is a valid assessment, your simplest option would be to disable the following Amazon modules:

  1. Amazon_Login

  2. Amazon_Core

  3. Amazon_Payment

And this can be achieved - via the CLI - using the following commands:

bin/magento module:disable Amazon_Login
bin/magento module:disable Amazon_Core
bin/magento module:disable Amazon_Payment

Good Luck!

Cheers,

Sharath

OTHER TIPS

You can disable this plugin. File di.xml

    <type name="Magento\Checkout\Controller\Cart\Index">
        <plugin name="amazon_login_cart_controller" disabled="true" />
    </type>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top