I need to integrate small stuff.

When I will click add to cart ( bundle product ) then only product added successfully in cart page and then redirect into the checkout page.

So please let me help. Please make sure only bundle product.

1 Answer 1


You can use observer/event at here.

Create Observer event on checkout_cart_add_product_complete.

and set return return_url to request Url as checkout page url when you doing to add to cart.

Observer class:

namespace StackExchange\Magento\Observer;

use Magento\Framework\Event\ObserverInterface;

class CheckoutCartAddProductComplete implements ObserverInterface

     * @var \Magento\Framework\UrlInterface
    private $url;

    public function __construct(
         \Magento\Framework\UrlInterface $url      
    ) {

        $this->url = $url;
    public function execute(\Magento\Framework\Event\Observer $observer) 
        $product = $observer->getEvent()->getProduct();
        $request= $observer->getEvent()->getRequest();
        if($product->getTypeId() !== 'bundle'){
            return ;
        $checkoutUrl = $this->url->getUrl('checkout');
        return $this;


Note that: This solution is work When Setting when After Adding a Product Redirect to Shopping Cart = Yes.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.