Articles on: 🛒 Monster Cart Upsells

Developer Documents (Methods/CSS Selectors)

If you need anything else feel free to reach out to our team

Methods



Close the cart drawer.
closeCart()

Open the cart drawer.
openCart()

Toggle the cart drawer.
toggleCart()

Add a new cart item or updating existing.
monster_addCartItem(items)

Parameters:
NameTypeDescription
ItemsCartitemThe cart item.



Remove a cart item
monster_removeCartItem(id)

Parameters:
NameTypeDescription
idnumberThe cart item id.



Reset the cart items.
monster_setCartItems(items)

Parameters:
NameTypeDescription
itemsArray.<Cartltem>The cart items array.



Refresh the items inside the Monster Cart:

window.monster_refresh(open, callback)

Parameters:



open (optional boolean, default: true): If set to true, the Monster Cart will open after the items have been refreshed. If set to false, the cart remains closed.
It controls the visibility state of the cart.

callback (optional function): An optional callback function that can be provided to run after the cart items have been refreshed.
This function executes any custom logic or actions you want to perform in response to the cart refresh.


CSS selectors



- cart container (including the overlay): #monster-upsell-cart
- cart wrapper: #monster-cart-wrapper
- header text: .mu-cart-header
- cart item: .mu-cart-item
- savings: .mu-savings
- subtotal: .mu-subtotal
- checkout button: #mu-checkout-button
- fbt container: .mu-frequently-container

Open cart with URL


Add "/#cart" to the url
Example:
https://monsterapps-beta.myshopify.com/#cart

Updated on: 27/03/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!