Download the PHP package fixstacks/module-zero-checkout without Composer
On this page you can find all versions of the php package fixstacks/module-zero-checkout. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fixstacks/module-zero-checkout
More information about fixstacks/module-zero-checkout
Files in fixstacks/module-zero-checkout
Package module-zero-checkout
Short Description Zero for Magento Open Source: a one-page checkout without Knockout: server-rendered HTML, one native form, HTMX for the parts that refresh.
License OSL-3.0 AFL-3.0
Homepage https://fixstacks.com/zero
Informations about the package module-zero-checkout
Zero_Checkout
A one-page checkout for Magento Open Source that replaces the Knockout
checkout: server-rendered HTML, one native <form>, HTMX for the parts that
refresh (shipping rates, totals, regions, saved addresses, discount code).
Offline payment methods work with JavaScript turned off.
Install
Requires Magento Open Source 2.4.7–2.4.9 and PHP 8.2–8.4 with the GD extension built with WebP (php -r 'var_dump(function_exists("imagewebp"));' says true; Magento's own PHP requirements cover the rest). Without WebP in GD, Zero skips its WebP image copies and serves the originals.
Composer installs fixstacks/module-zero-core with it.
Part of fixstacks/zero, which installs the Zero theme and every Zero module at once.
Features
| Feature | Where |
|---|---|
| Contact, shipping and billing addresses, saved-address picker | checkout/index.phtml, shipping-address-fields.phtml, billing-address-fields.phtml |
| Default shipping address prefilled for signed-in customers; new addresses saved to the address book | Controller/Checkout/Index, Model/Checkout/ShippingAddressUpdater |
Browser autofill (autocomplete tokens per section) |
address templates |
| Live shipping rates and totals | Controller/Checkout/Shippingmethods |
| Discount code in the order summary | Controller/Checkout/Coupon, coupon.phtml |
| Order comment, saved on the order | Model/PlaceOrder/OrderComment, order-comment.phtml |
| Terms and Conditions, checked on the server | Model/PlaceOrder/AgreementsValidator, agreements.phtml |
| Sign in from the checkout page | Controller/Checkout/Login, login.phtml |
| Order summary with item options | ViewModel/Checkout/CheckoutPage |
| Payment: offline methods, purchase order; Braintree, Stripe, Authorize.Net, PayPal Standard from their own Zero modules | zero.checkout.payment.* containers |
Settings
Stores > Configuration > Zero > Checkout:
| Group | Setting | Path | Default |
|---|---|---|---|
| Zero Checkout | Enabled | checkout/zero_checkout/enabled |
Yes |
| Checkout Page | Discount Code Field | checkout/zero_checkout/coupon |
Yes |
| Checkout Page | Order Comment | checkout/zero_checkout/order_comment |
Yes |
| Checkout Page | Sign In at Checkout | checkout/zero_checkout/login |
Yes |
| Terms and Conditions | Enable Terms and Conditions | checkout/options/enable_agreements (Magento's) |
No |
The agreements are edited in Stores > Terms and Conditions. Payment methods are configured in Sales > Payment Methods.
Extending the checkout
Four extension points, all wired with layout XML or di.xml; nothing in
Zero_Checkout needs to change.
1. Add a field or a block to the page
Layout containers in zero_checkout_index.xml:
| Container | Position | Inside the checkout form? |
|---|---|---|
zero.checkout.login (block) |
above the form | no |
zero.checkout.shipping.after |
right after the shipping methods (a carrier's own fields) | yes |
zero.checkout.payment.express |
above the payment methods | yes |
zero.checkout.payment.forms |
below the payment methods (card fields) | yes |
zero.checkout.summary.totals.before |
order summary, above the totals | yes |
zero.checkout.place-order.before |
right above Place Order | yes |
Fields inside the form are posted with the order.
Style with the classes Zero's templates already use, or the theme's
Tailwind build won't include them (see the theme's docs/child-themes.md).
2. Check something before the order is placed
Implement Zero\Checkout\Api\PlaceOrderValidatorInterface. It runs after the
form's addresses, shipping method and payment are on the quote; throw
LocalizedException to stop the order, and the message is shown on the
checkout page.
3. Do something once the order exists
Implement Zero\Checkout\Api\AfterPlaceOrderInterface. A failure here is
logged and the shopper still reaches the success page.
Register both:
Items are keyed by name, so a module can also replace or remove a built-in
one (agreements, order_comment) by reusing its key.
4. Add a payment method
Zero Checkout lists only the payment methods it knows how to complete. A
payment module registers its method code (and an optional one-line
description) with Zero\Checkout\Model\SupportedPaymentMethods:
Then, depending on the method:
- Offline / redirect after placing — nothing else; a method that needs an
off-site step puts the payment page's URL in the order payment's
additional information as
zero_redirect_url(Placeorder::REDIRECT_URL) while the order is placed, and the customer goes there instead of the success page (seeZero_Monobank,Zero_LiqPay). - Card fields or a client SDK — add the form to
zero.checkout.payment.formsand show it only while the method is selected (#payment-methods:has(input[value="acme_pay"]:checked) ~ #acme-pay-panelin CSS, as Zero_Braintree, Zero_Stripe and Zero_AuthorizeNet do). The script tokenizes on submit into a hidden field namedpayment_additional_data[<key>]; Placeorder puts every such field into the payment'sadditional_data, where your method'sassignData()(or an observer) reads it.
Zero_Braintree is the smallest complete example: a view model, a template, a script and one layout file.
What not to change
- The checkout
<form>posts tozero/checkout/placeorder; don't nest other<form>elements inside it (usetype="button"+hx-post, like the discount code). hx-sync="#shipping-methods:replace"on address fields keeps the newest rate request winning.form_keyis in the form; HTMX posts include it withhx-include="[name='form_key']".
License
OSL-3.0 or AFL-3.0, your choice: see NOTICE.md.
Zero is made by Fixstacks in partnership with Vilmate, a software development company. Documentation: https://fixstacks.com/zero/docs. Demo store: https://zero.fixstacks.com.
All versions of module-zero-checkout with dependencies
magento/framework Version 103.0.*
magento/module-backend Version *
magento/module-bundle Version *
magento/module-catalog Version *
magento/module-checkout Version *
magento/module-checkout-agreements Version *
magento/module-config Version *
magento/module-customer Version *
magento/module-directory Version *
magento/module-downloadable Version *
magento/module-offline-payments Version *
magento/module-payment Version *
magento/module-quote Version *
magento/module-sales Version *
magento/module-store Version *
fixstacks/module-zero-core Version ^1.1