Developer Documents (Methods/CSS Selectors)
If you need anything else feel free to reach out to our team
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:
Remove a cart item
monster_removeCartItem(id)
Parameters:
Reset the cart items.
monster_setCartItems(items)
Parameters:
Refresh the items inside the Monster Cart:
window.monster_refresh(open, callback)
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.
- 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
Add "/#cart" to the url
Example:
https://monsterapps-beta.myshopify.com/#cart
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:
Name | Type | Description |
---|---|---|
Items | Cartitem | The cart item. |
Remove a cart item
monster_removeCartItem(id)
Parameters:
Name | Type | Description |
---|---|---|
id | number | The cart item id. |
Reset the cart items.
monster_setCartItems(items)
Parameters:
Name | Type | Description |
---|---|---|
items | Array.<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
Thank you!