It is necessary to make the basket open automatically when adding a product. Already rummaged everything, I just can not figure out how to connect.
Basket:
var cart = { 'addcart': function(product_id, quantity) { $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1), dataType: 'json', success: function(json) { $('.alert, .text-danger').remove(); if (json['redirect']) { location = json['redirect']; } if (json['success']) { $('#notification').html('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + '<button type="button" class="close" data-dismiss="alert">×</button></div>'); setTimeout(function() { $("#notification").fadeOut()}, 2300); // Need to set timeout otherwise it wont update the total $('#cart').addClass('cart-top open'); $('#cart').load('index.php?route=module/cart #cart > *'); $('#cart #cart-total').html(json['total']); $('html, body').animate({ scrollTop: 0 }, 'slow'); $('#cart > ul').load('index.php?route=common/cart/info ul li'); } } }); }, <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="cart-top" class="cart-right"> <div class="cart-top"> <div id="cart" class="clearfix"> <div data-toggle="dropdown" data-loading-text="Загрузка..." class="heading media dropdown-toggle"> <div class="cart-inner media-body"> <a> <i class="icon-cart"></i> <div class="wrap-cart"> <b class="text-cart">Корзина покупок</b><br> <span id="cart-total" class="cart-total">Товаров: 8 (480.00руб.)</span> <i class="fa fa-angle-down"></i> </div> </a> </div> </div> <ul class="dropdown-menu content"> <li> <table class="table"> <tbody><tr> <td class="text-center"> <a href="#"><img src="#" alt="AmazonBasics Ultra-Portable Mini Bluetooth Speaker" title="TEST"></a> </td> <td class="text-left"><a href="#">TEST</a> <br> 8 x <b>480.00руб.</b> </td> <td class="text-center"><button type="button" onclick="cart.remove('256');" title="Удалить" class="btn btn-primary btn-xs"><i class="fa fa-times"></i></button></td> </tr> </tbody></table> </li> <li> <div class="table-responsive"> <table class="table table-v4"> <tbody><tr> <td class="text-right"><strong>Сумма</strong></td> <td class="text-right">480.00руб.</td> </tr> </tbody></table> <p class="text-center view-cart"> <a href="#"> Просмотр корзины </a> <a href="#"> Оформление заказа</a> </p> </div> </li> </ul> </div> </div> </div>