2.0 Beta

Smootify 2.0 is in public beta. Your 1.x store keeps working. Move when you want.

What changed

smootify-cart

Renders the cart and opens or closes it as a mini cart.

v2.0 beta
Open .md
On this page
  1. Where it can go
  2. What it requires
  3. Fields in the form
  4. Attributes on the element
  5. Attributes inside it
  6. State classes
  7. Loading

Where it can go

  • Anywhere on the page.
  • Out of place, it stays in the page and does nothing: no context required.

What it requires

Nothing beyond Smootify: it works on every plan.

Fields in the form

Each field’s name attribute tells Smootify what the field holds.

NameFieldWhat it does
notetextarea, inputThe order note, saved before checkout and prefilled; a field whose name is Note becomes note (1.x read only a textarea).
couponinput type="text"A discount code, applied by button[data-action="coupon"] or Enter, cleared after; a field whose name is Coupon becomes coupon.
gift-card (or Gift Card)input type="text"A gift card code, applied by button[data-action="gift-card"] (Enter only with gift-card).
emailinput type="email"With a quote (draft-order): the email of the draft order (the logged-in customer otherwise); without a quote a cart attribute.
quantityinput type="number"Inside a cart line: that line’s quantity.
draft-order (submit button)buttonSends the cart as a quote (draft order) instead of the checkout.
any other nameany fieldA cart attribute named as the field’s data-name, saved before checkout; refilled for text, textarea, select, radio and checkbox; a multiple select is joined with ,.

Attributes on the element

  • It reads data-open, data-draft, data-free-gift.

Attributes inside it

GroupAttribute nameValues
Cartcart11
Discountdiscount2
Gift cardgift-card3
Cart form and buttonsdata-name13
Loadingskeleton5
Cart (condition)cart-condition2

State classes

Smootify toggles loaded, is-rendered, is-empty-cart, has-taxes, has-empty-quote on it: style them in the site’s CSS for each state. See State classes.

Loading

Defined at boot on every page.

    ↑ ↓ to moveEnter to openEsc to close