ADD TO CART POPUP — V1.0
CE Phoenix add-on | Released 25 October 2026

Customers can add products without leaving the current page. A popup shows the
basket contents, product thumbnails, selected options, quantities, line prices
and subtotal including VAT where applicable.

BUTTONS
Continue shopping closes the popup and leaves the customer on the current page.
View basket opens the full basket for quantity changes or removals.
Checkout follows Phoenix's normal checkout_shipping.php route, including the
installed OPC redirect. Stock warnings route customers to the basket first.
Delivery charges, discount codes and other adjustments are handled at checkout.

INSTALL / UPGRADE FROM TEST BUILDS
Upload everything INSIDE catalog/ to your store root, preserving folders.
Overwrite all four add-on files from any previous test version:

includes/hooks/shop/system/_22zCartPopup.php
includes/hooks/shop/siteWide/cartPopup.php
ext/cart_popup/cart_popup.js
ext/cart_popup/cart_popup.css

Do not upload the enclosing catalog folder itself.
No database changes, admin installation or Phoenix core edits are required.
Refresh an open product page with Ctrl+F5 after uploading.
The clean release removes the temporary yellow diagnostics and console logging.
No old add-on files need deleting when upgrading from the supplied test builds.

COMPATIBILITY AND VALIDATION
Developed against official CE Phoenix 1.1.0.6 interfaces, targeting PHP 8.2.
The store owner confirmed the popup and follow-up product-options/OPC checks
worked on the test store. Other Phoenix versions have not been verified.
JavaScript syntax and simulated browser behaviour checked, including confirmed
adds, unconfirmed responses and network errors without automatically retrying.
Startup hook ordering checked against the official Phoenix installation SQL.

HOW IT WORKS
A system hook records the basket before Phoenix processes the add action.
Phoenix's existing add-to-cart logic handles the product, options and quantity.
After its normal redirect, the sitewide hook checks for an increased quantity.
The browser then displays the updated basket in a native dialog and refreshes
the standard navbar basket and offcanvas contents. Escape, Close or clicking
outside the popup closes it. Mobile layouts stack the action buttons.
JavaScript and CSS are embedded by the hook to avoid separate asset requests.

FALLBACK AND SCOPE
Without JavaScript or native dialog support, normal cart navigation remains.
Buy Now products requiring options follow Phoenix's product-page redirect.
If the add cannot be confirmed or the popup fails, the browser opens the returned
page or basket. It never automatically repeats an uncertain add request.
Custom counters and third-party buttons using direct form.submit() may need
separate integration. The popup does not provide quantity editing or removal.

QUICK CHECK AFTER INSTALLING ON ANOTHER STORE
Add a plain product, continue shopping, and add it again to check quantity.
Check product options, specials, VAT, stock restrictions and checkout routing.
Try signed-in and guest baskets, plus a narrow/mobile screen.

UNINSTALL
Delete the two hook files listed above and the ext/cart_popup/ directory.
Refresh the browser. Phoenix returns to normal add-to-cart behaviour.

LICENCE
GPL. Phoenix, E-Commerce made Easy — https://phoenixcart.org
Copyright (c) 2026 Mort-Lemur.
