cancel
Showing results for 
Search instead for 
Did you mean: 

Checkout/Cart disabled

SOLVED

Checkout/Cart disabled

Hello,

I've took over a Magento 2.4 app, not entirely sure where to start to look, last worked with V1.9 and installed V2 when it came out, but after that I haven't touched magento.

 

Someone has modified either the code or in the admin so when an Item is added to the cart, it directs them to the Checkout - Shipping & Billing and not the Cart.
Is this a design issue or an admin issue, if so can someone give me some guidance so I can re-implement it.

I'm hoping it's something obvious

 

Regards

Mal

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Checkout/Cart disabled

Not sure what went on with Adobe, but I responded to this yesterday

 

From investigating, 

Longstone Base - Main > Magento Blank > Longstone/base_main (this for all sites)
Then for the site I'm trying to sort is:

Longstone Base - Longstone > Longstone Base - Main > Longstone/base_longstone

 

The Blank theme seems to be in 
vendor\magento\theme-frontend-blank
from the above I think any template overrides are in: 
app\design\frontend\Longstone\base\longstone
app\design\frontend\Longstone\base\main

 

We seem to have what looks like a module:
app\code\Longstone\RedirectToCheckoutFromProductAddToCart
Which seems to be disabled here
C:\xampp\htdocs\longstone\app\etc\config.php

'Longstone_RedirectToCheckoutFromProductAddToCart' => 0,

Then a checkout redirect plugin in:
app\code\Longstone\Base\Plugin\CheckoutRedirect.php
With the following code
<?php
namespace Longstone\Base\Plugin;
use Magento\Checkout\Helper\Cart;
use Magento\Framework\Controller\ResultFactory;
class CheckoutRedirect
{
    protected $helper;
    protected $resultFactory;
    public function __construct(
        Cart $helper,
        ResultFactory $resultFactory
    ) {
        $this->helper = $helper;
        $this->resultFactory = $resultFactory;
    }
    public function aroundExecute(\Magento\Checkout\Controller\Cart\Index $subject, callable $proceed) {
        $cartCount = $this->helper->getSummaryCount();
        $redirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);       
        if($cartCount > 0) {
            $redirect->setUrl('/checkout/index/index');
        } else {
            $redirect->setUrl('/');
        }   
        return $redirect;
    }
}
?>

I used to understand M1 but M2, not 100% sure where to start to get it back to a default M2 checkout, where you add Item to basket, directs to basket, so we can run cross selling products then to checkout??

Any help appreciated

Mal

View solution in original post

2 REPLIES 2

Re: Checkout/Cart disabled

Hello @mallongstoaf62 

 

Are you using the default Magento Luma theme?

https://prnt.sc/MrUqhWJTPwUt

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

Re: Checkout/Cart disabled

Not sure what went on with Adobe, but I responded to this yesterday

 

From investigating, 

Longstone Base - Main > Magento Blank > Longstone/base_main (this for all sites)
Then for the site I'm trying to sort is:

Longstone Base - Longstone > Longstone Base - Main > Longstone/base_longstone

 

The Blank theme seems to be in 
vendor\magento\theme-frontend-blank
from the above I think any template overrides are in: 
app\design\frontend\Longstone\base\longstone
app\design\frontend\Longstone\base\main

 

We seem to have what looks like a module:
app\code\Longstone\RedirectToCheckoutFromProductAddToCart
Which seems to be disabled here
C:\xampp\htdocs\longstone\app\etc\config.php

'Longstone_RedirectToCheckoutFromProductAddToCart' => 0,

Then a checkout redirect plugin in:
app\code\Longstone\Base\Plugin\CheckoutRedirect.php
With the following code
<?php
namespace Longstone\Base\Plugin;
use Magento\Checkout\Helper\Cart;
use Magento\Framework\Controller\ResultFactory;
class CheckoutRedirect
{
    protected $helper;
    protected $resultFactory;
    public function __construct(
        Cart $helper,
        ResultFactory $resultFactory
    ) {
        $this->helper = $helper;
        $this->resultFactory = $resultFactory;
    }
    public function aroundExecute(\Magento\Checkout\Controller\Cart\Index $subject, callable $proceed) {
        $cartCount = $this->helper->getSummaryCount();
        $redirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);       
        if($cartCount > 0) {
            $redirect->setUrl('/checkout/index/index');
        } else {
            $redirect->setUrl('/');
        }   
        return $redirect;
    }
}
?>

I used to understand M1 but M2, not 100% sure where to start to get it back to a default M2 checkout, where you add Item to basket, directs to basket, so we can run cross selling products then to checkout??

Any help appreciated

Mal