Jump to content

BlockCart Module - open even if empty


Recommended Posts

Hey you guys,

Kinda new in prestashop system :)

 

I tried to manage the module of cart in the top nav -

everything works just fine but -

 

When I have 1+ items in my cart hover on ahref opens the cart and summary of my procuts in cart

When I have 0 items - the hover not opens the mini cart

 

This is default of this module - I want to modify and edit it to be displayed even though the cart is empty

 

 

How can I edit that?

 

 

Thanks :)

Link to comment
Share on other sites

"Empty Cart" or something... it's not so important - I just want to understand where is the code to edit it -

 

there must be in the code somewhere which says - {if} the cart has products -> hover of cart button will open mini cart div {else} -> hover do nothing

 

 

I want to make hover open mini cart even if the cart is empty...

Link to comment
Share on other sites

  • 4 years later...

Hi... welp never is too late so i just faced same "issue" ;)

You just need to go to themes/your_theme/js/modules/blockcart and edit ajax-cart.js 

Find those lines (im not using default theme so it might be a little different): 

if (is_touch_enabled)
        {
            if ($(this).next('.cart_block:visible').length && !cart_block.isHoveringOver())
                $("#header .cart_block").stop(true, true).slideUp(450);
            else if (ajaxCart.nb_total_products > 0 || parseInt($('.ajax_cart_quantity').html()) > 0)
                $("#header .cart_block").stop(true, true).slideDown(450);
            return;
        }
        else
            window.location.href = $(this).attr('href');
    });

    $("#header .shopping_cart a:first").hover(
        function(){
            if (ajaxCart.nb_total_products > 0 || parseInt($('.ajax_cart_quantity').html()) > 0)
                $("#header .cart_block").stop(true, true).slideDown(450);
        },

and just change those (both of them)  html()) > 0  to  html()) > -1

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...