How to open cart drawer on click of a custom link or button?

  • Add a class open-drawer to any HTML element (Link, button, div, span etc.).

    <button class="open-drawer">Open Drawer</button>
    
  • Any link having href="/cart" will open the cart drawer

    <a href="/cart">Cart</a>
    
  • Open cart drawer programmatically

    // It opens the cart drawer with existing cart data
    upside.ucd.helpers.ajaxCart.show(); 
    
    // If you need to open cart drawer fresh cart data
    upside.ucd.helpers.ajaxCart.load();