LaMarie Split-Payment Checkout Implementation
Overview
The LaMarie WooCommerce checkout requires a split-payment model: clients pay for products at the time of checkout, while service charges (Bookly appointments) are deferred for later collection. This is implemented via a custom functions.php script rather than a plugin, as no off-the-shelf WooCommerce extension cleanly handles this Bookly-product hybrid cart.
See also: [1] for the related appointment-sync problem this checkout flow surfaces.
The Problem
LaMarie's cart can contain two distinct item types simultaneously:
- Bookly appointment services — should not be charged at checkout
- WooCommerce products — should be charged at checkout as normal
Standard WooCommerce treats all cart items identically. Without intervention, the checkout total includes both, which is incorrect for this business model.
Solution: Custom functions.php Hook
Isahaque implemented a custom script added to the active theme's functions.php via the WordPress Theme File Editor. The script hooks into WooCommerce's cart/checkout calculation pipeline to:
- Exclude service line items from the subtotal at checkout time
- Charge only the product price when payment is processed
- Save the service/appointment details for deferred payment handling
Validation
A live test transaction during the team meeting confirmed the solution works as intended:
- A cart containing a Bookly appointment (Nov 19) and a product was submitted through checkout
- WooCommerce charged $26 (product price only)
- The order appeared in Square as Paid / Completed
- The appointment details were preserved for the Nov 19 booking
"In this cart, the prices will not add in subtotal." — Isahaque, confirming the script behaviour during the demo
Cart UI Refinements
Alongside the payment logic, the following visual improvements were agreed upon to make the split-cart legible to customers:
| Refinement | Detail |
|---|---|
| Section headers | Add "Services" and "Products" labels above their respective line items |
| Sort order | Services displayed first, Products below |
These changes are to be implemented by Isahaque as part of the same checkout pass.
Related: Product Subscription Option
During the meeting, a potential future requirement was raised: offering a one-time vs. subscribe toggle on product pages (similar to Amazon Subscribe & Save). This would appear on the product page itself, not in the cart.
Status: Unconfirmed — Melissa to verify this requirement with the client (Kimberly/Roxanna) before any implementation work begins.
Known Limitation: Bookly-Square Appointment Sync
The split-payment script successfully processes the WooCommerce payment through Square, but does not create a corresponding appointment in the Square calendar. This is a separate gap caused by Bookly's lack of native Square appointments integration.
See [1] for the custom Square API bridge being built to address this.
Implementation Notes
- Location: Active theme
functions.php(via Appearance → Theme File Editor in WP Admin) - Approach: WooCommerce action/filter hooks — no plugin dependency
- Square connection: Already active on the staging environment at time of testing
- Test card: Provided by Roxanna (client contact) for staging validation
Action Items (as of 2025-11-06)
| Owner | Task | Status |
|---|---|---|
| Isahaque | Add Services/Products headers and sort order to cart UI | In progress |
| Isahaque | Build Bookly-Square API bridge (prerequisite: API key from Chris) | Blocked → In progress |
| Chris | Create Square API key via developer account; share in shared client logins | Pending |
| Chris | Email Kimberly explaining the integration plan; include flow diagram and Melissa's screenshots | Pending |
| Melissa | Send Chris draft email text and checkout screenshots for Kimberly | Pending |
| Melissa | Confirm product subscription requirement with client | Pending |
Related Articles
- [1]
- [2]
- [3]