Skip to content
CartSprig.
CARTSPRIG / EXTEND THE OFFER, KEEP THE FOUNDATION.

Extend the offer, keep the foundation.

Documented hooks around native WooCommerce behavior.

Eligibility filter

add_filter( 'cartsprig_rule_eligible', function ( $eligible, $rule, $cart ) {
    return $eligible;
}, 10, 3 );

Coordinate with another pricing plugin

add_filter( 'cartsprig_allow_discount', function ( $safe, $cart_item, $rule ) {
    // Return false when another integration owns this line price.
    return $safe;
}, 10, 3 );

Markup and events

The cartsprig_offer_html filter receives HTML and placement. Return escaped markup. The cartsprig_offer_accepted action receives the rule, product ID and cart key. Browser code receives cartsprig:added. Acceptance is not proof of purchase.

Order attribution

Use WooCommerce order APIs to read _cartsprig_rule and _cartsprig_campaign on discounted order items. Never query HPOS order data through the posts table.

Cart API

Cart/Checkout Blocks use the cartsprig Store API extension namespace with action claim, rule ID and product ID. The server validates the rule, stock and eligibility. Amounts sent by a browser are never used to set a price.

Source and licensing

CartSprig code is GPL-2.0-or-later. The bundled Freemius SDK retains its license and attribution. Paid subscriptions provide distribution, updates and support under the published license policy.