Warehouse Theme - disable cart pop up when adding item to cart

Hi everyone!

I am using the warehouse theme and looking to disable the mini-cart just for when someone adds and item to their cart because it is a bit obnoxious. But I still want the cart drawer to pop up when they click on the cart icon in the menu bar. I have been in mini-cart.liquid code trying to add some sort of if else statement where if the pop up is triggered by adding to car (product.form.add_to_cart?) then it does not display anything but it is not working for me.

This is the top of the mini-cart.liquid that I want to edit:

{%- render 'icon', icon: 'nav-triangle-borderless' -%}

This is in theme.liquid:

window.languages = {


productFormAddToCart: {% if product.template_suffix == ‘pre-order’ %}{{ ‘product.form.pre_order’ | t | json }}{% else %}{{ ‘product.form.add_to_cart’ | t | json }}{% endif %},


}

This is in the Is-output-form-actions.liquid

{%- if languageCode != defaultLanguageCode -%}
{%- assign checkoutAction = ‘action="/’ | append: languageCode | append: ‘/checkout’ | append: ‘"’ -%}
{%- assign cartAction = ‘action="/’ | append: languageCode | append: ‘/cart’ | append: ‘"’ -%}
{%- assign cartAddAction = ‘action="/’ | append: languageCode | append: ‘/cart/add’ | append: ‘"’ -%}

{%- assign output = output | replace: ‘action=“/checkout”’, checkoutAction | replace: ‘action=“/cart/add”’, cartAddAction | replace: ‘action=“/cart”’, cartAction -%}
{%- endif -%}

This is in the cart.mini-cart.liquid:

{% layout none %}
{% render ‘mini-cart’ %}

This is in the theme.scss.liquid:

.mini-cart[aria-hidden=“false”] {
visibility: visible;
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
transition: opacity 0.4s cubic-bezier(0, 1, 0.4, 1), visibility 0.4s linear, -webkit-transform 0.4s cubic-bezier(0.18, 1.25, 0.4, 1);
transition: opacity 0.4s cubic-bezier(0, 1, 0.4, 1), transform 0.4s cubic-bezier(0.18, 1.25, 0.4, 1), visibility 0.4s linear;
transition: opacity 0.4s cubic-bezier(0, 1, 0.4, 1), transform 0.4s cubic-bezier(0.18, 1.25, 0.4, 1), visibility 0.4s linear, -webkit-transform 0.4s cubic-bezier(0.18, 1.25, 0.4, 1);
}

All help is appreciated!

hi @JuliaTPM ,

The issue need check in code, if you want check can send info site for me.

Hi @JuliaTPM ,

You need to disable it at JS file. Please go to theme.js file, find ‘_onProductAdded’ and remove code here:

Hope it helps!

Thanks for the suggestion, I tried it but it didn’t work… mine looked like this

I changed it to not open the minicart but it did nothing. Ideas why?

Hello,

I am in the same situation as the original poster.

I was able to remove code and disable at JS file, which disabled the mini-cart pop up, however I have a new problem.

Once item is added to cart, it redirects to the cart automatically.

Is there a way to stay on the same page after adding item to cart?