Objects
customeris available in every template and is nil when no customer is logged in. It has the contact details,tags,orders_count,total_spent,orders,last_order,addresses,default_addressandnew_address. See customer.{% paginate customer.orders by 10 %}paginates the orders, newest first.- A new
addressobject describes customer and shipping addresses. See address. orderhasref,name,created_at,financial_status,fulfillment_status,customer_urlandshipping_address. See order.routeshasaccount_url,account_login_url,account_logout_url,account_register_url,account_recover_urlandaccount_addresses_url. See routes.
Templates
- New template types:
customer-login,customer-register,customer-account,customer-order,customer-addressesandcustomer-reset-password. See templates. - The templates are optional. Without one, the store shows its built-in page.
customer-loginrenders/account/loginand/account/recover.customer-accountrenders/accountand/account/orders.customer-orderrenders/account/orders/{id}with anorderobject.
Forms
- New form types:
customer_login,create_customer,recover_customer_password,reset_customer_password,customer_update,customer,customer_addressandcustomer_address_remove. See form. - The login, register, recover, reset and
customerforms output a captcha. customersubscribes an email to the store's marketing emails.
Storefront API
- New endpoints:
POST /customers/logout,POST /customers/recoverandPOST /customers/reset. See customers. POST /customers/loginreturns a bearer token that expires after 30 days.POST /customersreturns202when the email already belongs to a customer. The store then sends an email to finish the account.PUT /customers/accountneedscurrent_passwordto change the email or the password. A new password returns a new token and revokes the others.GET /customers/orderstakespageandlimit, and returns fewer fields for each order.POST /customersandPUT /customers/accountno longer takecountry,region,cityornotes.