wiki/knowledge/woocommerce/lamarie-split-payment-checkout.md Layer 2 article 624 words Updated: 2026-04-05
↓ MD ↓ PDF
woocommerce lamarie checkout split-payments functions-php wordpress bookly

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:

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:

  1. Exclude service line items from the subtotal at checkout time
  2. Charge only the product price when payment is processed
  3. Save the service/appointment details for deferred payment handling

Validation

A live test transaction during the team meeting confirmed the solution works as intended:

"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.


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


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