Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
This page documents the new Vitrin account functions and shows the old Zid equivalents.
window.zid.account
.zid.account.get()
zid.account.update(payload)
payload
(object, required) — The customer data to update:name
(string, required) — Customer's full name.email
(string, required) — Customer's email address.is_newsletter_subscriber
(boolean, required) — Newsletter subscription preference.gender
(string | null, optional) — Customer's gender.birth_date
(string | null, optional) — Customer's birth date.
zid.account.addresses()
zid.store.customer.fetchAddresses()
zid.account.addAddress(payload)
payload
(object, required) — Address creation details.address_district
(string, required) — District/neighborhood name.address_city_id
(number, required) — City ID.address_country_id
(number, required) — Country ID.address_type
(string, optional) — Address type (defaults to "GENERAL").name
(string, optional) — Address nickname/label.mobile
(string, optional) — Mobile phone number.address_street
(string, optional) — Street address.address_formatted
(string, optional) — Formatted full address.short_address
(string, optional) — Short address label.address_lat
(string, optional) — Latitude coordinate.address_lng
(string, optional) — Longitude coordinate.is_default
(boolean, optional) — Whether this is the default address.meta
(object, optional) — Additional metadata containing:city_name
(string, optional) — City name.postcode
(string, optional) — Postal code.building_number
(string, optional) — Building number.additional_number
(string, optional) — Additional/unit number.{
"address_district": "Downtown",
"address_city_id": 123,
"address_country_id": 456,
"address_type": "HOME",
"name": "My Home Address",
"mobile": "+1234567890",
"address_street": "123 Main Street",
"address_formatted": "123 Main Street, Downtown, City",
"short_address": "123 Main St",
"address_lat": "40.7128",
"address_lng": "-74.0060",
"is_default": true,
"meta": {
"city_name": "New York",
"postcode": "10001",
"building_number": "123",
"additional_number": "Apt 4B"
}
}
{
"address_district": "Downtown",
"address_city_id": 123,
"address_country_id": 456
}
address_district
, address_city_id
, and address_country_id
are requiredaddress_lat
and address_lng
are strings, not numberspostcode
, building_number
, additional_number
, and city_name
go inside the meta
objectzid.account.editAddress(address_id, payload)
zid.store.customer.updateAddress()
or similar)address_id
(number, required) — The ID of the address to update.payload
(object, required) — Address update details.address_district
(string, required) — District/neighborhood name.address_city_id
(number, required) — City ID.address_country_id
(number, required) — Country ID.address_type
(string, optional) — Address type (defaults to "GENERAL").name
(string, optional) — Address nickname/label.mobile
(string, optional) — Mobile phone number.address_street
(string, optional) — Street address.address_formatted
(string, optional) — Formatted full address.short_address
(string, optional) — Short address label.address_lat
(string, optional) — Latitude coordinate.address_lng
(string, optional) — Longitude coordinate.is_default
(boolean, optional) — Whether this is the default address.meta
(object, optional) — Additional metadata containing:city_name
(string, optional) — City name.postcode
(string, optional) — Postal code.building_number
(string, optional) — Building number.additional_number
(string, optional) — Additional/unit number.{
"address_district": "Downtown",
"address_city_id": 123,
"address_country_id": 456,
"address_type": "HOME",
"name": "My Home Address",
"mobile": "+1234567890",
"address_street": "123 Main Street",
"address_formatted": "123 Main Street, Downtown, City",
"short_address": "123 Main St",
"address_lat": "40.7128",
"address_lng": "-74.0060",
"is_default": true,
"meta": {
"city_name": "New York",
"postcode": "10001",
"building_number": "123",
"additional_number": "Apt 4B"
}
}
{
"address_district": "Downtown",
"address_city_id": 123,
"address_country_id": 456
}
address_district
, address_city_id
, and address_country_id
are requiredaddress_lat
and address_lng
are strings, not numberspostcode
, building_number
, additional_number
, and city_name
go inside the meta
objectzid.account.deleteAddress(address_id)
address_id
(number, required) — The ID of the address to delete.
zid.account.wishlists(params?)
params
(object, optional) — Optional parameters:share_token
(string) — Token to view a shared wishlist.page
(number) — Page number for pagination.page_size
(number) — Number of items per page.
zid.account.addToWishlists(payload)
payload
(object, required) — { product_ids: string[] }
zid.account.shareWishlist()
zid.account.removeFromWishlist(product_id)
zid.store.customer.removeFromWishlist(product_id)
product_id
(string, required) — The product ID
zid.account.orders(params?)
params
(object, optional) — Optional pagination parameters:page
(number) — Page number for pagination.page_size
(number) — Number of orders per page.