🚨 Important Update: Zid Themes
Key Changes
customer
object will no longer be available.window.customer
will also no longer be available.{{ customer.name }} // no longer works
{{ customer.email }} // no longer works
{{ customer.wishlist }} // no longer works
{{ session.customerToken }} // no longer works
{% if customer %} // no longer works
<div>HTML content</div>
{% endif %}
<script>
window.customer // no longer works
</script>
Affected Files
1. Twig Files:
account-profile.twig
account-addresses.twig
account-orders.twig
account-wishlist.twig
2. JavaScript Files:
window.customer
 object.Alternative Methods to Retrieve Customer Information
1. Using Zid Tags:
<zid-store-customer>
tag.{{ customer.name }}
with <zid-store-customer get="name"></zid-store-customer>
.
<zid-store-customer>
tag dynamically retrieves and replaces customer details.{% if customer %}
with zid-visible-customer="true"
or zid-visible-guest="true"
.
zid-visible-customer="true"
will be hiddenzid-visible-wishlist="{{ product.id }}"
or zid-hidden-wishlist="{{ product.id }}"
.
2. Using JavaScript Event Listener:
zid-customer-fetched
event to retrieve customer data. If the user is a guest, the customer
object will be null
.document.addEventListener('zid-customer-fetched', function(event) {
var customer = event.detail.customer; // null if the user is a guest
if (customer) {
$('.send-notify-name').val(customer.name);
$('.send-notify-email').val(customer.email);
}
});
Modified at 2024-12-16 10:49:55