Storefront and performance
What EnKart loads on your storefront, where, and how it keeps pages fast.
Where it loads#
EnKart's block and embed are only on product and cart pages. On every other page, EnKart adds nothing.
How offers reach the page#
Each product's offers are saved ahead of time in the product's own metafields, so your theme prints them with the page. Showing an offer needs no call to EnKart's servers. Only an item added to the cart from another page, which the page did not know about, is looked up once.
Offers on the product and cart page arrive with the page itself rather than being drawn in afterwards, so the page does not jump when they appear.
Scripts#
Each script is loaded deferred, only where it is needed: the deal script only on a page with a volume discount, bundle or add-on, the pop-up script only where a pop-up can open, and the cart drawer script only once a drawer opens. Every script is held to a budget of 9.5 KB compressed, which EnKart's tests check on every change.
| File | Compressed size |
|---|---|
| cu-block.js (offers on the page) | 9.1 KB |
| cu-drawer.js (cart drawer) | 7.1 KB |
| cu-deals.js (volume discounts, bundles, add-ons) | 6.6 KB |
| cu-popup.js (pop-ups) | 5.0 KB |
| cu-when.js (Show only when) | 2.7 KB |
| cu-events.js (views, clicks and adds) | 2.6 KB |
| cu.css (styles) | 2.0 KB |
Styling#
With Match my theme, the default, EnKart writes no colours or fonts of its own: offers take your theme's. A custom look is written as CSS variables on the offer itself, never into your theme's files.
Accessibility#
Offers are real buttons and form controls with labels, usable with a keyboard and a screen reader. Pop-ups trap focus while open, close with Escape, and return focus where it was.