Ajax Add To Cart is a fully encapsulated, observer-based plugin for Zen Cart that intercepts standard product additions and performs them asynchronously. It is built for Zen Cart 2.x - not a refresh of the old 2014 module.
Highlights
- Zero core edits - 100% observer-based; upload to
zc_plugins, install via Plugin Manager
- Template agnostic - confirmed with Responsive Classic and ZCA Bootstrap; CSS can be overridden via your template
- Native UI updates - re-renders the Shopping Cart sidebox, header cart/checkout links, and "Quantity in Cart" text using your active template's own HTML
- Interactive modal - responsive success popup with product names, live cart totals / item count, Continue Shopping and View Cart
- Admin controlled - form/button/link selectors, sidebox and header targets, feature toggles under Configuration > Ajax Add To Cart
- Complex forms - standard product forms, multi-product checkboxes, and quantity-box grids; falls back to native submit for file uploads
What gets updated after add-to-cart
- Modal popup with success message, subtotal, and item count
- Shopping cart sidebox - rendered from Zen Cart's native sidebox module and injected in the correct column/sort position (even if the empty-cart layout hid it)
- Header cart & checkout links - extracted from your active
tpl_header.php and injected when the empty-cart header omitted them
- In-cart quantity on product pages - matches Zen Cart's native
in_cart_mixed() / show-product-switch logic
Developer hooks
- PHP:
NOTIFY_AJAX_ADD_TO_CART_FILTER_RESPONSE before JSON encode - inject custom HTML payloads
- JS:
ajaxAddToCartSuccess document event with response + originating form data
- Set
response.disableModal = true from your script to suppress the default modal (e.g. custom mini-cart)