fluentcart-developer 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +26 -26
- package/README.md +59 -59
- package/dist/cards/fluentcart/templates-native.js +1087 -1087
- package/dist/cards/fluentcart/tools.js +2309 -2309
- package/dist/skills/fluentcart-developer/SKILL.md +108 -108
- package/dist/skills/fluentcart-developer/examples/README.md +30 -30
- package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
- package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
- package/dist/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +113 -113
- package/dist/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +148 -148
- package/dist/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/README.md +22 -22
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/sample-plugin-with-licensing-sdk.php +79 -79
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/FluentLicensing.php +303 -303
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/LicenseSettings.php +566 -566
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/PluginUpdater.php +304 -304
- package/dist/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +61 -61
- package/dist/skills/fluentcart-developer/references/api/authentication.md +452 -452
- package/dist/skills/fluentcart-developer/references/api/coupons.md +786 -786
- package/dist/skills/fluentcart-developer/references/api/customers.md +889 -889
- package/dist/skills/fluentcart-developer/references/api/files.md +609 -609
- package/dist/skills/fluentcart-developer/references/api/index.md +432 -432
- package/dist/skills/fluentcart-developer/references/api/licensing.md +633 -633
- package/dist/skills/fluentcart-developer/references/api/order-bump.md +384 -384
- package/dist/skills/fluentcart-developer/references/api/orders.md +814 -814
- package/dist/skills/fluentcart-developer/references/api/products.md +866 -866
- package/dist/skills/fluentcart-developer/references/api/roles-permissions.md +536 -536
- package/dist/skills/fluentcart-developer/references/api/subscriptions.md +827 -827
- package/dist/skills/fluentcart-developer/references/database/index.md +44 -44
- package/dist/skills/fluentcart-developer/references/database/models/activity.md +178 -178
- package/dist/skills/fluentcart-developer/references/database/models/applied-coupon.md +291 -291
- package/dist/skills/fluentcart-developer/references/database/models/attribute-group.md +239 -239
- package/dist/skills/fluentcart-developer/references/database/models/attribute-relation.md +181 -181
- package/dist/skills/fluentcart-developer/references/database/models/attribute-term.md +219 -219
- package/dist/skills/fluentcart-developer/references/database/models/cart.md +645 -645
- package/dist/skills/fluentcart-developer/references/database/models/coupon.md +427 -427
- package/dist/skills/fluentcart-developer/references/database/models/customer-addresses.md +348 -348
- package/dist/skills/fluentcart-developer/references/database/models/customer-meta.md +156 -156
- package/dist/skills/fluentcart-developer/references/database/models/customer.md +584 -584
- package/dist/skills/fluentcart-developer/references/database/models/dynamic-model.md +163 -163
- package/dist/skills/fluentcart-developer/references/database/models/label-relationship.md +155 -155
- package/dist/skills/fluentcart-developer/references/database/models/label.md +153 -153
- package/dist/skills/fluentcart-developer/references/database/models/license-activation.md +182 -182
- package/dist/skills/fluentcart-developer/references/database/models/license-meta.md +163 -163
- package/dist/skills/fluentcart-developer/references/database/models/license-site.md +208 -208
- package/dist/skills/fluentcart-developer/references/database/models/license.md +640 -640
- package/dist/skills/fluentcart-developer/references/database/models/meta.md +233 -233
- package/dist/skills/fluentcart-developer/references/database/models/order-address.md +391 -391
- package/dist/skills/fluentcart-developer/references/database/models/order-download-permission.md +144 -144
- package/dist/skills/fluentcart-developer/references/database/models/order-item.md +383 -383
- package/dist/skills/fluentcart-developer/references/database/models/order-meta.md +303 -303
- package/dist/skills/fluentcart-developer/references/database/models/order-operation.md +158 -158
- package/dist/skills/fluentcart-developer/references/database/models/order-promotion-stat.md +175 -175
- package/dist/skills/fluentcart-developer/references/database/models/order-promotion.md +250 -250
- package/dist/skills/fluentcart-developer/references/database/models/order-tax-rate.md +172 -172
- package/dist/skills/fluentcart-developer/references/database/models/order-transaction.md +440 -440
- package/dist/skills/fluentcart-developer/references/database/models/order.md +727 -727
- package/dist/skills/fluentcart-developer/references/database/models/product-detail.md +397 -397
- package/dist/skills/fluentcart-developer/references/database/models/product-download.md +258 -258
- package/dist/skills/fluentcart-developer/references/database/models/product-meta.md +153 -153
- package/dist/skills/fluentcart-developer/references/database/models/product-variation.md +556 -556
- package/dist/skills/fluentcart-developer/references/database/models/product.md +580 -580
- package/dist/skills/fluentcart-developer/references/database/models/relationships.md +427 -427
- package/dist/skills/fluentcart-developer/references/database/models/scheduled-action.md +175 -175
- package/dist/skills/fluentcart-developer/references/database/models/shipping-class.md +148 -148
- package/dist/skills/fluentcart-developer/references/database/models/shipping-method.md +280 -280
- package/dist/skills/fluentcart-developer/references/database/models/shipping-zone.md +205 -205
- package/dist/skills/fluentcart-developer/references/database/models/subscription-meta.md +173 -173
- package/dist/skills/fluentcart-developer/references/database/models/subscription.md +528 -528
- package/dist/skills/fluentcart-developer/references/database/models/tax-class.md +195 -195
- package/dist/skills/fluentcart-developer/references/database/models/tax-rate.md +225 -225
- package/dist/skills/fluentcart-developer/references/database/models/user-meta.md +166 -166
- package/dist/skills/fluentcart-developer/references/database/models/user.md +220 -220
- package/dist/skills/fluentcart-developer/references/database/models.md +404 -404
- package/dist/skills/fluentcart-developer/references/database/query-builder.md +860 -860
- package/dist/skills/fluentcart-developer/references/database/readme.md +276 -276
- package/dist/skills/fluentcart-developer/references/database/schema.md +1002 -1002
- package/dist/skills/fluentcart-developer/references/engineering/adding-custom-pages-to-the-customer-dashboard.md +395 -395
- package/dist/skills/fluentcart-developer/references/engineering/index.md +4 -4
- package/dist/skills/fluentcart-developer/references/engineering.md +4 -4
- package/dist/skills/fluentcart-developer/references/getting-started.md +249 -249
- package/dist/skills/fluentcart-developer/references/guides/frontend.md +519 -519
- package/dist/skills/fluentcart-developer/references/guides/index.md +107 -107
- package/dist/skills/fluentcart-developer/references/guides/integrations.md +600 -600
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/index.md +237 -237
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/labels-and-tracking.md +481 -481
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/live-rates.md +269 -269
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/reference.md +223 -223
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/settings.md +370 -370
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier.md +237 -237
- package/dist/skills/fluentcart-developer/references/guides/subscriptions.md +217 -217
- package/dist/skills/fluentcart-developer/references/hooks/actions/admin-and-templates.md +1079 -1079
- package/dist/skills/fluentcart-developer/references/hooks/actions/cart-and-checkout.md +1795 -1795
- package/dist/skills/fluentcart-developer/references/hooks/actions/customers-and-users.md +327 -327
- package/dist/skills/fluentcart-developer/references/hooks/actions/licenses.md +829 -829
- package/dist/skills/fluentcart-developer/references/hooks/actions/modules.md +81 -81
- package/dist/skills/fluentcart-developer/references/hooks/actions/orders.md +757 -757
- package/dist/skills/fluentcart-developer/references/hooks/actions/payments-and-integrations.md +1163 -1163
- package/dist/skills/fluentcart-developer/references/hooks/actions/pro-modules.md +219 -219
- package/dist/skills/fluentcart-developer/references/hooks/actions/products-and-coupons.md +1019 -1019
- package/dist/skills/fluentcart-developer/references/hooks/actions/subscriptions.md +1290 -1290
- package/dist/skills/fluentcart-developer/references/hooks/actions.md +16 -16
- package/dist/skills/fluentcart-developer/references/hooks/deprecated.md +60 -60
- package/dist/skills/fluentcart-developer/references/hooks/filters/cart-and-checkout.md +2032 -2032
- package/dist/skills/fluentcart-developer/references/hooks/filters/customers-and-subscriptions.md +1746 -1746
- package/dist/skills/fluentcart-developer/references/hooks/filters/integrations-and-advanced.md +2439 -2439
- package/dist/skills/fluentcart-developer/references/hooks/filters/modules.md +464 -464
- package/dist/skills/fluentcart-developer/references/hooks/filters/orders-and-payments.md +2658 -2658
- package/dist/skills/fluentcart-developer/references/hooks/filters/pro-modules.md +502 -502
- package/dist/skills/fluentcart-developer/references/hooks/filters/products-and-pricing.md +1785 -1785
- package/dist/skills/fluentcart-developer/references/hooks/filters/settings-and-configuration.md +2966 -2966
- package/dist/skills/fluentcart-developer/references/hooks/filters.md +14 -14
- package/dist/skills/fluentcart-developer/references/hooks/index.md +35 -35
- package/dist/skills/fluentcart-developer/references/index.md +625 -625
- package/dist/skills/fluentcart-developer/references/modules/fee-system.md +427 -427
- package/dist/skills/fluentcart-developer/references/modules/ghost-product-selling.md +440 -440
- package/dist/skills/fluentcart-developer/references/modules/index.md +484 -484
- package/dist/skills/fluentcart-developer/references/modules/licensing.md +342 -342
- package/dist/skills/fluentcart-developer/references/modules/order-bump.md +433 -433
- package/dist/skills/fluentcart-developer/references/modules/payment-methods.md +129 -129
- package/dist/skills/fluentcart-developer/references/modules/refunds.md +170 -170
- package/dist/skills/fluentcart-developer/references/modules/shipping.md +846 -846
- package/dist/skills/fluentcart-developer/references/modules/storage.md +986 -986
- package/dist/skills/fluentcart-developer/references/modules/subscription-vendor-ids.md +186 -186
- package/dist/skills/fluentcart-developer/references/modules/subscriptions.md +678 -678
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/index.md +164 -164
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/paddle-example.md +1648 -1648
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/payment/setting/fields.md +353 -353
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/quick-implementation.md +1079 -1079
- package/dist/skills/fluentcart-developer/references/payment-methods-integration.md +164 -164
- package/dist/skills/fluentcart-developer/references/restapi/checkout.md +573 -573
- package/dist/skills/fluentcart-developer/references/restapi/coupons.md +958 -958
- package/dist/skills/fluentcart-developer/references/restapi/customer-profile.md +1423 -1423
- package/dist/skills/fluentcart-developer/references/restapi/customers.md +1103 -1103
- package/dist/skills/fluentcart-developer/references/restapi/dashboard.md +1083 -1083
- package/dist/skills/fluentcart-developer/references/restapi/data-export.md +132 -132
- package/dist/skills/fluentcart-developer/references/restapi/email-notifications.md +846 -846
- package/dist/skills/fluentcart-developer/references/restapi/files.md +313 -313
- package/dist/skills/fluentcart-developer/references/restapi/index.md +127 -127
- package/dist/skills/fluentcart-developer/references/restapi/integrations.md +1000 -1000
- package/dist/skills/fluentcart-developer/references/restapi/inventory.md +192 -192
- package/dist/skills/fluentcart-developer/references/restapi/labels-and-attributes.md +797 -797
- package/dist/skills/fluentcart-developer/references/restapi/licensing.md +1733 -1733
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-available-shipping-methods.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-checkout-summary.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-country-info.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-order-info.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-shipping-methods-list-view.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/login.md +66 -66
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/place-order.md +179 -179
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/apply-coupon.md +83 -83
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/cancel-coupon.md +87 -87
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/check-product-eligibility.md +59 -59
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/create-coupon.md +230 -230
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/delete-coupon.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupon-codes.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupons.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/re-apply-coupons.md +75 -75
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/store-coupon-settings.md +40 -40
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/update-coupon.md +133 -133
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-address-checkout.md +138 -138
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-profile-address.md +119 -119
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/dashboard-overview.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/delete-profile-address.md +46 -46
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-order-details.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-portal-sections.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-profile-details.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-transaction-billing-address.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-upgrade-paths.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-downloads.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-orders.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/make-profile-address-primary.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/pause-subscription.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/resume-subscription.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/save-transaction-billing-address.md +92 -92
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/select-address-for-checkout.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-address.md +115 -115
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-details.md +69 -69
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/attach-user.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/bulk-actions.md +65 -65
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-address.md +135 -135
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-customer.md +108 -108
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/delete-address.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/detach-user.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/find-customer-order.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-attachable-users.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-addresses.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-orders.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-stats.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/list-customers.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/recalculate-ltv.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/set-primary-address.md +72 -72
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-additional-info.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-address.md +144 -144
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-customer.md +123 -123
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/attach-note-to-order.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-all-pages.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-single-page.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/delete-activity.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-country-info.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-dashboard-stats.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-filter-options.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-data.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-print-templates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-search-options.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-widgets.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/initialize-app.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-activities.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-attachments.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-countries.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/mark-activity-read.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/run-data-backfills.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-settings.md +54 -54
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-tax-settings.md +73 -73
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-print-templates.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/upload-attachment.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-customers-batch.md +129 -129
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-licenses-batch.md +133 -133
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-orders-batch.md +129 -129
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-subscriptions-batch.md +129 -129
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-customers-export-schema.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-licenses-export-schema.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-orders-export-schema.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-subscriptions-export-schema.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/enable-notification.md +57 -57
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-digest-settings.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-notification.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-reminders.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-settings.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-shortcodes.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/list-notifications.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-default-template.md +66 -66
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-notification.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-digest-settings.md +101 -101
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-reminders.md +162 -162
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-settings.md +99 -99
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-digest-test.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-manual-reminder.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/update-notification.md +93 -93
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/delete-file.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/get-bucket-list.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/list-files.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-editor-file.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-file.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/chained-data-request.md +46 -46
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/change-feed-status.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/delete-feed.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-dynamic-options.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-lists.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-settings.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-feeds.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-settings.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/install-addon-plugin.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/list-addons.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/save-feed-settings.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/set-global-settings.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/bulk-update-stock.md +94 -94
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/export-inventory.md +81 -81
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-adjustment-history.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-inventory-stats.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/list-inventory.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/update-stock.md +75 -75
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-attribute-group.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-label.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-terms.md +90 -90
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-group.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-term.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-group.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-library.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-groups.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-terms.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-labels.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-groups.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-terms.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-group.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-term.md +39 -39
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-label-selections.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-plugin-license.md +41 -41
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-site-admin.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-plugin-license.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-admin.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-customer.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/delete-license.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/extend-license-validity.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-license-details.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-licenses-admin.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-activations.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-details.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-site.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-plugin-license-status.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-product-license-settings.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-customer-licenses.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-license-sites.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-licenses.md +38 -38
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-activate-license.md +54 -54
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-check-license.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-deactivate-license.md +46 -46
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-download-license-package.md +23 -23
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-get-license-version.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/regenerate-license-key.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/save-product-license-settings.md +193 -193
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-activation-limit.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-status.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/create-order-bump.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/delete-order-bump.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/get-order-bump.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/list-order-bumps.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/update-order-bump.md +141 -141
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/accept-dispute.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/bulk-actions.md +72 -72
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-shipping.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-tax.md +98 -98
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/change-customer.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/charge-now.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-and-change-customer.md +92 -92
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-custom-order-item.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-order.md +351 -351
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-renewal-now.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/delete-order.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/generate-missing-licenses.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order-transactions.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-renewal.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-shipping-methods.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-single-transaction.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-order-currencies.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-orders.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-renewals.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/mark-as-paid.md +61 -61
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/price-order.md +135 -135
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/refund-order.md +72 -72
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/resend-renewal-invoice.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/skip-renewal.md +48 -48
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-order-statuses.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-pending-transaction.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address-id.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address.md +98 -98
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order.md +172 -172
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-statuses.md +77 -77
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-subscription-details.md +84 -84
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-transaction-status.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/void-renewal.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/create-pdf-template.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/delete-pdf-template.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/download-pdf-preview.md +44 -44
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-factory-default-templates.md +19 -19
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-status.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-template.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-saved-templates.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-seller-details.md +19 -19
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/list-pdf-templates.md +19 -19
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-pdf-template.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-seller-details.md +97 -97
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/add-product-terms.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-edit-fetch.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-insert-products.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-products.md +59 -59
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-variants.md +83 -83
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/change-integration-status.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-dummy-products.md +45 -45
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-product.md +81 -81
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-variation.md +181 -181
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-downloadable-file.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product-integration.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-taxonomy-term.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-upgrade-path.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-variation.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/do-bulk-action.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/duplicate-product.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-products-by-ids.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-taxonomy-terms.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-terms-by-parent.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-variations-by-ids.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/find-subscription-variants.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-bundle-info.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-downloadable-url.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-max-excerpt-word-count.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-pricing-widgets.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-feeds.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-settings.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-pricing.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-related-products.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-upgrade-settings.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-variation-upgrade-paths.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/group-bulk-update-variants.md +103 -103
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-all-variants.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-product-variations.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-products.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-shipping-class.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-tax-class.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-bundle-info.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-product-integration.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-upgrade-path.md +78 -78
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-product-variant-options.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-products-by-name.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-variants-by-name.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/set-variation-media.md +74 -74
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/suggest-sku.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-downloadable-files.md +134 -134
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-taxonomy-terms.md +61 -61
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/toggle-product-tax-exemption.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-downloadable-file.md +98 -98
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-inventory.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-long-desc-editor-mode.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-manage-stock.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-detail.md +58 -58
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-pricing.md +225 -225
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-shipping-class.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-tax-class.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-upgrade-path.md +78 -78
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-option.md +79 -79
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-tax-exemption.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation-pricing-table.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation.md +105 -105
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/get-product-views.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/list-products.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/search-products.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/channel-rules.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/country-heat-map.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupon-overview.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupons.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-insights.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-overview.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-repeat.md +35 -35
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segment-customers.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segments.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-value.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/dashboard-stats.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/failed-orders.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-new-vs-returning-customer.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-by-day-and-hour.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-meta.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-top-sold-products.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/future-renewals.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/generate-retention-snapshots.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-overview.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-activities.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-orders.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-revenue.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-at-risk.md +35 -35
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-variations.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/item-count-distribution.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-chart.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-pie-chart.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-summary.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/locations.md +43 -43
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-chart.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-completion-time.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-mix.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-value-distribution.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-disputes.md +38 -38
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-methods.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison-launch.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison.md +40 -40
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-detail.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-sales.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/refunds-overview.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/retention-snapshots-step.md +45 -45
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sales-growth-chart.md +35 -35
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/save-channel-rules.md +73 -73
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/source-channels.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sources.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-cohorts.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-health.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-rebuys.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-retention.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-variations.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscriptions-overview.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/weeks-between-refund.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/assign-role.md +48 -48
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/delete-role-assignment.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/get-role.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-managers.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-roles.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/search-users.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/update-role.md +43 -43
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/create-saved-view.md +106 -106
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/delete-saved-view.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/list-saved-views.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/update-saved-view.md +83 -83
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-payment-addon.md +44 -44
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-plugin-addon.md +44 -44
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/change-storage-driver-status.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/check-paypal-webhook.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/create-storage-bucket.md +63 -63
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/disconnect-payment-method.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/exchange-paypal-seller-auth-token.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-active-storage-drivers.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-checkout-fields.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-email-shortcodes.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-config-snippets.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-status.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-module-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-connection-info.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-settings.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-permissions.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-plugin-addons.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-storage-driver-settings.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-store-settings.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-mcp-adapter.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-payment-addon.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-plugin-addon.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-payment-methods.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-storage-drivers.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-storage-buckets.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reorder-payment-methods.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reset-storage-driver-settings.md +45 -45
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-checkout-fields.md +133 -133
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-confirmation-settings.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-module-settings.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-design.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-settings.md +58 -58
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-permissions.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-storage-driver-settings.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-store-settings.md +239 -239
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/setup-paypal-webhook.md +48 -48
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/toggle-mcp.md +40 -40
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-storage-driver-connection.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-turnstile-keys.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-class.md +73 -73
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-method.md +110 -110
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-zone.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-class.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-method.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-zone.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class-profile.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-packages.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-zone.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-countries.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-states.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-classes.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-zones.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/save-shipping-packages.md +112 -112
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-class.md +79 -79
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-method.md +113 -113
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-zone.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-zone-order.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-auto-renew.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-subscription.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/confirm-subscription-switch.md +70 -70
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/fetch-subscription-remote.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/generate-early-payment-link.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-customer-subscription.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-or-create-plan.md +69 -69
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-setup-intent-attempts.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/initiate-early-payment.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-customer-subscriptions.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-subscriptions.md +39 -39
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/pause-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/reactivate-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/resume-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/switch-payment-method.md +70 -70
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-payment-method.md +69 -69
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-vendor-ids.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/verify-vendor-ids.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-class.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-rate.md +117 -117
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-product-override.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-shipping-tax-override.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-class.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-rate.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-id.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-rates.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-eu-vat-product-overrides.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-oss-country-rates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-preconfigured-tax-rates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-product-overrides.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-tax-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-all-tax-rates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-classes.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-records.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/mark-taxes-as-filed.md +58 -58
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/reset-eu-vat-rates.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-configured-countries.md +57 -57
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-country-tax-id.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-eu-vat-cross-border-settings.md +127 -127
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-oss-country-rates.md +100 -100
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-product-override.md +110 -110
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-shipping-tax-override.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-tax-settings.md +166 -166
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-country-status.md +54 -54
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-tax-rate.md +116 -116
- package/dist/skills/fluentcart-developer/references/restapi/order-bumps.md +433 -433
- package/dist/skills/fluentcart-developer/references/restapi/orders.md +1212 -1212
- package/dist/skills/fluentcart-developer/references/restapi/pdf-templates.md +212 -212
- package/dist/skills/fluentcart-developer/references/restapi/products.md +2485 -2485
- package/dist/skills/fluentcart-developer/references/restapi/public-shop.md +191 -191
- package/dist/skills/fluentcart-developer/references/restapi/reports.md +3773 -3773
- package/dist/skills/fluentcart-developer/references/restapi/roles.md +403 -403
- package/dist/skills/fluentcart-developer/references/restapi/saved-views.md +136 -136
- package/dist/skills/fluentcart-developer/references/restapi/settings.md +1423 -1423
- package/dist/skills/fluentcart-developer/references/restapi/shipping.md +905 -905
- package/dist/skills/fluentcart-developer/references/restapi/subscriptions.md +1169 -1169
- package/dist/skills/fluentcart-developer/references/restapi/tax.md +1551 -1551
- package/dist/skills/fluentcart-developer/references/restapi.md +127 -127
- package/dist/skills/fluentcart-developer/scripts/cli.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +66 -65
|
@@ -1,1795 +1,1795 @@
|
|
|
1
|
-
# Cart & Checkout
|
|
2
|
-
|
|
3
|
-
All hooks related to the shopping flow — from adding items to the [Cart](/database/models/cart.md) through checkout rendering and the receipt/thank-you page.
|
|
4
|
-
|
|
5
|
-
## Cart Events
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
### ` item_added `
|
|
10
|
-
|
|
11
|
-
`fluent_cart/cart/item_added` — Fired after an item is added to the cart
|
|
12
|
-
|
|
13
|
-
**When it runs:** This action fires immediately after a product item has been successfully added to the [Cart](/database/models/cart.md) model and saved to the database. It runs before the `cart_data_items_updated` hook with the `item_added` scope.
|
|
14
|
-
|
|
15
|
-
**Parameters:**
|
|
16
|
-
|
|
17
|
-
- `$data` (array): Cart and item data
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
$data = [
|
|
21
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
22
|
-
'item' => $item, // array — the cart item that was just added
|
|
23
|
-
];
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**Source:** `app/Models/Cart.php`
|
|
27
|
-
|
|
28
|
-
**Usage:**
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
add_action('fluent_cart/cart/item_added', function ($data) {
|
|
32
|
-
$cart = $data['cart'];
|
|
33
|
-
$item = $data['item'];
|
|
34
|
-
|
|
35
|
-
// Log the added product for analytics
|
|
36
|
-
error_log('Product ' . $item['post_id'] . ' added to cart #' . $cart->id);
|
|
37
|
-
}, 10, 1);
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### ` item_removed `
|
|
41
|
-
|
|
42
|
-
`fluent_cart/cart/item_removed` — Fired after an item is removed from the cart
|
|
43
|
-
|
|
44
|
-
**When it runs:** This action fires after a product item has been removed from the [Cart](/database/models/cart.md) and saved, but only when the `$triggerEvent` parameter is `true` (the default). When an item is removed silently (e.g., during a replacement operation), this hook does not fire.
|
|
45
|
-
|
|
46
|
-
**Parameters:**
|
|
47
|
-
|
|
48
|
-
- `$data` (array): Cart and removal context
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
$data = [
|
|
52
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
53
|
-
'variation_id' => $variationId, // int — the variation ID that was removed
|
|
54
|
-
'extra_args' => $extraArgs, // array — additional matching arguments
|
|
55
|
-
'removed_item' => $removingItem, // array — the full cart item that was removed
|
|
56
|
-
];
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**Source:** `app/Models/Cart.php`
|
|
60
|
-
|
|
61
|
-
**Usage:**
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
add_action('fluent_cart/cart/item_removed', function ($data) {
|
|
65
|
-
$removedItem = $data['removed_item'];
|
|
66
|
-
$cart = $data['cart'];
|
|
67
|
-
|
|
68
|
-
// Track removal for abandoned cart analytics
|
|
69
|
-
do_action('my_plugin/track_cart_removal', [
|
|
70
|
-
'variation_id' => $data['variation_id'],
|
|
71
|
-
'product_id' => $removedItem['post_id'] ?? null,
|
|
72
|
-
'cart_id' => $cart->id,
|
|
73
|
-
]);
|
|
74
|
-
}, 10, 1);
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### ` cart_data_items_updated `
|
|
78
|
-
|
|
79
|
-
`fluent_cart/cart/cart_data_items_updated` — General-purpose hook for any cart data change
|
|
80
|
-
|
|
81
|
-
**When it runs:** This action fires whenever the cart data array is modified. The `scope` field tells you what operation triggered the update. It fires on item add, item remove, coupon apply, coupon remove, discount recalculation, and checkout page loading.
|
|
82
|
-
|
|
83
|
-
**Parameters:**
|
|
84
|
-
|
|
85
|
-
- `$data` (array): Cart and scope context
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
$data = [
|
|
89
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
90
|
-
'scope' => 'item_added', // string — one of the scope values below
|
|
91
|
-
'scope_data' => $scopeData, // mixed — context data depending on scope
|
|
92
|
-
];
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Possible `scope` values and their `scope_data`:
|
|
96
|
-
|
|
97
|
-
| scope | scope_data |
|
|
98
|
-
| --- | --- |
|
|
99
|
-
| `'item_added'` | The cart item array that was added |
|
|
100
|
-
| `'item_removed'` | The variation ID (int) that was removed |
|
|
101
|
-
| `'discounts_recalculated'` | Array of applied coupon codes |
|
|
102
|
-
| `'remove_coupon'` | Array of coupon codes that were removed |
|
|
103
|
-
| `'apply_coupons'` | Array of coupon codes that were applied |
|
|
104
|
-
| `'loading'` | Empty string (fired on checkout page load) |
|
|
105
|
-
|
|
106
|
-
**Source:** `app/Models/Cart.php`, `app/Hooks/Handlers/ShortCodes/Checkout/CheckoutPageHandler.php`
|
|
107
|
-
|
|
108
|
-
**Usage:**
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
add_action('fluent_cart/cart/cart_data_items_updated', function ($data) {
|
|
112
|
-
$cart = $data['cart'];
|
|
113
|
-
$scope = $data['scope'];
|
|
114
|
-
|
|
115
|
-
if ($scope === 'item_added' || $scope === 'item_removed') {
|
|
116
|
-
// Recalculate custom surcharges whenever items change
|
|
117
|
-
my_plugin_recalculate_surcharges($cart);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if ($scope === 'apply_coupons') {
|
|
121
|
-
// Log coupon usage
|
|
122
|
-
error_log('Coupons applied to cart #' . $cart->id . ': ' . implode(', ', $data['scope_data']));
|
|
123
|
-
}
|
|
124
|
-
}, 10, 1);
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### ` cart_completed `
|
|
128
|
-
|
|
129
|
-
`fluent_cart/cart_completed` — Fired when a cart is marked as completed after payment
|
|
130
|
-
|
|
131
|
-
**When it runs:** This action fires when the cart's stage is set to `completed` after a successful [Order](/database/models/order.md) payment. The cart's `completed_at` timestamp has already been saved at this point. This is triggered inside `StatusHelper` during order status transitions when payment is marked as paid.
|
|
132
|
-
|
|
133
|
-
**Parameters:**
|
|
134
|
-
|
|
135
|
-
- `$data` (array): Completed cart and associated order
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
$data = [
|
|
139
|
-
'cart' => $relatedCart, // \FluentCart\App\Models\Cart instance (stage = 'completed')
|
|
140
|
-
'order' => $order, // \FluentCart\App\Models\Order instance
|
|
141
|
-
];
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
**Source:** `app/Helpers/StatusHelper.php`
|
|
145
|
-
|
|
146
|
-
**Usage:**
|
|
147
|
-
|
|
148
|
-
```
|
|
149
|
-
add_action('fluent_cart/cart_completed', function ($data) {
|
|
150
|
-
$cart = $data['cart'];
|
|
151
|
-
$order = $data['order'];
|
|
152
|
-
|
|
153
|
-
// Fire a conversion pixel or sync to analytics
|
|
154
|
-
my_plugin_track_conversion([
|
|
155
|
-
'order_id' => $order->id,
|
|
156
|
-
'total' => $order->total_amount,
|
|
157
|
-
'customer_id' => $order->customer_id,
|
|
158
|
-
]);
|
|
159
|
-
}, 10, 1);
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### ` before_totals_calculation `
|
|
163
|
-
|
|
164
|
-
`fluent_cart/cart/before_totals_calculation` — Before the cart's grand total is recalculated
|
|
165
|
-
|
|
166
|
-
**When it runs:** This action fires at the start of `Cart::getEstimatedTotal()` (or equivalent total-calculation path), before dynamic discounts (`fluent_cart/cart/item_dynamic_discount`) are applied and before line items are re-summed. A `self::$calculatingTotal` guard is set to `true` immediately before this fires, preventing re-entrant recalculation.
|
|
167
|
-
|
|
168
|
-
**Parameters:**
|
|
169
|
-
|
|
170
|
-
- `$data` (array): The cart about to be recalculated
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
$data = [
|
|
174
|
-
'cart' => $this, // \FluentCart\App\Models\Cart instance
|
|
175
|
-
];
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
**Source:** `app/Models/Cart.php:1194`
|
|
179
|
-
|
|
180
|
-
**Usage:**
|
|
181
|
-
|
|
182
|
-
```
|
|
183
|
-
add_action('fluent_cart/cart/before_totals_calculation', function ($data) {
|
|
184
|
-
$cart = $data['cart'];
|
|
185
|
-
// Warm a cache needed by a custom pricing rule before totals run
|
|
186
|
-
my_plugin_prime_pricing_cache($cart->id);
|
|
187
|
-
}, 10, 1);
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### ` after_totals_calculation `
|
|
191
|
-
|
|
192
|
-
`fluent_cart/cart/after_totals_calculation` — After the cart's grand total has been recalculated
|
|
193
|
-
|
|
194
|
-
**When it runs:** This action fires at the end of `Cart::getEstimatedTotal()`, after fees, discounts, prorate credits, and upgrade discounts have all been applied to produce the final total. It fires right before the `self::$calculatingTotal` guard is released.
|
|
195
|
-
|
|
196
|
-
**Parameters:**
|
|
197
|
-
|
|
198
|
-
- `$data` (array): The cart and its computed total
|
|
199
|
-
|
|
200
|
-
```
|
|
201
|
-
$data = [
|
|
202
|
-
'cart' => $this, // \FluentCart\App\Models\Cart instance
|
|
203
|
-
'total' => $finalTotal, // int — the final cart total in cents
|
|
204
|
-
];
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
**Source:** `app/Models/Cart.php:1244`
|
|
208
|
-
|
|
209
|
-
**Usage:**
|
|
210
|
-
|
|
211
|
-
```
|
|
212
|
-
add_action('fluent_cart/cart/after_totals_calculation', function ($data) {
|
|
213
|
-
$cart = $data['cart'];
|
|
214
|
-
$total = \FluentCart\App\Helpers\Helper::toDecimal($data['total']);
|
|
215
|
-
error_log('Cart #' . $cart->id . ' recalculated total: ' . $total);
|
|
216
|
-
}, 10, 1);
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
## Checkout Data Events
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
### ` order/after_items_calculated `
|
|
226
|
-
|
|
227
|
-
`fluent_cart/order/after_items_calculated` — After the draft order's items/totals are calculated
|
|
228
|
-
|
|
229
|
-
**When it runs:** This action fires during the checkout submission flow (`CheckoutApi`), right after the draft [Order](/database/models/order.md)'s line items and totals have been calculated, and immediately before the `fluent_cart/checkout/prepare_other_data` hook below (same request, same method).
|
|
230
|
-
|
|
231
|
-
**Parameters:**
|
|
232
|
-
|
|
233
|
-
- `$data` (array): Order and cart context
|
|
234
|
-
|
|
235
|
-
```
|
|
236
|
-
$data = [
|
|
237
|
-
'order' => $createdOrder, // \FluentCart\App\Models\Order — the newly created draft order
|
|
238
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
239
|
-
'cart_items' => $cartCheckoutHelper->getItems(), // array — resolved cart items
|
|
240
|
-
];
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
**Source:** `api/Checkout/CheckoutApi.php:269`
|
|
244
|
-
|
|
245
|
-
**Usage:**
|
|
246
|
-
|
|
247
|
-
```
|
|
248
|
-
add_action('fluent_cart/order/after_items_calculated', function ($data) {
|
|
249
|
-
$order = $data['order'];
|
|
250
|
-
// Attach a custom line-item summary before other modules touch the order
|
|
251
|
-
fluent_cart_add_log(
|
|
252
|
-
'Order Items Calculated',
|
|
253
|
-
sprintf('Order #%d totals calculated with %d items.', $order->id, count($data['cart_items'])),
|
|
254
|
-
'info'
|
|
255
|
-
);
|
|
256
|
-
}, 10, 1);
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### ` prepare_other_data `
|
|
260
|
-
|
|
261
|
-
`fluent_cart/checkout/prepare_other_data` — After order creation, before finalizing
|
|
262
|
-
|
|
263
|
-
**When it runs:** This action fires during the checkout submission flow, after the draft [Order](/database/models/order.md) has been created but before it is finalized (before addresses and items are attached). This gives modules a chance to attach additional data to the order.
|
|
264
|
-
|
|
265
|
-
**Parameters:**
|
|
266
|
-
|
|
267
|
-
- `$data` (array): Full checkout context
|
|
268
|
-
|
|
269
|
-
```
|
|
270
|
-
$data = [
|
|
271
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
272
|
-
'order' => $createdOrder, // \FluentCart\App\Models\Order — the newly created draft order
|
|
273
|
-
'prev_order' => $prevOrder, // \FluentCart\App\Models\Order|null — previous order if retrying
|
|
274
|
-
'request_data' => $data, // array — raw validated request data from checkout form
|
|
275
|
-
'validated_data' => $validatedData, // array — sanitized/validated checkout field values
|
|
276
|
-
];
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
**Source:** `api/Checkout/CheckoutApi.php`
|
|
280
|
-
|
|
281
|
-
**Usage:**
|
|
282
|
-
|
|
283
|
-
```
|
|
284
|
-
add_action('fluent_cart/checkout/prepare_other_data', function ($data) {
|
|
285
|
-
$order = $data['order'];
|
|
286
|
-
$requestData = $data['request_data'];
|
|
287
|
-
|
|
288
|
-
// Attach custom metadata to the order before it finalizes
|
|
289
|
-
$customField = sanitize_text_field($requestData['custom_gift_message'] ?? '');
|
|
290
|
-
if ($customField) {
|
|
291
|
-
$order->updateMeta('gift_message', $customField);
|
|
292
|
-
}
|
|
293
|
-
}, 10, 1);
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### ` cart_amount_updated `
|
|
297
|
-
|
|
298
|
-
`fluent_cart/checkout/cart_amount_updated` — Fired when the cart total may have changed
|
|
299
|
-
|
|
300
|
-
**When it runs:** This action fires whenever an operation changes (or may change) the cart total. This includes: item removal (silent mode), coupon application, coupon removal, discount recalculation, quantity updates, order bump toggles, and tax recalculations. Use this hook to react to price changes regardless of the specific cause.
|
|
301
|
-
|
|
302
|
-
**Parameters:**
|
|
303
|
-
|
|
304
|
-
- `$data` (array): The affected cart
|
|
305
|
-
|
|
306
|
-
```
|
|
307
|
-
$data = [
|
|
308
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
309
|
-
];
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
**Source:** `app/Models/Cart.php`, `app/Hooks/Cart/WebCheckoutHandler.php`, `app/Modules/Tax/TaxModule.php`
|
|
313
|
-
|
|
314
|
-
**Usage:**
|
|
315
|
-
|
|
316
|
-
```
|
|
317
|
-
add_action('fluent_cart/checkout/cart_amount_updated', function ($data) {
|
|
318
|
-
$cart = $data['cart'];
|
|
319
|
-
|
|
320
|
-
// Recalculate a custom fee based on the new cart total
|
|
321
|
-
$estimatedTotal = $cart->getEstimatedTotal();
|
|
322
|
-
if ($estimatedTotal > 10000) { // over $100.00
|
|
323
|
-
// Apply free shipping threshold logic
|
|
324
|
-
my_plugin_apply_free_shipping($cart);
|
|
325
|
-
}
|
|
326
|
-
}, 10, 1);
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
### ` shipping_data_changed `
|
|
330
|
-
|
|
331
|
-
`fluent_cart/checkout/shipping_data_changed` — Fired when shipping data changes
|
|
332
|
-
|
|
333
|
-
**When it runs:** This action fires when shipping-related data on the cart changes, such as when a new shipping method is selected, the shipping charge changes, or the shipping address is updated in a way that affects shipping calculations.
|
|
334
|
-
|
|
335
|
-
**Parameters:**
|
|
336
|
-
|
|
337
|
-
- `$data` (array): The affected cart
|
|
338
|
-
|
|
339
|
-
```
|
|
340
|
-
$data = [
|
|
341
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
342
|
-
];
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
**Source:** `app/Helpers/CartHelper.php`, `app/Hooks/Cart/WebCheckoutHandler.php`
|
|
346
|
-
|
|
347
|
-
**Usage:**
|
|
348
|
-
|
|
349
|
-
```
|
|
350
|
-
add_action('fluent_cart/checkout/shipping_data_changed', function ($data) {
|
|
351
|
-
$cart = $data['cart'];
|
|
352
|
-
$shippingData = $cart->checkout_data['shipping_data'] ?? [];
|
|
353
|
-
|
|
354
|
-
// Log shipping method selection for analytics
|
|
355
|
-
error_log('Cart #' . $cart->id . ' shipping method: ' . ($shippingData['shipping_method_id'] ?? 'none'));
|
|
356
|
-
}, 10, 1);
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
### ` form_data_changed `
|
|
360
|
-
|
|
361
|
-
`fluent_cart/checkout/form_data_changed` — Fired when checkout form data changes
|
|
362
|
-
|
|
363
|
-
**When it runs:** This action fires when the checkout form data is updated via AJAX, such as when a customer changes their address, toggles "ship to different address", or any form field is updated that triggers a server-side recalculation.
|
|
364
|
-
|
|
365
|
-
**Parameters:**
|
|
366
|
-
|
|
367
|
-
- `$data` (array): The affected cart
|
|
368
|
-
|
|
369
|
-
```
|
|
370
|
-
$data = [
|
|
371
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
372
|
-
];
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
**Source:** `app/Hooks/Cart/WebCheckoutHandler.php`
|
|
376
|
-
|
|
377
|
-
**Usage:**
|
|
378
|
-
|
|
379
|
-
```
|
|
380
|
-
add_action('fluent_cart/checkout/form_data_changed', function ($data) {
|
|
381
|
-
$cart = $data['cart'];
|
|
382
|
-
$formData = $cart->checkout_data['form_data'] ?? [];
|
|
383
|
-
|
|
384
|
-
// Check if the billing country requires special handling
|
|
385
|
-
$billingCountry = $formData['billing_country'] ?? '';
|
|
386
|
-
if (in_array($billingCountry, ['BR', 'IN'])) {
|
|
387
|
-
// Add country-specific checkout notices
|
|
388
|
-
my_plugin_add_country_notice($cart, $billingCountry);
|
|
389
|
-
}
|
|
390
|
-
}, 10, 1);
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
### ` customer_data_saved `
|
|
394
|
-
|
|
395
|
-
`fluent_cart/checkout/customer_data_saved` — Removed in 1.4.0 — no longer fired
|
|
396
|
-
|
|
397
|
-
Removed in 1.4.0 — this hook no longer fires
|
|
398
|
-
|
|
399
|
-
`fluent_cart/checkout/customer_data_saved` was removed from the checkout refactor in commit `ebeae0dc3` (2026-05-14, shipped in **1.4.0**). It does not exist anywhere in FluentCart or FluentCart Pro today, so a callback registered on it will **never run** — silently, with no error.
|
|
400
|
-
|
|
401
|
-
This entry is kept only so that anyone whose integration stopped working can find out why. Do not write new code against it.
|
|
402
|
-
|
|
403
|
-
**What to use instead:** the checkout data is now persisted without a per-key notification. To react to checkout field changes, hook [`fluent_cart/checkout/validate_data`](./../filters/cart-and-checkout.md) before persistence, or read the final state from the order lifecycle actions in [Orders](./orders.md) after checkout completes.
|
|
404
|
-
|
|
405
|
-
**When it fired (historical, prior to 1.4.0):** It fired when a specific piece of customer data was saved during checkout, after the value had been persisted to the cart model, and passed both the old and new values so a listener could detect changes.
|
|
406
|
-
|
|
407
|
-
**Parameters:**
|
|
408
|
-
|
|
409
|
-
- `$data` (array): Customer data change context
|
|
410
|
-
|
|
411
|
-
```
|
|
412
|
-
$data = [
|
|
413
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
414
|
-
'key' => $key, // string — the data key that changed (e.g. 'billing_country')
|
|
415
|
-
'value' => $value, // mixed — the new value
|
|
416
|
-
'old_value' => $prevValue, // mixed — the previous value
|
|
417
|
-
'old_data' => $oldCheckoutData, // array — the full previous checkout_data array
|
|
418
|
-
];
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
**Source:** `app/Hooks/Cart/WebCheckoutHandler.php`
|
|
422
|
-
|
|
423
|
-
**Usage:**
|
|
424
|
-
|
|
425
|
-
```
|
|
426
|
-
add_action('fluent_cart/checkout/customer_data_saved', function ($data) {
|
|
427
|
-
$cart = $data['cart'];
|
|
428
|
-
$key = $data['key'];
|
|
429
|
-
|
|
430
|
-
// React to billing country changes for tax recalculation
|
|
431
|
-
if ($key === 'billing_country' && $data['value'] !== $data['old_value']) {
|
|
432
|
-
error_log('Cart #' . $cart->id . ' billing country changed from '
|
|
433
|
-
. $data['old_value'] . ' to ' . $data['value']);
|
|
434
|
-
}
|
|
435
|
-
}, 10, 1);
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
### ` tax/reverse_charge_applied `
|
|
439
|
-
|
|
440
|
-
`fluent_cart/tax/reverse_charge_applied` — Fired when the EU VAT reverse charge is applied to the cart
|
|
441
|
-
|
|
442
|
-
**When it runs:** This action fires during cart tax calculation (`TaxModule::calculateCartTax()`) when the reverse charge mechanism has just been applied — a qualifying business customer (e.g. validated EU VAT number) is liable for the VAT, so tax has been removed and inclusive product lines and fees have been adjusted to net prices. It fires after those adjustments are written into the cart's checkout data.
|
|
443
|
-
|
|
444
|
-
**Parameters:**
|
|
445
|
-
|
|
446
|
-
- `$data` (array): Reverse charge context
|
|
447
|
-
|
|
448
|
-
```
|
|
449
|
-
$data = [
|
|
450
|
-
'checkout_data' => $checkoutData, // array — the cart's checkout_data (includes the updated 'tax_data')
|
|
451
|
-
'product_lines' => $productLines, // array — cart product line items, already adjusted to net prices
|
|
452
|
-
];
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
**Source:** `app/Modules/Tax/TaxModule.php (line 750)`
|
|
456
|
-
|
|
457
|
-
**Usage:**
|
|
458
|
-
|
|
459
|
-
```
|
|
460
|
-
add_action('fluent_cart/tax/reverse_charge_applied', function ($data) {
|
|
461
|
-
$taxData = $data['checkout_data']['tax_data'] ?? [];
|
|
462
|
-
|
|
463
|
-
// Log or sync with an external tax service
|
|
464
|
-
my_tax_service_flag_reverse_charge($taxData);
|
|
465
|
-
}, 10, 1);
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
### ` tax/reverse_charge_removed `
|
|
469
|
-
|
|
470
|
-
`fluent_cart/tax/reverse_charge_removed` — Fired when the EU VAT reverse charge is removed from the cart
|
|
471
|
-
|
|
472
|
-
**When it runs:** This action fires during cart tax calculation (`TaxModule::calculateCartTax()`) when a previously applicable reverse charge no longer applies (e.g. the VAT number was removed or the billing country changed). Product lines have already been restored to gross prices and the reverse charge fee adjustments cleared before it fires.
|
|
473
|
-
|
|
474
|
-
**Parameters:**
|
|
475
|
-
|
|
476
|
-
- `$data` (array): Reverse charge context
|
|
477
|
-
|
|
478
|
-
```
|
|
479
|
-
$data = [
|
|
480
|
-
'checkout_data' => $checkoutData, // array — the cart's checkout_data (includes 'tax_data')
|
|
481
|
-
'product_lines' => $productLines, // array — cart product line items, restored to gross prices
|
|
482
|
-
];
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
**Source:** `app/Modules/Tax/TaxModule.php (line 762)`
|
|
486
|
-
|
|
487
|
-
**Usage:**
|
|
488
|
-
|
|
489
|
-
```
|
|
490
|
-
add_action('fluent_cart/tax/reverse_charge_removed', function ($data) {
|
|
491
|
-
// React to the customer no longer qualifying for reverse charge
|
|
492
|
-
my_tax_service_clear_reverse_charge($data['checkout_data']);
|
|
493
|
-
}, 10, 1);
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
---
|
|
497
|
-
|
|
498
|
-
## Checkout Page Rendering
|
|
499
|
-
|
|
500
|
-
All hooks in this section fire during server-side HTML rendering of the checkout page. They use output buffering, so you should **echo** (not return) any custom HTML you want to inject.
|
|
501
|
-
|
|
502
|
-
---
|
|
503
|
-
|
|
504
|
-
### ` before_checkout_page_start `
|
|
505
|
-
|
|
506
|
-
`fluent_cart/before_checkout_page_start` — Before the checkout page wrapper div
|
|
507
|
-
|
|
508
|
-
**When it runs:** This action fires immediately before the main checkout page `` wrapper is opened. Use it to output HTML or scripts that should appear above the entire checkout page.
|
|
509
|
-
|
|
510
|
-
**Parameters:**
|
|
511
|
-
|
|
512
|
-
- `$data` (array): The current cart
|
|
513
|
-
|
|
514
|
-
```
|
|
515
|
-
$data = [
|
|
516
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
517
|
-
];
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
521
|
-
|
|
522
|
-
**Usage:**
|
|
523
|
-
|
|
524
|
-
```
|
|
525
|
-
add_action('fluent_cart/before_checkout_page_start', function ($data) {
|
|
526
|
-
$cart = $data['cart'];
|
|
527
|
-
echo '<div class="my-checkout-banner">';
|
|
528
|
-
echo '<p>Free shipping on orders over $50!</p>';
|
|
529
|
-
echo '</div>';
|
|
530
|
-
}, 10, 1);
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
### ` after_checkout_page_start `
|
|
534
|
-
|
|
535
|
-
`fluent_cart/after_checkout_page_start` — After the checkout page wrapper div opens
|
|
536
|
-
|
|
537
|
-
**When it runs:** This action fires right after the main checkout page `` wrapper opens, before any checkout content is rendered.
|
|
538
|
-
|
|
539
|
-
**Parameters:**
|
|
540
|
-
|
|
541
|
-
- `$data` (array): The current cart
|
|
542
|
-
|
|
543
|
-
```
|
|
544
|
-
$data = [
|
|
545
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
546
|
-
];
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php:154`
|
|
550
|
-
|
|
551
|
-
**Usage:**
|
|
552
|
-
|
|
553
|
-
```
|
|
554
|
-
add_action('fluent_cart/after_checkout_page_start', function ($data) {
|
|
555
|
-
$cart = $data['cart'];
|
|
556
|
-
echo '<div class="my-checkout-progress-bar">Step 1 of 3: Checkout</div>';
|
|
557
|
-
}, 10, 1);
|
|
558
|
-
```
|
|
559
|
-
|
|
560
|
-
### ` before_checkout_form `
|
|
561
|
-
|
|
562
|
-
`fluent_cart/before_checkout_form` — Before the checkout form element
|
|
563
|
-
|
|
564
|
-
**When it runs:** This action fires just before the `` tag for the checkout form is rendered.
|
|
565
|
-
|
|
566
|
-
**Parameters:**
|
|
567
|
-
|
|
568
|
-
- `$data` (array): The current cart
|
|
569
|
-
|
|
570
|
-
```
|
|
571
|
-
$data = [
|
|
572
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
573
|
-
];
|
|
574
|
-
```
|
|
575
|
-
|
|
576
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
577
|
-
|
|
578
|
-
**Usage:**
|
|
579
|
-
|
|
580
|
-
```
|
|
581
|
-
add_action('fluent_cart/before_checkout_form', function ($data) {
|
|
582
|
-
echo '<div class="my-trust-badges">';
|
|
583
|
-
echo '<img src="/wp-content/uploads/secure-checkout.svg" alt="Secure Checkout" />';
|
|
584
|
-
echo '</div>';
|
|
585
|
-
}, 10, 1);
|
|
586
|
-
```
|
|
587
|
-
|
|
588
|
-
### ` checkout_form_opening `
|
|
589
|
-
|
|
590
|
-
`fluent_cart/checkout_form_opening` — Right after the checkout form tag opens
|
|
591
|
-
|
|
592
|
-
**When it runs:** This action fires immediately after the `` tag opens, before any form fields are rendered. Use it to insert hidden fields, nonce fields, or other elements that must be inside the form.
|
|
593
|
-
|
|
594
|
-
**Parameters:**
|
|
595
|
-
|
|
596
|
-
- `$data` (array): The current cart
|
|
597
|
-
|
|
598
|
-
```
|
|
599
|
-
$data = [
|
|
600
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
601
|
-
];
|
|
602
|
-
```
|
|
603
|
-
|
|
604
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
605
|
-
|
|
606
|
-
**Usage:**
|
|
607
|
-
|
|
608
|
-
```
|
|
609
|
-
add_action('fluent_cart/checkout_form_opening', function ($data) {
|
|
610
|
-
// Add a hidden field for tracking
|
|
611
|
-
echo '<input type="hidden" name="my_tracking_ref" value="' . esc_attr(my_get_tracking_ref()) . '" />';
|
|
612
|
-
}, 10, 1);
|
|
613
|
-
```
|
|
614
|
-
|
|
615
|
-
### ` before_billing_fields `
|
|
616
|
-
|
|
617
|
-
`fluent_cart/before_billing_fields` — Before billing address fields
|
|
618
|
-
|
|
619
|
-
**When it runs:** This action fires after the name/email fields and the "create account" checkbox, but before the billing address fields section is rendered.
|
|
620
|
-
|
|
621
|
-
**Parameters:**
|
|
622
|
-
|
|
623
|
-
- `$data` (array): The current cart
|
|
624
|
-
|
|
625
|
-
```
|
|
626
|
-
$data = [
|
|
627
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
628
|
-
];
|
|
629
|
-
```
|
|
630
|
-
|
|
631
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
632
|
-
|
|
633
|
-
**Usage:**
|
|
634
|
-
|
|
635
|
-
```
|
|
636
|
-
add_action('fluent_cart/before_billing_fields', function ($data) {
|
|
637
|
-
echo '<p class="my-billing-note">Please enter your billing address exactly as it appears on your card statement.</p>';
|
|
638
|
-
}, 10, 1);
|
|
639
|
-
```
|
|
640
|
-
|
|
641
|
-
### ` before_billing_fields_section `
|
|
642
|
-
|
|
643
|
-
`fluent_cart/before_billing_fields_section` — Before the billing address field section renders
|
|
644
|
-
|
|
645
|
-
**When it runs:** This action fires right before the billing address form section (with its heading and input fields) is rendered. It fires inside the `renderBillingAddressFields()` method, after billing field data has been prepared and filtered.
|
|
646
|
-
|
|
647
|
-
**Parameters:**
|
|
648
|
-
|
|
649
|
-
- `$data` (array): The current cart
|
|
650
|
-
|
|
651
|
-
```
|
|
652
|
-
$data = [
|
|
653
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
654
|
-
];
|
|
655
|
-
```
|
|
656
|
-
|
|
657
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
658
|
-
|
|
659
|
-
**Usage:**
|
|
660
|
-
|
|
661
|
-
```
|
|
662
|
-
add_action('fluent_cart/before_billing_fields_section', function ($data) {
|
|
663
|
-
echo '<div class="my-billing-section-intro">';
|
|
664
|
-
echo '<h4>Where should we send the invoice?</h4>';
|
|
665
|
-
echo '</div>';
|
|
666
|
-
}, 10, 1);
|
|
667
|
-
```
|
|
668
|
-
|
|
669
|
-
### ` after_billing_fields_section `
|
|
670
|
-
|
|
671
|
-
`fluent_cart/after_billing_fields_section` — After the billing address field section
|
|
672
|
-
|
|
673
|
-
**When it runs:** This action fires after the billing address fields section and the "ship to different address" checkbox have been rendered. It only fires when the cart requires shipping.
|
|
674
|
-
|
|
675
|
-
**Parameters:**
|
|
676
|
-
|
|
677
|
-
- `$data` (array): The current cart
|
|
678
|
-
|
|
679
|
-
```
|
|
680
|
-
$data = [
|
|
681
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
682
|
-
];
|
|
683
|
-
```
|
|
684
|
-
|
|
685
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
686
|
-
|
|
687
|
-
**Usage:**
|
|
688
|
-
|
|
689
|
-
```
|
|
690
|
-
add_action('fluent_cart/after_billing_fields_section', function ($data) {
|
|
691
|
-
$cart = $data['cart'];
|
|
692
|
-
// Add a note between billing and shipping sections
|
|
693
|
-
echo '<div class="my-address-note">';
|
|
694
|
-
echo '<p>Shipping is calculated based on your delivery address.</p>';
|
|
695
|
-
echo '</div>';
|
|
696
|
-
}, 10, 1);
|
|
697
|
-
```
|
|
698
|
-
|
|
699
|
-
### ` checkout/b2b_extra_fields `
|
|
700
|
-
|
|
701
|
-
`fluent_cart/checkout/b2b_extra_fields` — Inside the billing fields area, for custom B2B fields
|
|
702
|
-
|
|
703
|
-
**When it runs:** This action fires within the billing address fields section of the checkout form (`CheckoutRenderer::renderBillingAddressFields()`), after the standard billing fields. Use it to render extra business-oriented fields such as a company name, tax ID/VAT number, or purchase-order reference.
|
|
704
|
-
|
|
705
|
-
**Parameters:**
|
|
706
|
-
|
|
707
|
-
- `$data` (array): The current cart
|
|
708
|
-
|
|
709
|
-
```
|
|
710
|
-
$data = [
|
|
711
|
-
'cart' => $this->cart, // \FluentCart\App\Models\Cart instance
|
|
712
|
-
];
|
|
713
|
-
```
|
|
714
|
-
|
|
715
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php:419`
|
|
716
|
-
|
|
717
|
-
**Usage:**
|
|
718
|
-
|
|
719
|
-
```
|
|
720
|
-
add_action('fluent_cart/checkout/b2b_extra_fields', function ($data) {
|
|
721
|
-
echo '<div class="fct-field-wrap">';
|
|
722
|
-
echo '<label for="company_vat_number">VAT Number</label>';
|
|
723
|
-
echo '<input type="text" id="company_vat_number" name="company_vat_number" />';
|
|
724
|
-
echo '</div>';
|
|
725
|
-
}, 10, 1);
|
|
726
|
-
```
|
|
727
|
-
|
|
728
|
-
### ` before_shipping_fields_section `
|
|
729
|
-
|
|
730
|
-
`fluent_cart/before_shipping_fields_section` — Before the shipping address field section
|
|
731
|
-
|
|
732
|
-
**When it runs:** This action fires right before the shipping address form section is rendered. The shipping section may be hidden via CSS if "ship to different address" is not checked.
|
|
733
|
-
|
|
734
|
-
**Parameters:**
|
|
735
|
-
|
|
736
|
-
- `$data` (array): The current cart
|
|
737
|
-
|
|
738
|
-
```
|
|
739
|
-
$data = [
|
|
740
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
741
|
-
];
|
|
742
|
-
```
|
|
743
|
-
|
|
744
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
745
|
-
|
|
746
|
-
**Usage:**
|
|
747
|
-
|
|
748
|
-
```
|
|
749
|
-
add_action('fluent_cart/before_shipping_fields_section', function ($data) {
|
|
750
|
-
echo '<p class="my-shipping-note">Enter the address where you want us to deliver your order.</p>';
|
|
751
|
-
}, 10, 1);
|
|
752
|
-
```
|
|
753
|
-
|
|
754
|
-
### ` after_shipping_fields_section `
|
|
755
|
-
|
|
756
|
-
`fluent_cart/after_shipping_fields_section` — After the shipping address field section
|
|
757
|
-
|
|
758
|
-
**When it runs:** This action fires immediately after the shipping address form section is rendered.
|
|
759
|
-
|
|
760
|
-
**Parameters:**
|
|
761
|
-
|
|
762
|
-
- `$data` (array): The current cart
|
|
763
|
-
|
|
764
|
-
```
|
|
765
|
-
$data = [
|
|
766
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
767
|
-
];
|
|
768
|
-
```
|
|
769
|
-
|
|
770
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
771
|
-
|
|
772
|
-
**Usage:**
|
|
773
|
-
|
|
774
|
-
```
|
|
775
|
-
add_action('fluent_cart/after_shipping_fields_section', function ($data) {
|
|
776
|
-
echo '<div class="my-delivery-estimate">';
|
|
777
|
-
echo '<p>Estimated delivery: 3-5 business days</p>';
|
|
778
|
-
echo '</div>';
|
|
779
|
-
}, 10, 1);
|
|
780
|
-
```
|
|
781
|
-
|
|
782
|
-
### ` before_payment_methods `
|
|
783
|
-
|
|
784
|
-
`fluent_cart/before_payment_methods` — Before payment method options
|
|
785
|
-
|
|
786
|
-
**When it runs:** This action fires before the payment methods section is rendered on the checkout page. It also fires in the modal checkout renderer and the Gutenberg block inner blocks renderer.
|
|
787
|
-
|
|
788
|
-
**Parameters:**
|
|
789
|
-
|
|
790
|
-
- `$data` (array): The current cart
|
|
791
|
-
|
|
792
|
-
```
|
|
793
|
-
$data = [
|
|
794
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
795
|
-
];
|
|
796
|
-
```
|
|
797
|
-
|
|
798
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`, `app/Services/Renderer/ModalCheckoutRenderer.php`, `app/Hooks/Handlers/BlockEditors/Checkout/InnerBlocks/InnerBlocks.php`
|
|
799
|
-
|
|
800
|
-
**Usage:**
|
|
801
|
-
|
|
802
|
-
```
|
|
803
|
-
add_action('fluent_cart/before_payment_methods', function ($data) {
|
|
804
|
-
echo '<div class="my-payment-security-note">';
|
|
805
|
-
echo '<p>All transactions are encrypted and secure.</p>';
|
|
806
|
-
echo '</div>';
|
|
807
|
-
}, 10, 1);
|
|
808
|
-
```
|
|
809
|
-
|
|
810
|
-
### ` after_payment_methods `
|
|
811
|
-
|
|
812
|
-
`fluent_cart/after_payment_methods` — After payment method options
|
|
813
|
-
|
|
814
|
-
**When it runs:** This action fires after the payment methods section has been rendered, before the checkout submit button.
|
|
815
|
-
|
|
816
|
-
**Parameters:**
|
|
817
|
-
|
|
818
|
-
- `$data` (array): The current cart
|
|
819
|
-
|
|
820
|
-
```
|
|
821
|
-
$data = [
|
|
822
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
823
|
-
];
|
|
824
|
-
```
|
|
825
|
-
|
|
826
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
827
|
-
|
|
828
|
-
**Usage:**
|
|
829
|
-
|
|
830
|
-
```
|
|
831
|
-
add_action('fluent_cart/after_payment_methods', function ($data) {
|
|
832
|
-
echo '<div class="my-payment-icons">';
|
|
833
|
-
echo '<img src="/wp-content/uploads/visa.svg" alt="Visa" />';
|
|
834
|
-
echo '<img src="/wp-content/uploads/mastercard.svg" alt="Mastercard" />';
|
|
835
|
-
echo '</div>';
|
|
836
|
-
}, 10, 1);
|
|
837
|
-
```
|
|
838
|
-
|
|
839
|
-
### ` checkout_embed_payment_method_content `
|
|
840
|
-
|
|
841
|
-
`fluent_cart/checkout_embed_payment_method_content` — Inside each embedded payment method's container div
|
|
842
|
-
|
|
843
|
-
**When it runs:** This action fires inside the per-method `fluent-cart-checkout_embed_payment_container_{route}` wrapper `` for each registered payment method on the checkout page (and the equivalent container in the modal checkout renderer). The container itself starts `aria-hidden="true"` and is revealed by JS when that method is selected. Use it to render gateway-specific embedded fields (e.g. a card element mount point).
|
|
844
|
-
|
|
845
|
-
**Parameters:**
|
|
846
|
-
|
|
847
|
-
- `$data` (array): Payment method render context
|
|
848
|
-
|
|
849
|
-
```
|
|
850
|
-
$data = [
|
|
851
|
-
'method' => $method, // \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway instance
|
|
852
|
-
'cart' => $this->cart, // \FluentCart\App\Models\Cart instance
|
|
853
|
-
'route' => $route, // string — the gateway's route/slug (e.g. 'stripe', 'paypal')
|
|
854
|
-
];
|
|
855
|
-
```
|
|
856
|
-
|
|
857
|
-
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:819` (modal checkout) and `app/Services/Renderer/CheckoutRenderer.php:944` (full checkout page)
|
|
858
|
-
|
|
859
|
-
**Usage:**
|
|
860
|
-
|
|
861
|
-
```
|
|
862
|
-
add_action('fluent_cart/checkout_embed_payment_method_content', function ($data) {
|
|
863
|
-
if ($data['route'] !== 'my_gateway') {
|
|
864
|
-
return;
|
|
865
|
-
}
|
|
866
|
-
echo '<div id="my-gateway-card-element"></div>';
|
|
867
|
-
}, 10, 1);
|
|
868
|
-
```
|
|
869
|
-
|
|
870
|
-
### ` after_checkout_button `
|
|
871
|
-
|
|
872
|
-
`fluent_cart/after_checkout_button` — After the checkout submit button
|
|
873
|
-
|
|
874
|
-
**When it runs:** This action fires immediately after the "Place order" submit button is rendered.
|
|
875
|
-
|
|
876
|
-
**Parameters:**
|
|
877
|
-
|
|
878
|
-
- `$data` (array): The current cart
|
|
879
|
-
|
|
880
|
-
```
|
|
881
|
-
$data = [
|
|
882
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
883
|
-
];
|
|
884
|
-
```
|
|
885
|
-
|
|
886
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
887
|
-
|
|
888
|
-
**Usage:**
|
|
889
|
-
|
|
890
|
-
```
|
|
891
|
-
add_action('fluent_cart/after_checkout_button', function ($data) {
|
|
892
|
-
echo '<p class="my-checkout-disclaimer">';
|
|
893
|
-
echo 'By placing your order you agree to our <a href="/terms">Terms of Service</a>.';
|
|
894
|
-
echo '</p>';
|
|
895
|
-
}, 10, 1);
|
|
896
|
-
```
|
|
897
|
-
|
|
898
|
-
### ` after_order_notes `
|
|
899
|
-
|
|
900
|
-
`fluent_cart/after_order_notes` — After the order notes section in the summary sidebar
|
|
901
|
-
|
|
902
|
-
**When it runs:** This action fires after the order notes field in the checkout summary/sidebar section, inside the order summary wrapper.
|
|
903
|
-
|
|
904
|
-
**Parameters:**
|
|
905
|
-
|
|
906
|
-
- `$data` (array): The current cart
|
|
907
|
-
|
|
908
|
-
```
|
|
909
|
-
$data = [
|
|
910
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
911
|
-
];
|
|
912
|
-
```
|
|
913
|
-
|
|
914
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
915
|
-
|
|
916
|
-
**Usage:**
|
|
917
|
-
|
|
918
|
-
```
|
|
919
|
-
add_action('fluent_cart/after_order_notes', function ($data) {
|
|
920
|
-
echo '<div class="my-gift-wrap-option">';
|
|
921
|
-
echo '<label><input type="checkbox" name="gift_wrap" value="yes" /> Add gift wrapping (+$5.00)</label>';
|
|
922
|
-
echo '</div>';
|
|
923
|
-
}, 10, 1);
|
|
924
|
-
```
|
|
925
|
-
|
|
926
|
-
### ` after_order_notes_field `
|
|
927
|
-
|
|
928
|
-
`fluent_cart/after_order_notes_field` — After the order notes form field
|
|
929
|
-
|
|
930
|
-
**When it runs:** This action fires right after the order notes textarea field is rendered, inside the `renderOrderNoteField()` method. Note that the order notes field only appears when the cart requires shipping (unless overridden by the `fluent_cart/disable_order_notes_for_digital_products` filter).
|
|
931
|
-
|
|
932
|
-
**Parameters:**
|
|
933
|
-
|
|
934
|
-
- `$data` (array): The current cart
|
|
935
|
-
|
|
936
|
-
```
|
|
937
|
-
$data = [
|
|
938
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
939
|
-
];
|
|
940
|
-
```
|
|
941
|
-
|
|
942
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
943
|
-
|
|
944
|
-
**Usage:**
|
|
945
|
-
|
|
946
|
-
```
|
|
947
|
-
add_action('fluent_cart/after_order_notes_field', function ($data) {
|
|
948
|
-
echo '<p class="my-notes-hint"><em>Example: Leave package at the back door.</em></p>';
|
|
949
|
-
}, 10, 1);
|
|
950
|
-
```
|
|
951
|
-
|
|
952
|
-
### ` after_checkout_form `
|
|
953
|
-
|
|
954
|
-
`fluent_cart/after_checkout_form` — After the checkout form closes
|
|
955
|
-
|
|
956
|
-
**When it runs:** This action fires immediately after the closing `` tag of the checkout form.
|
|
957
|
-
|
|
958
|
-
**Parameters:**
|
|
959
|
-
|
|
960
|
-
- `$data` (array): The current cart
|
|
961
|
-
|
|
962
|
-
```
|
|
963
|
-
$data = [
|
|
964
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
965
|
-
];
|
|
966
|
-
```
|
|
967
|
-
|
|
968
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
969
|
-
|
|
970
|
-
**Usage:**
|
|
971
|
-
|
|
972
|
-
```
|
|
973
|
-
add_action('fluent_cart/after_checkout_form', function ($data) {
|
|
974
|
-
// Render a support chat widget below the form
|
|
975
|
-
echo '<div class="my-checkout-support">';
|
|
976
|
-
echo '<p>Need help? <a href="#" onclick="openChat()">Chat with us</a></p>';
|
|
977
|
-
echo '</div>';
|
|
978
|
-
}, 10, 1);
|
|
979
|
-
```
|
|
980
|
-
|
|
981
|
-
### ` before_checkout_page_close `
|
|
982
|
-
|
|
983
|
-
`fluent_cart/before_checkout_page_close` — Before the checkout page wrapper div closes
|
|
984
|
-
|
|
985
|
-
**When it runs:** This action fires just before the closing `` of the main checkout page wrapper.
|
|
986
|
-
|
|
987
|
-
**Parameters:**
|
|
988
|
-
|
|
989
|
-
- `$data` (array): The current cart
|
|
990
|
-
|
|
991
|
-
```
|
|
992
|
-
$data = [
|
|
993
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
994
|
-
];
|
|
995
|
-
```
|
|
996
|
-
|
|
997
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
998
|
-
|
|
999
|
-
**Usage:**
|
|
1000
|
-
|
|
1001
|
-
```
|
|
1002
|
-
add_action('fluent_cart/before_checkout_page_close', function ($data) {
|
|
1003
|
-
echo '<div class="my-checkout-footer-badges">';
|
|
1004
|
-
echo '<p>30-day money-back guarantee</p>';
|
|
1005
|
-
echo '</div>';
|
|
1006
|
-
}, 10, 1);
|
|
1007
|
-
```
|
|
1008
|
-
|
|
1009
|
-
### ` after_checkout_page `
|
|
1010
|
-
|
|
1011
|
-
`fluent_cart/after_checkout_page` — After the entire checkout page wrapper
|
|
1012
|
-
|
|
1013
|
-
**When it runs:** This action fires after the checkout page wrapper `` has been closed. Use it for scripts, tracking pixels, or other content that should appear after the entire checkout page.
|
|
1014
|
-
|
|
1015
|
-
**Parameters:**
|
|
1016
|
-
|
|
1017
|
-
- `$data` (array): The current cart
|
|
1018
|
-
|
|
1019
|
-
```
|
|
1020
|
-
$data = [
|
|
1021
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
1022
|
-
];
|
|
1023
|
-
```
|
|
1024
|
-
|
|
1025
|
-
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
1026
|
-
|
|
1027
|
-
**Usage:**
|
|
1028
|
-
|
|
1029
|
-
```
|
|
1030
|
-
add_action('fluent_cart/after_checkout_page', function ($data) {
|
|
1031
|
-
$cart = $data['cart'];
|
|
1032
|
-
// Output a tracking script after the checkout page
|
|
1033
|
-
echo '<script>myAnalytics.trackCheckoutView({ cartId: ' . intval($cart->id) . ' });</script>';
|
|
1034
|
-
}, 10, 1);
|
|
1035
|
-
```
|
|
1036
|
-
|
|
1037
|
-
### ` before_summary_total `
|
|
1038
|
-
|
|
1039
|
-
`fluent_cart/checkout/before_summary_total` — Before the total line in the cart summary
|
|
1040
|
-
|
|
1041
|
-
**When it runs:** This action fires in the cart summary sidebar, after the subtotal, shipping, and discount lines but before the coupon input field and the final total line.
|
|
1042
|
-
|
|
1043
|
-
**Parameters:**
|
|
1044
|
-
|
|
1045
|
-
- `$data` (array): The current cart
|
|
1046
|
-
|
|
1047
|
-
```
|
|
1048
|
-
$data = [
|
|
1049
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
1050
|
-
];
|
|
1051
|
-
```
|
|
1052
|
-
|
|
1053
|
-
**Source:** `app/Services/Renderer/CartSummaryRender.php`
|
|
1054
|
-
|
|
1055
|
-
**Usage:**
|
|
1056
|
-
|
|
1057
|
-
```
|
|
1058
|
-
add_action('fluent_cart/checkout/before_summary_total', function ($data) {
|
|
1059
|
-
$cart = $data['cart'];
|
|
1060
|
-
// Add a custom fee line in the summary
|
|
1061
|
-
echo '<li class="my-custom-fee">';
|
|
1062
|
-
echo '<span class="fct_summary_label">Processing Fee</span>';
|
|
1063
|
-
echo '<span class="fct_summary_value">$2.50</span>';
|
|
1064
|
-
echo '</li>';
|
|
1065
|
-
}, 10, 1);
|
|
1066
|
-
```
|
|
1067
|
-
|
|
1068
|
-
---
|
|
1069
|
-
|
|
1070
|
-
## Cart Line Items Rendering
|
|
1071
|
-
|
|
1072
|
-
These hooks fire during the rendering of individual cart line items on the checkout page. They all receive the same parameter structure from `CartItemRenderer::getEventInfo()`, which includes [Cart](/database/models/cart.md), [Product](/database/models/product.md), and [ProductVariation](/database/models/product-variation.md) model instances. Use **echo** to output custom HTML.
|
|
1073
|
-
|
|
1074
|
-
---
|
|
1075
|
-
|
|
1076
|
-
### ` line_meta `
|
|
1077
|
-
|
|
1078
|
-
`fluent_cart/cart/line_item/line_meta` — After line item content, for custom metadata
|
|
1079
|
-
|
|
1080
|
-
**When it runs:** This action fires after the main item content (title, variant info, child variants) inside the item info area, but before the price section. Use it to display custom per-item metadata such as personalization details or custom options.
|
|
1081
|
-
|
|
1082
|
-
**Parameters:**
|
|
1083
|
-
|
|
1084
|
-
- `$data` (array): Line item rendering context
|
|
1085
|
-
|
|
1086
|
-
```
|
|
1087
|
-
$data = [
|
|
1088
|
-
'item' => $item, // array — the cart item data (post_id, title, quantity, unit_price, etc.)
|
|
1089
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1090
|
-
'product' => $product, // Product model or null
|
|
1091
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1092
|
-
];
|
|
1093
|
-
```
|
|
1094
|
-
|
|
1095
|
-
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1096
|
-
|
|
1097
|
-
**Usage:**
|
|
1098
|
-
|
|
1099
|
-
```
|
|
1100
|
-
add_action('fluent_cart/cart/line_item/line_meta', function ($data) {
|
|
1101
|
-
$item = $data['item'];
|
|
1102
|
-
|
|
1103
|
-
// Display custom engraving text if present
|
|
1104
|
-
$engraving = $item['custom_fields']['engraving'] ?? '';
|
|
1105
|
-
if ($engraving) {
|
|
1106
|
-
echo '<div class="my-engraving-preview">';
|
|
1107
|
-
echo '<small>Engraving: ' . esc_html($engraving) . '</small>';
|
|
1108
|
-
echo '</div>';
|
|
1109
|
-
}
|
|
1110
|
-
}, 10, 1);
|
|
1111
|
-
```
|
|
1112
|
-
|
|
1113
|
-
### ` before_total `
|
|
1114
|
-
|
|
1115
|
-
`fluent_cart/cart/line_item/before_total` — Before the line item price/total
|
|
1116
|
-
|
|
1117
|
-
**When it runs:** This action fires inside the price area of a cart line item, before the item total (and any promotional strikethrough price) is displayed.
|
|
1118
|
-
|
|
1119
|
-
**Parameters:**
|
|
1120
|
-
|
|
1121
|
-
- `$data` (array): Line item rendering context
|
|
1122
|
-
|
|
1123
|
-
```
|
|
1124
|
-
$data = [
|
|
1125
|
-
'item' => $item, // array — the cart item data
|
|
1126
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1127
|
-
'product' => $product, // Product model or null
|
|
1128
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1129
|
-
];
|
|
1130
|
-
```
|
|
1131
|
-
|
|
1132
|
-
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1133
|
-
|
|
1134
|
-
**Usage:**
|
|
1135
|
-
|
|
1136
|
-
```
|
|
1137
|
-
add_action('fluent_cart/cart/line_item/before_total', function ($data) {
|
|
1138
|
-
$item = $data['item'];
|
|
1139
|
-
$savings = ($item['other_info']['original_price'] ?? 0) - ($item['unit_price'] ?? 0);
|
|
1140
|
-
if ($savings > 0) {
|
|
1141
|
-
echo '<span class="my-savings-badge">You save ' . esc_html(\FluentCart\App\Helpers\Helper::toDecimal($savings)) . '</span>';
|
|
1142
|
-
}
|
|
1143
|
-
}, 10, 1);
|
|
1144
|
-
```
|
|
1145
|
-
|
|
1146
|
-
### ` after_total `
|
|
1147
|
-
|
|
1148
|
-
`fluent_cart/cart/line_item/after_total` — After the line item price/total
|
|
1149
|
-
|
|
1150
|
-
**When it runs:** This action fires inside the price area of a cart line item, after the item total is displayed.
|
|
1151
|
-
|
|
1152
|
-
**Parameters:**
|
|
1153
|
-
|
|
1154
|
-
- `$data` (array): Line item rendering context
|
|
1155
|
-
|
|
1156
|
-
```
|
|
1157
|
-
$data = [
|
|
1158
|
-
'item' => $item, // array — the cart item data
|
|
1159
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1160
|
-
'product' => $product, // Product model or null
|
|
1161
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1162
|
-
];
|
|
1163
|
-
```
|
|
1164
|
-
|
|
1165
|
-
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1166
|
-
|
|
1167
|
-
**Usage:**
|
|
1168
|
-
|
|
1169
|
-
```
|
|
1170
|
-
add_action('fluent_cart/cart/line_item/after_total', function ($data) {
|
|
1171
|
-
$item = $data['item'];
|
|
1172
|
-
$paymentType = $item['other_info']['payment_type'] ?? '';
|
|
1173
|
-
if ($paymentType === 'subscription') {
|
|
1174
|
-
echo '<span class="my-recurring-label"><small>Recurring</small></span>';
|
|
1175
|
-
}
|
|
1176
|
-
}, 10, 1);
|
|
1177
|
-
```
|
|
1178
|
-
|
|
1179
|
-
### ` before_main_title `
|
|
1180
|
-
|
|
1181
|
-
`fluent_cart/cart/line_item/before_main_title` — Before the product title in a line item
|
|
1182
|
-
|
|
1183
|
-
**When it runs:** This action fires at the very beginning of the item title area, before the quantity badge, product name, and variant title.
|
|
1184
|
-
|
|
1185
|
-
**Parameters:**
|
|
1186
|
-
|
|
1187
|
-
- `$data` (array): Line item rendering context
|
|
1188
|
-
|
|
1189
|
-
```
|
|
1190
|
-
$data = [
|
|
1191
|
-
'item' => $item, // array — the cart item data
|
|
1192
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1193
|
-
'product' => $product, // Product model or null
|
|
1194
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1195
|
-
];
|
|
1196
|
-
```
|
|
1197
|
-
|
|
1198
|
-
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1199
|
-
|
|
1200
|
-
**Usage:**
|
|
1201
|
-
|
|
1202
|
-
```
|
|
1203
|
-
add_action('fluent_cart/cart/line_item/before_main_title', function ($data) {
|
|
1204
|
-
$item = $data['item'];
|
|
1205
|
-
// Add a "Sale" badge before the product title
|
|
1206
|
-
if (!empty($item['other_info']['is_on_sale'])) {
|
|
1207
|
-
echo '<span class="my-sale-badge">Sale</span>';
|
|
1208
|
-
}
|
|
1209
|
-
}, 10, 1);
|
|
1210
|
-
```
|
|
1211
|
-
|
|
1212
|
-
### ` after_main_title `
|
|
1213
|
-
|
|
1214
|
-
`fluent_cart/cart/line_item/after_main_title` — After the product title in a line item
|
|
1215
|
-
|
|
1216
|
-
**When it runs:** This action fires at the end of the item title area, after the product name, variant title, and payment type information (subscription details / per-unit price).
|
|
1217
|
-
|
|
1218
|
-
**Parameters:**
|
|
1219
|
-
|
|
1220
|
-
- `$data` (array): Line item rendering context
|
|
1221
|
-
|
|
1222
|
-
```
|
|
1223
|
-
$data = [
|
|
1224
|
-
'item' => $item, // array — the cart item data
|
|
1225
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1226
|
-
'product' => $product, // Product model or null
|
|
1227
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1228
|
-
];
|
|
1229
|
-
```
|
|
1230
|
-
|
|
1231
|
-
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1232
|
-
|
|
1233
|
-
**Usage:**
|
|
1234
|
-
|
|
1235
|
-
```
|
|
1236
|
-
add_action('fluent_cart/cart/line_item/after_main_title', function ($data) {
|
|
1237
|
-
$item = $data['item'];
|
|
1238
|
-
// Show estimated delivery date per item
|
|
1239
|
-
$deliveryDays = $item['other_info']['delivery_days'] ?? null;
|
|
1240
|
-
if ($deliveryDays) {
|
|
1241
|
-
$date = date('M j', strtotime("+{$deliveryDays} days"));
|
|
1242
|
-
echo '<div class="my-delivery-estimate"><small>Est. delivery: ' . esc_html($date) . '</small></div>';
|
|
1243
|
-
}
|
|
1244
|
-
}, 10, 1);
|
|
1245
|
-
```
|
|
1246
|
-
|
|
1247
|
-
### ` footer_start `
|
|
1248
|
-
|
|
1249
|
-
`fluent_cart/cart/line_item/footer_start` — Start of the line item footer area
|
|
1250
|
-
|
|
1251
|
-
**When it runs:** This action fires at the beginning of the `.fct_line_item_footer` area of a cart line item, before the payment-type info, setup-fee info, and any license activation-limit details. Fires in both the modal checkout renderer and the full checkout page renderer.
|
|
1252
|
-
|
|
1253
|
-
**Parameters:**
|
|
1254
|
-
|
|
1255
|
-
- `$data` (array): Line item rendering context (from `CartItemRenderer::getEventInfo()` / the modal renderer's equivalent)
|
|
1256
|
-
|
|
1257
|
-
```
|
|
1258
|
-
$data = [
|
|
1259
|
-
'item' => $item, // array — the cart item data
|
|
1260
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1261
|
-
'product' => $product, // Product model or null
|
|
1262
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1263
|
-
];
|
|
1264
|
-
```
|
|
1265
|
-
|
|
1266
|
-
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:326` (modal checkout) and `app/Services/Renderer/CartItemRenderer.php:92` (full checkout page)
|
|
1267
|
-
|
|
1268
|
-
**Usage:**
|
|
1269
|
-
|
|
1270
|
-
```
|
|
1271
|
-
add_action('fluent_cart/cart/line_item/footer_start', function ($data) {
|
|
1272
|
-
$item = $data['item'];
|
|
1273
|
-
if (!empty($item['other_info']['gift_wrapped'])) {
|
|
1274
|
-
echo '<span class="my-gift-wrap-icon">🎁 Gift wrapped</span>';
|
|
1275
|
-
}
|
|
1276
|
-
}, 10, 1);
|
|
1277
|
-
```
|
|
1278
|
-
|
|
1279
|
-
### ` unit_price_hint `
|
|
1280
|
-
|
|
1281
|
-
`fluent_cart/cart/line_item/unit_price_hint` — After the "$X each" unit price text
|
|
1282
|
-
|
|
1283
|
-
**When it runs:** This action fires right after the per-unit price hint (e.g. "$10.00 each") is printed for a line item, inside both the modal checkout renderer and the full checkout page's cart item renderer.
|
|
1284
|
-
|
|
1285
|
-
**Parameters:**
|
|
1286
|
-
|
|
1287
|
-
- `$data` (array): Line item rendering context
|
|
1288
|
-
|
|
1289
|
-
```
|
|
1290
|
-
$data = [
|
|
1291
|
-
'item' => $item, // array — the cart item data
|
|
1292
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1293
|
-
'product' => $product, // Product model or null
|
|
1294
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1295
|
-
];
|
|
1296
|
-
```
|
|
1297
|
-
|
|
1298
|
-
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:404` (modal checkout) and `app/Services/Renderer/CartItemRenderer.php:221` (full checkout page)
|
|
1299
|
-
|
|
1300
|
-
**Usage:**
|
|
1301
|
-
|
|
1302
|
-
```
|
|
1303
|
-
add_action('fluent_cart/cart/line_item/unit_price_hint', function ($data) {
|
|
1304
|
-
echo '<small class="my-price-note">(tax excl.)</small>';
|
|
1305
|
-
}, 10, 1);
|
|
1306
|
-
```
|
|
1307
|
-
|
|
1308
|
-
### ` setup_fee_price_info `
|
|
1309
|
-
|
|
1310
|
-
`fluent_cart/cart/line_item/setup_fee_price_info` — After a line item's setup fee amount
|
|
1311
|
-
|
|
1312
|
-
**When it runs:** This action fires inside `maybeRenderSetupFeeInfo()`, right after the setup-fee amount is printed for a subscription line item that has one. Only reachable for items with `other_info.payment_type === 'subscription'` and a non-zero setup fee.
|
|
1313
|
-
|
|
1314
|
-
**Parameters:**
|
|
1315
|
-
|
|
1316
|
-
- `$data` (array): Line item rendering context
|
|
1317
|
-
|
|
1318
|
-
```
|
|
1319
|
-
$data = [
|
|
1320
|
-
'item' => $item, // array — the cart item data
|
|
1321
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1322
|
-
'product' => $product, // Product model or null
|
|
1323
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1324
|
-
];
|
|
1325
|
-
```
|
|
1326
|
-
|
|
1327
|
-
**Source:** `app/Services/Renderer/CartItemRenderer.php:255`
|
|
1328
|
-
|
|
1329
|
-
**Usage:**
|
|
1330
|
-
|
|
1331
|
-
```
|
|
1332
|
-
add_action('fluent_cart/cart/line_item/setup_fee_price_info', function ($data) {
|
|
1333
|
-
echo '<span class="my-setup-fee-note">(one-time)</span>';
|
|
1334
|
-
}, 10, 1);
|
|
1335
|
-
```
|
|
1336
|
-
|
|
1337
|
-
### ` after_setup_fee_info `
|
|
1338
|
-
|
|
1339
|
-
`fluent_cart/cart/line_item/after_setup_fee_info` — After the entire setup fee block
|
|
1340
|
-
|
|
1341
|
-
**When it runs:** This action fires immediately after `renderSetupFeeInfo()` completes for a line item — i.e. after the whole setup-fee row (label + amount) has been printed, not just the amount. Only fires when the item actually has a setup fee.
|
|
1342
|
-
|
|
1343
|
-
**Parameters:**
|
|
1344
|
-
|
|
1345
|
-
- `$data` (array): Line item rendering context
|
|
1346
|
-
|
|
1347
|
-
```
|
|
1348
|
-
$data = [
|
|
1349
|
-
'item' => $item, // array — the cart item data
|
|
1350
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1351
|
-
'product' => $product, // Product model or null
|
|
1352
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1353
|
-
];
|
|
1354
|
-
```
|
|
1355
|
-
|
|
1356
|
-
**Source:** `app/Services/Renderer/CartItemRenderer.php:97`
|
|
1357
|
-
|
|
1358
|
-
**Usage:**
|
|
1359
|
-
|
|
1360
|
-
```
|
|
1361
|
-
add_action('fluent_cart/cart/line_item/after_setup_fee_info', function ($data) {
|
|
1362
|
-
echo '<div class="my-setup-fee-disclaimer"><small>Setup fee charged once at signup.</small></div>';
|
|
1363
|
-
}, 10, 1);
|
|
1364
|
-
```
|
|
1365
|
-
|
|
1366
|
-
### ` footer_end `
|
|
1367
|
-
|
|
1368
|
-
`fluent_cart/cart/line_item/footer_end` — End of the line item footer area
|
|
1369
|
-
|
|
1370
|
-
**When it runs:** This action fires at the very end of the `.fct_line_item_footer` area, after the setup-fee block (if any) and after `fluent_cart/cart/line_item/after_setup_fee_info`. It is the last hook in a cart line item's footer.
|
|
1371
|
-
|
|
1372
|
-
**Parameters:**
|
|
1373
|
-
|
|
1374
|
-
- `$data` (array): Line item rendering context
|
|
1375
|
-
|
|
1376
|
-
```
|
|
1377
|
-
$data = [
|
|
1378
|
-
'item' => $item, // array — the cart item data
|
|
1379
|
-
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1380
|
-
'product' => $product, // Product model or null
|
|
1381
|
-
'variant' => $variant, // ProductVariation model or null
|
|
1382
|
-
];
|
|
1383
|
-
```
|
|
1384
|
-
|
|
1385
|
-
**Source:** `app/Services/Renderer/CartItemRenderer.php:99`
|
|
1386
|
-
|
|
1387
|
-
**Usage:**
|
|
1388
|
-
|
|
1389
|
-
```
|
|
1390
|
-
add_action('fluent_cart/cart/line_item/footer_end', function ($data) {
|
|
1391
|
-
$item = $data['item'];
|
|
1392
|
-
// Append a closing note after everything else in the item footer
|
|
1393
|
-
echo '<div class="my-line-item-footer-note"></div>';
|
|
1394
|
-
}, 10, 1);
|
|
1395
|
-
```
|
|
1396
|
-
|
|
1397
|
-
---
|
|
1398
|
-
|
|
1399
|
-
## Modal Checkout
|
|
1400
|
-
|
|
1401
|
-
Hooks specific to the modal (popup) checkout renderer, distinct from the full checkout page.
|
|
1402
|
-
|
|
1403
|
-
### ` modal_checkout/after_shipping_methods `
|
|
1404
|
-
|
|
1405
|
-
`fluent_cart/modal_checkout/after_shipping_methods` — After the shipping methods list in the modal checkout
|
|
1406
|
-
|
|
1407
|
-
**When it runs:** This action fires in the modal checkout renderer right after the shipping methods list is rendered. If the store is configured to place payment methods in the "details" section (via `fluent_cart/modal_checkout/before_payment_methods_placement`), the `fluent_cart/before_payment_methods` hook fires immediately after this one, at this same location.
|
|
1408
|
-
|
|
1409
|
-
**Parameters:**
|
|
1410
|
-
|
|
1411
|
-
- `$data` (array): The current cart
|
|
1412
|
-
|
|
1413
|
-
```
|
|
1414
|
-
$data = [
|
|
1415
|
-
'cart' => $this->cart, // \FluentCart\App\Models\Cart instance
|
|
1416
|
-
];
|
|
1417
|
-
```
|
|
1418
|
-
|
|
1419
|
-
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:253`
|
|
1420
|
-
|
|
1421
|
-
**Usage:**
|
|
1422
|
-
|
|
1423
|
-
```
|
|
1424
|
-
add_action('fluent_cart/modal_checkout/after_shipping_methods', function ($data) {
|
|
1425
|
-
echo '<p class="my-modal-shipping-note">Free shipping over $50!</p>';
|
|
1426
|
-
}, 10, 1);
|
|
1427
|
-
```
|
|
1428
|
-
|
|
1429
|
-
---
|
|
1430
|
-
|
|
1431
|
-
## Receipt / Thank You Page
|
|
1432
|
-
|
|
1433
|
-
These hooks fire during the rendering of the thank-you / receipt page shown after a successful checkout. The `$config` parameter passed to most hooks contains the [Order](/database/models/order.md) model instance along with view context. All rendering hooks use output buffering — use **echo** to inject custom HTML.
|
|
1434
|
-
|
|
1435
|
-
---
|
|
1436
|
-
|
|
1437
|
-
### ` before_header `
|
|
1438
|
-
|
|
1439
|
-
`fluent_cart/receipt/thank_you/before_header` — Before the thank-you page header
|
|
1440
|
-
|
|
1441
|
-
**When it runs:** This action fires at the very beginning of the thank-you page content, before the header section (which contains the success/pending icon and title).
|
|
1442
|
-
|
|
1443
|
-
**Parameters:**
|
|
1444
|
-
|
|
1445
|
-
- `$config` (array): Thank-you page configuration
|
|
1446
|
-
|
|
1447
|
-
```
|
|
1448
|
-
$config = [
|
|
1449
|
-
'order' => $order, // \FluentCart\App\Models\Order instance
|
|
1450
|
-
'is_first_time' => true|false, // bool — whether this is the first view of this receipt
|
|
1451
|
-
'order_operation' => $orderOperation, // mixed — order operation context or null
|
|
1452
|
-
];
|
|
1453
|
-
```
|
|
1454
|
-
|
|
1455
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1456
|
-
|
|
1457
|
-
**Usage:**
|
|
1458
|
-
|
|
1459
|
-
```
|
|
1460
|
-
add_action('fluent_cart/receipt/thank_you/before_header', function ($config) {
|
|
1461
|
-
$order = $config['order'];
|
|
1462
|
-
echo '<div class="my-confetti-wrapper" data-order-id="' . intval($order->id) . '"></div>';
|
|
1463
|
-
}, 10, 1);
|
|
1464
|
-
```
|
|
1465
|
-
|
|
1466
|
-
### ` after_header `
|
|
1467
|
-
|
|
1468
|
-
`fluent_cart/receipt/thank_you/after_header` — After the thank-you page header
|
|
1469
|
-
|
|
1470
|
-
**When it runs:** This action fires after the header section (the success/pending icon and title) is fully rendered, before the body section begins.
|
|
1471
|
-
|
|
1472
|
-
**Parameters:**
|
|
1473
|
-
|
|
1474
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1475
|
-
|
|
1476
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1477
|
-
|
|
1478
|
-
**Usage:**
|
|
1479
|
-
|
|
1480
|
-
```
|
|
1481
|
-
add_action('fluent_cart/receipt/thank_you/after_header', function ($config) {
|
|
1482
|
-
$order = $config['order'];
|
|
1483
|
-
if ($order->payment_status === 'paid') {
|
|
1484
|
-
echo '<div class="my-share-prompt">';
|
|
1485
|
-
echo '<p>Love your purchase? Share it with friends!</p>';
|
|
1486
|
-
echo '</div>';
|
|
1487
|
-
}
|
|
1488
|
-
}, 10, 1);
|
|
1489
|
-
```
|
|
1490
|
-
|
|
1491
|
-
### ` after_header_title `
|
|
1492
|
-
|
|
1493
|
-
`fluent_cart/receipt/thank_you/after_header_title` — After the header title text
|
|
1494
|
-
|
|
1495
|
-
**When it runs:** This action fires inside the header section, after the "Purchase Successful!" or "Payment Pending!" heading, but still within the header wrapper div. Use it to add a subtitle or additional context below the main title.
|
|
1496
|
-
|
|
1497
|
-
**Parameters:**
|
|
1498
|
-
|
|
1499
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1500
|
-
|
|
1501
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1502
|
-
|
|
1503
|
-
**Usage:**
|
|
1504
|
-
|
|
1505
|
-
```
|
|
1506
|
-
add_action('fluent_cart/receipt/thank_you/after_header_title', function ($config) {
|
|
1507
|
-
$order = $config['order'];
|
|
1508
|
-
echo '<p class="my-order-ref">Order Reference: #' . esc_html($order->invoice_no) . '</p>';
|
|
1509
|
-
}, 10, 1);
|
|
1510
|
-
```
|
|
1511
|
-
|
|
1512
|
-
### ` before_body `
|
|
1513
|
-
|
|
1514
|
-
`fluent_cart/receipt/thank_you/before_body` — Before the thank-you page body
|
|
1515
|
-
|
|
1516
|
-
**When it runs:** This action fires after the header section and before the body section, which contains the order details, items, subscriptions, downloads, licenses, and addresses.
|
|
1517
|
-
|
|
1518
|
-
**Parameters:**
|
|
1519
|
-
|
|
1520
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1521
|
-
|
|
1522
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1523
|
-
|
|
1524
|
-
**Usage:**
|
|
1525
|
-
|
|
1526
|
-
```
|
|
1527
|
-
add_action('fluent_cart/receipt/thank_you/before_body', function ($config) {
|
|
1528
|
-
echo '<div class="my-receipt-notice">';
|
|
1529
|
-
echo '<p>A confirmation email has been sent to your email address.</p>';
|
|
1530
|
-
echo '</div>';
|
|
1531
|
-
}, 10, 1);
|
|
1532
|
-
```
|
|
1533
|
-
|
|
1534
|
-
### ` after_body `
|
|
1535
|
-
|
|
1536
|
-
`fluent_cart/receipt/thank_you/after_body` — After the thank-you page body
|
|
1537
|
-
|
|
1538
|
-
**When it runs:** This action fires after the body section (order details, items, addresses) is fully rendered, before the page wrapper closes.
|
|
1539
|
-
|
|
1540
|
-
**Parameters:**
|
|
1541
|
-
|
|
1542
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1543
|
-
|
|
1544
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1545
|
-
|
|
1546
|
-
**Usage:**
|
|
1547
|
-
|
|
1548
|
-
```
|
|
1549
|
-
add_action('fluent_cart/receipt/thank_you/after_body', function ($config) {
|
|
1550
|
-
echo '<div class="my-upsell-section">';
|
|
1551
|
-
echo '<h3>You might also like</h3>';
|
|
1552
|
-
// Render recommended products
|
|
1553
|
-
echo '</div>';
|
|
1554
|
-
}, 10, 1);
|
|
1555
|
-
```
|
|
1556
|
-
|
|
1557
|
-
### ` before_order_header `
|
|
1558
|
-
|
|
1559
|
-
`fluent_cart/receipt/thank_you/before_order_header` — Before the order header in the receipt body
|
|
1560
|
-
|
|
1561
|
-
**When it runs:** This action fires inside the receipt body, before the order header area (which shows the customer greeting and order number).
|
|
1562
|
-
|
|
1563
|
-
**Parameters:**
|
|
1564
|
-
|
|
1565
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1566
|
-
|
|
1567
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1568
|
-
|
|
1569
|
-
**Usage:**
|
|
1570
|
-
|
|
1571
|
-
```
|
|
1572
|
-
add_action('fluent_cart/receipt/thank_you/before_order_header', function ($config) {
|
|
1573
|
-
echo '<div class="my-receipt-date">';
|
|
1574
|
-
echo '<p>Order placed on: ' . esc_html(date('F j, Y')) . '</p>';
|
|
1575
|
-
echo '</div>';
|
|
1576
|
-
}, 10, 1);
|
|
1577
|
-
```
|
|
1578
|
-
|
|
1579
|
-
### ` after_order_header `
|
|
1580
|
-
|
|
1581
|
-
`fluent_cart/receipt/thank_you/after_order_header` — After the order header in the receipt body
|
|
1582
|
-
|
|
1583
|
-
**When it runs:** This action fires after the order header (customer greeting, order number, and payment status message), before the tax information and order items.
|
|
1584
|
-
|
|
1585
|
-
**Parameters:**
|
|
1586
|
-
|
|
1587
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1588
|
-
|
|
1589
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1590
|
-
|
|
1591
|
-
**Usage:**
|
|
1592
|
-
|
|
1593
|
-
```
|
|
1594
|
-
add_action('fluent_cart/receipt/thank_you/after_order_header', function ($config) {
|
|
1595
|
-
$order = $config['order'];
|
|
1596
|
-
if ($order->note) {
|
|
1597
|
-
echo '<div class="my-order-note">';
|
|
1598
|
-
echo '<strong>Your note:</strong> ' . esc_html($order->note);
|
|
1599
|
-
echo '</div>';
|
|
1600
|
-
}
|
|
1601
|
-
}, 10, 1);
|
|
1602
|
-
```
|
|
1603
|
-
|
|
1604
|
-
### ` before_order_items `
|
|
1605
|
-
|
|
1606
|
-
`fluent_cart/receipt/thank_you/before_order_items` — Before the order items list in the receipt
|
|
1607
|
-
|
|
1608
|
-
**When it runs:** This action fires after the store tax information and before the order items table is rendered.
|
|
1609
|
-
|
|
1610
|
-
**Parameters:**
|
|
1611
|
-
|
|
1612
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1613
|
-
|
|
1614
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1615
|
-
|
|
1616
|
-
**Usage:**
|
|
1617
|
-
|
|
1618
|
-
```
|
|
1619
|
-
add_action('fluent_cart/receipt/thank_you/before_order_items', function ($config) {
|
|
1620
|
-
echo '<div class="my-items-intro"><h4>Here is what you ordered:</h4></div>';
|
|
1621
|
-
}, 10, 1);
|
|
1622
|
-
```
|
|
1623
|
-
|
|
1624
|
-
### ` after_order_items `
|
|
1625
|
-
|
|
1626
|
-
`fluent_cart/receipt/thank_you/after_order_items` — After the order items list in the receipt
|
|
1627
|
-
|
|
1628
|
-
**When it runs:** This action fires after the order items table (including the totals breakdown), before the subscription items, downloads, licenses, and address sections.
|
|
1629
|
-
|
|
1630
|
-
**Parameters:**
|
|
1631
|
-
|
|
1632
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1633
|
-
|
|
1634
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1635
|
-
|
|
1636
|
-
**Usage:**
|
|
1637
|
-
|
|
1638
|
-
```
|
|
1639
|
-
add_action('fluent_cart/receipt/thank_you/after_order_items', function ($config) {
|
|
1640
|
-
$order = $config['order'];
|
|
1641
|
-
// Show a referral code after the items list
|
|
1642
|
-
echo '<div class="my-referral-block">';
|
|
1643
|
-
echo '<p>Share your referral code <strong>REF-' . intval($order->customer_id) . '</strong> and earn 10% credit!</p>';
|
|
1644
|
-
echo '</div>';
|
|
1645
|
-
}, 10, 1);
|
|
1646
|
-
```
|
|
1647
|
-
|
|
1648
|
-
### ` before_footer_buttons `
|
|
1649
|
-
|
|
1650
|
-
`fluent_cart/receipt/thank_you/before_footer_buttons` — Before the footer buttons
|
|
1651
|
-
|
|
1652
|
-
**When it runs:** This action fires in the receipt footer area, before the "View Order" and "Download Receipt" buttons are rendered.
|
|
1653
|
-
|
|
1654
|
-
**Parameters:**
|
|
1655
|
-
|
|
1656
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1657
|
-
|
|
1658
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1659
|
-
|
|
1660
|
-
**Usage:**
|
|
1661
|
-
|
|
1662
|
-
```
|
|
1663
|
-
add_action('fluent_cart/receipt/thank_you/before_footer_buttons', function ($config) {
|
|
1664
|
-
echo '<div class="my-footer-message">';
|
|
1665
|
-
echo '<p>Thank you for shopping with us!</p>';
|
|
1666
|
-
echo '</div>';
|
|
1667
|
-
}, 10, 1);
|
|
1668
|
-
```
|
|
1669
|
-
|
|
1670
|
-
### ` after_footer_buttons `
|
|
1671
|
-
|
|
1672
|
-
`fluent_cart/receipt/thank_you/after_footer_buttons` — After the footer buttons
|
|
1673
|
-
|
|
1674
|
-
**When it runs:** This action fires in the receipt footer area, after the "View Order" and "Download Receipt" buttons have been rendered.
|
|
1675
|
-
|
|
1676
|
-
**Parameters:**
|
|
1677
|
-
|
|
1678
|
-
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1679
|
-
|
|
1680
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1681
|
-
|
|
1682
|
-
**Usage:**
|
|
1683
|
-
|
|
1684
|
-
```
|
|
1685
|
-
add_action('fluent_cart/receipt/thank_you/after_footer_buttons', function ($config) {
|
|
1686
|
-
echo '<div class="my-social-share">';
|
|
1687
|
-
echo '<p>Follow us on social media for updates and exclusive offers.</p>';
|
|
1688
|
-
echo '</div>';
|
|
1689
|
-
}, 10, 1);
|
|
1690
|
-
```
|
|
1691
|
-
|
|
1692
|
-
### ` after_receipt `
|
|
1693
|
-
|
|
1694
|
-
`fluent_cart/after_receipt` — After the entire receipt/thank-you page
|
|
1695
|
-
|
|
1696
|
-
**When it runs:** This action fires after the complete thank-you page has been rendered, including the footer. It fires on every receipt view (both first-time and returning visits). This hook is also present in the legacy `thank_you.php` view template.
|
|
1697
|
-
|
|
1698
|
-
**Parameters:**
|
|
1699
|
-
|
|
1700
|
-
- `$data` (array): Order and view context
|
|
1701
|
-
|
|
1702
|
-
```
|
|
1703
|
-
$data = [
|
|
1704
|
-
'order' => $order, // \FluentCart\App\Models\Order instance
|
|
1705
|
-
'is_first_time' => true|false, // bool — whether this is the first view of this receipt
|
|
1706
|
-
'order_operation' => $orderOperation, // mixed — order operation context or null
|
|
1707
|
-
];
|
|
1708
|
-
```
|
|
1709
|
-
|
|
1710
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`, `app/Views/invoice/thank_you.php`
|
|
1711
|
-
|
|
1712
|
-
**Usage:**
|
|
1713
|
-
|
|
1714
|
-
```
|
|
1715
|
-
add_action('fluent_cart/after_receipt', function ($data) {
|
|
1716
|
-
$order = $data['order'];
|
|
1717
|
-
|
|
1718
|
-
// Render a customer satisfaction survey
|
|
1719
|
-
echo '<div class="my-survey-widget">';
|
|
1720
|
-
echo '<h4>How was your experience?</h4>';
|
|
1721
|
-
echo '<a href="/survey?order=' . intval($order->id) . '">Take a quick survey</a>';
|
|
1722
|
-
echo '</div>';
|
|
1723
|
-
}, 10, 1);
|
|
1724
|
-
```
|
|
1725
|
-
|
|
1726
|
-
### ` after_receipt_first_time `
|
|
1727
|
-
|
|
1728
|
-
`fluent_cart/after_receipt_first_time` — Only on the first receipt view (for conversion tracking)
|
|
1729
|
-
|
|
1730
|
-
**When it runs:** This action fires only on the first time a customer views the receipt page after a purchase. It does not fire on subsequent visits to the same receipt URL. This is the ideal hook for firing conversion tracking pixels, analytics events, or affiliate postback URLs.
|
|
1731
|
-
|
|
1732
|
-
**Parameters:**
|
|
1733
|
-
|
|
1734
|
-
- `$data` (array): Order and operation context
|
|
1735
|
-
|
|
1736
|
-
```
|
|
1737
|
-
$data = [
|
|
1738
|
-
'order' => $order, // \FluentCart\App\Models\Order instance
|
|
1739
|
-
'order_operation' => $orderOperation, // mixed — order operation context or null
|
|
1740
|
-
];
|
|
1741
|
-
```
|
|
1742
|
-
|
|
1743
|
-
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`, `app/Views/invoice/thank_you.php`
|
|
1744
|
-
|
|
1745
|
-
**Usage:**
|
|
1746
|
-
|
|
1747
|
-
```
|
|
1748
|
-
add_action('fluent_cart/after_receipt_first_time', function ($data) {
|
|
1749
|
-
$order = $data['order'];
|
|
1750
|
-
$total = \FluentCart\App\Helpers\Helper::toDecimal($order->total_amount);
|
|
1751
|
-
|
|
1752
|
-
// Fire a conversion pixel only on first receipt view
|
|
1753
|
-
echo '<script>';
|
|
1754
|
-
echo 'fbq("track", "Purchase", { value: ' . esc_js($total) . ', currency: "' . esc_js($order->currency) . '" });';
|
|
1755
|
-
echo '</script>';
|
|
1756
|
-
|
|
1757
|
-
// Google Ads conversion
|
|
1758
|
-
echo '<script>';
|
|
1759
|
-
echo 'gtag("event", "conversion", { send_to: "AW-XXXXX/YYYYY", value: ' . esc_js($total) . ', currency: "' . esc_js($order->currency) . '", transaction_id: "' . esc_js($order->invoice_no) . '" });';
|
|
1760
|
-
echo '</script>';
|
|
1761
|
-
}, 10, 1);
|
|
1762
|
-
```
|
|
1763
|
-
|
|
1764
|
-
### ` before_render_redirect_page `
|
|
1765
|
-
|
|
1766
|
-
`fluent_cart/before_render_redirect_page` — Before the payment redirect/receipt page renders
|
|
1767
|
-
|
|
1768
|
-
**When it runs:** This action fires at the very beginning of the receipt shortcode handler, before any receipt or redirect page content is rendered. It provides the raw URL parameters used to identify the order and transaction. Use it for early validation, logging, or to set up resources needed by the receipt page.
|
|
1769
|
-
|
|
1770
|
-
**Parameters:**
|
|
1771
|
-
|
|
1772
|
-
- `$data` (array): URL parameters for the receipt/redirect
|
|
1773
|
-
|
|
1774
|
-
```
|
|
1775
|
-
$data = [
|
|
1776
|
-
'order_hash' => $orderHash, // string — the order UUID from the URL
|
|
1777
|
-
'trx_hash' => $transactionHash, // string — the transaction hash from the URL
|
|
1778
|
-
'method' => $method, // string — the payment method slug
|
|
1779
|
-
'is_receipt' => $isReceipt, // bool — true if this is a receipt page, false if redirect
|
|
1780
|
-
];
|
|
1781
|
-
```
|
|
1782
|
-
|
|
1783
|
-
**Source:** `app/Hooks/Handlers/ShortCodes/ReceiptHandler.php`
|
|
1784
|
-
|
|
1785
|
-
**Usage:**
|
|
1786
|
-
|
|
1787
|
-
```
|
|
1788
|
-
add_action('fluent_cart/before_render_redirect_page', function ($data) {
|
|
1789
|
-
// Log receipt page visits for debugging payment callbacks
|
|
1790
|
-
if ($data['is_receipt'] && $data['order_hash']) {
|
|
1791
|
-
error_log('Receipt page visited for order: ' . $data['order_hash']
|
|
1792
|
-
. ' via method: ' . $data['method']);
|
|
1793
|
-
}
|
|
1794
|
-
}, 10, 1);
|
|
1795
|
-
```
|
|
1
|
+
# Cart & Checkout
|
|
2
|
+
|
|
3
|
+
All hooks related to the shopping flow — from adding items to the [Cart](/database/models/cart.md) through checkout rendering and the receipt/thank-you page.
|
|
4
|
+
|
|
5
|
+
## Cart Events
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### ` item_added `
|
|
10
|
+
|
|
11
|
+
`fluent_cart/cart/item_added` — Fired after an item is added to the cart
|
|
12
|
+
|
|
13
|
+
**When it runs:** This action fires immediately after a product item has been successfully added to the [Cart](/database/models/cart.md) model and saved to the database. It runs before the `cart_data_items_updated` hook with the `item_added` scope.
|
|
14
|
+
|
|
15
|
+
**Parameters:**
|
|
16
|
+
|
|
17
|
+
- `$data` (array): Cart and item data
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
$data = [
|
|
21
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
22
|
+
'item' => $item, // array — the cart item that was just added
|
|
23
|
+
];
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Source:** `app/Models/Cart.php`
|
|
27
|
+
|
|
28
|
+
**Usage:**
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
add_action('fluent_cart/cart/item_added', function ($data) {
|
|
32
|
+
$cart = $data['cart'];
|
|
33
|
+
$item = $data['item'];
|
|
34
|
+
|
|
35
|
+
// Log the added product for analytics
|
|
36
|
+
error_log('Product ' . $item['post_id'] . ' added to cart #' . $cart->id);
|
|
37
|
+
}, 10, 1);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### ` item_removed `
|
|
41
|
+
|
|
42
|
+
`fluent_cart/cart/item_removed` — Fired after an item is removed from the cart
|
|
43
|
+
|
|
44
|
+
**When it runs:** This action fires after a product item has been removed from the [Cart](/database/models/cart.md) and saved, but only when the `$triggerEvent` parameter is `true` (the default). When an item is removed silently (e.g., during a replacement operation), this hook does not fire.
|
|
45
|
+
|
|
46
|
+
**Parameters:**
|
|
47
|
+
|
|
48
|
+
- `$data` (array): Cart and removal context
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
$data = [
|
|
52
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
53
|
+
'variation_id' => $variationId, // int — the variation ID that was removed
|
|
54
|
+
'extra_args' => $extraArgs, // array — additional matching arguments
|
|
55
|
+
'removed_item' => $removingItem, // array — the full cart item that was removed
|
|
56
|
+
];
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Source:** `app/Models/Cart.php`
|
|
60
|
+
|
|
61
|
+
**Usage:**
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
add_action('fluent_cart/cart/item_removed', function ($data) {
|
|
65
|
+
$removedItem = $data['removed_item'];
|
|
66
|
+
$cart = $data['cart'];
|
|
67
|
+
|
|
68
|
+
// Track removal for abandoned cart analytics
|
|
69
|
+
do_action('my_plugin/track_cart_removal', [
|
|
70
|
+
'variation_id' => $data['variation_id'],
|
|
71
|
+
'product_id' => $removedItem['post_id'] ?? null,
|
|
72
|
+
'cart_id' => $cart->id,
|
|
73
|
+
]);
|
|
74
|
+
}, 10, 1);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### ` cart_data_items_updated `
|
|
78
|
+
|
|
79
|
+
`fluent_cart/cart/cart_data_items_updated` — General-purpose hook for any cart data change
|
|
80
|
+
|
|
81
|
+
**When it runs:** This action fires whenever the cart data array is modified. The `scope` field tells you what operation triggered the update. It fires on item add, item remove, coupon apply, coupon remove, discount recalculation, and checkout page loading.
|
|
82
|
+
|
|
83
|
+
**Parameters:**
|
|
84
|
+
|
|
85
|
+
- `$data` (array): Cart and scope context
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
$data = [
|
|
89
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
90
|
+
'scope' => 'item_added', // string — one of the scope values below
|
|
91
|
+
'scope_data' => $scopeData, // mixed — context data depending on scope
|
|
92
|
+
];
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Possible `scope` values and their `scope_data`:
|
|
96
|
+
|
|
97
|
+
| scope | scope_data |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| `'item_added'` | The cart item array that was added |
|
|
100
|
+
| `'item_removed'` | The variation ID (int) that was removed |
|
|
101
|
+
| `'discounts_recalculated'` | Array of applied coupon codes |
|
|
102
|
+
| `'remove_coupon'` | Array of coupon codes that were removed |
|
|
103
|
+
| `'apply_coupons'` | Array of coupon codes that were applied |
|
|
104
|
+
| `'loading'` | Empty string (fired on checkout page load) |
|
|
105
|
+
|
|
106
|
+
**Source:** `app/Models/Cart.php`, `app/Hooks/Handlers/ShortCodes/Checkout/CheckoutPageHandler.php`
|
|
107
|
+
|
|
108
|
+
**Usage:**
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
add_action('fluent_cart/cart/cart_data_items_updated', function ($data) {
|
|
112
|
+
$cart = $data['cart'];
|
|
113
|
+
$scope = $data['scope'];
|
|
114
|
+
|
|
115
|
+
if ($scope === 'item_added' || $scope === 'item_removed') {
|
|
116
|
+
// Recalculate custom surcharges whenever items change
|
|
117
|
+
my_plugin_recalculate_surcharges($cart);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if ($scope === 'apply_coupons') {
|
|
121
|
+
// Log coupon usage
|
|
122
|
+
error_log('Coupons applied to cart #' . $cart->id . ': ' . implode(', ', $data['scope_data']));
|
|
123
|
+
}
|
|
124
|
+
}, 10, 1);
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### ` cart_completed `
|
|
128
|
+
|
|
129
|
+
`fluent_cart/cart_completed` — Fired when a cart is marked as completed after payment
|
|
130
|
+
|
|
131
|
+
**When it runs:** This action fires when the cart's stage is set to `completed` after a successful [Order](/database/models/order.md) payment. The cart's `completed_at` timestamp has already been saved at this point. This is triggered inside `StatusHelper` during order status transitions when payment is marked as paid.
|
|
132
|
+
|
|
133
|
+
**Parameters:**
|
|
134
|
+
|
|
135
|
+
- `$data` (array): Completed cart and associated order
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
$data = [
|
|
139
|
+
'cart' => $relatedCart, // \FluentCart\App\Models\Cart instance (stage = 'completed')
|
|
140
|
+
'order' => $order, // \FluentCart\App\Models\Order instance
|
|
141
|
+
];
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Source:** `app/Helpers/StatusHelper.php`
|
|
145
|
+
|
|
146
|
+
**Usage:**
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
add_action('fluent_cart/cart_completed', function ($data) {
|
|
150
|
+
$cart = $data['cart'];
|
|
151
|
+
$order = $data['order'];
|
|
152
|
+
|
|
153
|
+
// Fire a conversion pixel or sync to analytics
|
|
154
|
+
my_plugin_track_conversion([
|
|
155
|
+
'order_id' => $order->id,
|
|
156
|
+
'total' => $order->total_amount,
|
|
157
|
+
'customer_id' => $order->customer_id,
|
|
158
|
+
]);
|
|
159
|
+
}, 10, 1);
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### ` before_totals_calculation `
|
|
163
|
+
|
|
164
|
+
`fluent_cart/cart/before_totals_calculation` — Before the cart's grand total is recalculated
|
|
165
|
+
|
|
166
|
+
**When it runs:** This action fires at the start of `Cart::getEstimatedTotal()` (or equivalent total-calculation path), before dynamic discounts (`fluent_cart/cart/item_dynamic_discount`) are applied and before line items are re-summed. A `self::$calculatingTotal` guard is set to `true` immediately before this fires, preventing re-entrant recalculation.
|
|
167
|
+
|
|
168
|
+
**Parameters:**
|
|
169
|
+
|
|
170
|
+
- `$data` (array): The cart about to be recalculated
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
$data = [
|
|
174
|
+
'cart' => $this, // \FluentCart\App\Models\Cart instance
|
|
175
|
+
];
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Source:** `app/Models/Cart.php:1194`
|
|
179
|
+
|
|
180
|
+
**Usage:**
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
add_action('fluent_cart/cart/before_totals_calculation', function ($data) {
|
|
184
|
+
$cart = $data['cart'];
|
|
185
|
+
// Warm a cache needed by a custom pricing rule before totals run
|
|
186
|
+
my_plugin_prime_pricing_cache($cart->id);
|
|
187
|
+
}, 10, 1);
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### ` after_totals_calculation `
|
|
191
|
+
|
|
192
|
+
`fluent_cart/cart/after_totals_calculation` — After the cart's grand total has been recalculated
|
|
193
|
+
|
|
194
|
+
**When it runs:** This action fires at the end of `Cart::getEstimatedTotal()`, after fees, discounts, prorate credits, and upgrade discounts have all been applied to produce the final total. It fires right before the `self::$calculatingTotal` guard is released.
|
|
195
|
+
|
|
196
|
+
**Parameters:**
|
|
197
|
+
|
|
198
|
+
- `$data` (array): The cart and its computed total
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
$data = [
|
|
202
|
+
'cart' => $this, // \FluentCart\App\Models\Cart instance
|
|
203
|
+
'total' => $finalTotal, // int — the final cart total in cents
|
|
204
|
+
];
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Source:** `app/Models/Cart.php:1244`
|
|
208
|
+
|
|
209
|
+
**Usage:**
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
add_action('fluent_cart/cart/after_totals_calculation', function ($data) {
|
|
213
|
+
$cart = $data['cart'];
|
|
214
|
+
$total = \FluentCart\App\Helpers\Helper::toDecimal($data['total']);
|
|
215
|
+
error_log('Cart #' . $cart->id . ' recalculated total: ' . $total);
|
|
216
|
+
}, 10, 1);
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Checkout Data Events
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
### ` order/after_items_calculated `
|
|
226
|
+
|
|
227
|
+
`fluent_cart/order/after_items_calculated` — After the draft order's items/totals are calculated
|
|
228
|
+
|
|
229
|
+
**When it runs:** This action fires during the checkout submission flow (`CheckoutApi`), right after the draft [Order](/database/models/order.md)'s line items and totals have been calculated, and immediately before the `fluent_cart/checkout/prepare_other_data` hook below (same request, same method).
|
|
230
|
+
|
|
231
|
+
**Parameters:**
|
|
232
|
+
|
|
233
|
+
- `$data` (array): Order and cart context
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
$data = [
|
|
237
|
+
'order' => $createdOrder, // \FluentCart\App\Models\Order — the newly created draft order
|
|
238
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
239
|
+
'cart_items' => $cartCheckoutHelper->getItems(), // array — resolved cart items
|
|
240
|
+
];
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Source:** `api/Checkout/CheckoutApi.php:269`
|
|
244
|
+
|
|
245
|
+
**Usage:**
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
add_action('fluent_cart/order/after_items_calculated', function ($data) {
|
|
249
|
+
$order = $data['order'];
|
|
250
|
+
// Attach a custom line-item summary before other modules touch the order
|
|
251
|
+
fluent_cart_add_log(
|
|
252
|
+
'Order Items Calculated',
|
|
253
|
+
sprintf('Order #%d totals calculated with %d items.', $order->id, count($data['cart_items'])),
|
|
254
|
+
'info'
|
|
255
|
+
);
|
|
256
|
+
}, 10, 1);
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### ` prepare_other_data `
|
|
260
|
+
|
|
261
|
+
`fluent_cart/checkout/prepare_other_data` — After order creation, before finalizing
|
|
262
|
+
|
|
263
|
+
**When it runs:** This action fires during the checkout submission flow, after the draft [Order](/database/models/order.md) has been created but before it is finalized (before addresses and items are attached). This gives modules a chance to attach additional data to the order.
|
|
264
|
+
|
|
265
|
+
**Parameters:**
|
|
266
|
+
|
|
267
|
+
- `$data` (array): Full checkout context
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
$data = [
|
|
271
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
272
|
+
'order' => $createdOrder, // \FluentCart\App\Models\Order — the newly created draft order
|
|
273
|
+
'prev_order' => $prevOrder, // \FluentCart\App\Models\Order|null — previous order if retrying
|
|
274
|
+
'request_data' => $data, // array — raw validated request data from checkout form
|
|
275
|
+
'validated_data' => $validatedData, // array — sanitized/validated checkout field values
|
|
276
|
+
];
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**Source:** `api/Checkout/CheckoutApi.php`
|
|
280
|
+
|
|
281
|
+
**Usage:**
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
add_action('fluent_cart/checkout/prepare_other_data', function ($data) {
|
|
285
|
+
$order = $data['order'];
|
|
286
|
+
$requestData = $data['request_data'];
|
|
287
|
+
|
|
288
|
+
// Attach custom metadata to the order before it finalizes
|
|
289
|
+
$customField = sanitize_text_field($requestData['custom_gift_message'] ?? '');
|
|
290
|
+
if ($customField) {
|
|
291
|
+
$order->updateMeta('gift_message', $customField);
|
|
292
|
+
}
|
|
293
|
+
}, 10, 1);
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### ` cart_amount_updated `
|
|
297
|
+
|
|
298
|
+
`fluent_cart/checkout/cart_amount_updated` — Fired when the cart total may have changed
|
|
299
|
+
|
|
300
|
+
**When it runs:** This action fires whenever an operation changes (or may change) the cart total. This includes: item removal (silent mode), coupon application, coupon removal, discount recalculation, quantity updates, order bump toggles, and tax recalculations. Use this hook to react to price changes regardless of the specific cause.
|
|
301
|
+
|
|
302
|
+
**Parameters:**
|
|
303
|
+
|
|
304
|
+
- `$data` (array): The affected cart
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
$data = [
|
|
308
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
309
|
+
];
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Source:** `app/Models/Cart.php`, `app/Hooks/Cart/WebCheckoutHandler.php`, `app/Modules/Tax/TaxModule.php`
|
|
313
|
+
|
|
314
|
+
**Usage:**
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
add_action('fluent_cart/checkout/cart_amount_updated', function ($data) {
|
|
318
|
+
$cart = $data['cart'];
|
|
319
|
+
|
|
320
|
+
// Recalculate a custom fee based on the new cart total
|
|
321
|
+
$estimatedTotal = $cart->getEstimatedTotal();
|
|
322
|
+
if ($estimatedTotal > 10000) { // over $100.00
|
|
323
|
+
// Apply free shipping threshold logic
|
|
324
|
+
my_plugin_apply_free_shipping($cart);
|
|
325
|
+
}
|
|
326
|
+
}, 10, 1);
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### ` shipping_data_changed `
|
|
330
|
+
|
|
331
|
+
`fluent_cart/checkout/shipping_data_changed` — Fired when shipping data changes
|
|
332
|
+
|
|
333
|
+
**When it runs:** This action fires when shipping-related data on the cart changes, such as when a new shipping method is selected, the shipping charge changes, or the shipping address is updated in a way that affects shipping calculations.
|
|
334
|
+
|
|
335
|
+
**Parameters:**
|
|
336
|
+
|
|
337
|
+
- `$data` (array): The affected cart
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
$data = [
|
|
341
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
342
|
+
];
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
**Source:** `app/Helpers/CartHelper.php`, `app/Hooks/Cart/WebCheckoutHandler.php`
|
|
346
|
+
|
|
347
|
+
**Usage:**
|
|
348
|
+
|
|
349
|
+
```
|
|
350
|
+
add_action('fluent_cart/checkout/shipping_data_changed', function ($data) {
|
|
351
|
+
$cart = $data['cart'];
|
|
352
|
+
$shippingData = $cart->checkout_data['shipping_data'] ?? [];
|
|
353
|
+
|
|
354
|
+
// Log shipping method selection for analytics
|
|
355
|
+
error_log('Cart #' . $cart->id . ' shipping method: ' . ($shippingData['shipping_method_id'] ?? 'none'));
|
|
356
|
+
}, 10, 1);
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### ` form_data_changed `
|
|
360
|
+
|
|
361
|
+
`fluent_cart/checkout/form_data_changed` — Fired when checkout form data changes
|
|
362
|
+
|
|
363
|
+
**When it runs:** This action fires when the checkout form data is updated via AJAX, such as when a customer changes their address, toggles "ship to different address", or any form field is updated that triggers a server-side recalculation.
|
|
364
|
+
|
|
365
|
+
**Parameters:**
|
|
366
|
+
|
|
367
|
+
- `$data` (array): The affected cart
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
$data = [
|
|
371
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
372
|
+
];
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
**Source:** `app/Hooks/Cart/WebCheckoutHandler.php`
|
|
376
|
+
|
|
377
|
+
**Usage:**
|
|
378
|
+
|
|
379
|
+
```
|
|
380
|
+
add_action('fluent_cart/checkout/form_data_changed', function ($data) {
|
|
381
|
+
$cart = $data['cart'];
|
|
382
|
+
$formData = $cart->checkout_data['form_data'] ?? [];
|
|
383
|
+
|
|
384
|
+
// Check if the billing country requires special handling
|
|
385
|
+
$billingCountry = $formData['billing_country'] ?? '';
|
|
386
|
+
if (in_array($billingCountry, ['BR', 'IN'])) {
|
|
387
|
+
// Add country-specific checkout notices
|
|
388
|
+
my_plugin_add_country_notice($cart, $billingCountry);
|
|
389
|
+
}
|
|
390
|
+
}, 10, 1);
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### ` customer_data_saved `
|
|
394
|
+
|
|
395
|
+
`fluent_cart/checkout/customer_data_saved` — Removed in 1.4.0 — no longer fired
|
|
396
|
+
|
|
397
|
+
Removed in 1.4.0 — this hook no longer fires
|
|
398
|
+
|
|
399
|
+
`fluent_cart/checkout/customer_data_saved` was removed from the checkout refactor in commit `ebeae0dc3` (2026-05-14, shipped in **1.4.0**). It does not exist anywhere in FluentCart or FluentCart Pro today, so a callback registered on it will **never run** — silently, with no error.
|
|
400
|
+
|
|
401
|
+
This entry is kept only so that anyone whose integration stopped working can find out why. Do not write new code against it.
|
|
402
|
+
|
|
403
|
+
**What to use instead:** the checkout data is now persisted without a per-key notification. To react to checkout field changes, hook [`fluent_cart/checkout/validate_data`](./../filters/cart-and-checkout.md) before persistence, or read the final state from the order lifecycle actions in [Orders](./orders.md) after checkout completes.
|
|
404
|
+
|
|
405
|
+
**When it fired (historical, prior to 1.4.0):** It fired when a specific piece of customer data was saved during checkout, after the value had been persisted to the cart model, and passed both the old and new values so a listener could detect changes.
|
|
406
|
+
|
|
407
|
+
**Parameters:**
|
|
408
|
+
|
|
409
|
+
- `$data` (array): Customer data change context
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
$data = [
|
|
413
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
414
|
+
'key' => $key, // string — the data key that changed (e.g. 'billing_country')
|
|
415
|
+
'value' => $value, // mixed — the new value
|
|
416
|
+
'old_value' => $prevValue, // mixed — the previous value
|
|
417
|
+
'old_data' => $oldCheckoutData, // array — the full previous checkout_data array
|
|
418
|
+
];
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
**Source:** `app/Hooks/Cart/WebCheckoutHandler.php`
|
|
422
|
+
|
|
423
|
+
**Usage:**
|
|
424
|
+
|
|
425
|
+
```
|
|
426
|
+
add_action('fluent_cart/checkout/customer_data_saved', function ($data) {
|
|
427
|
+
$cart = $data['cart'];
|
|
428
|
+
$key = $data['key'];
|
|
429
|
+
|
|
430
|
+
// React to billing country changes for tax recalculation
|
|
431
|
+
if ($key === 'billing_country' && $data['value'] !== $data['old_value']) {
|
|
432
|
+
error_log('Cart #' . $cart->id . ' billing country changed from '
|
|
433
|
+
. $data['old_value'] . ' to ' . $data['value']);
|
|
434
|
+
}
|
|
435
|
+
}, 10, 1);
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### ` tax/reverse_charge_applied `
|
|
439
|
+
|
|
440
|
+
`fluent_cart/tax/reverse_charge_applied` — Fired when the EU VAT reverse charge is applied to the cart
|
|
441
|
+
|
|
442
|
+
**When it runs:** This action fires during cart tax calculation (`TaxModule::calculateCartTax()`) when the reverse charge mechanism has just been applied — a qualifying business customer (e.g. validated EU VAT number) is liable for the VAT, so tax has been removed and inclusive product lines and fees have been adjusted to net prices. It fires after those adjustments are written into the cart's checkout data.
|
|
443
|
+
|
|
444
|
+
**Parameters:**
|
|
445
|
+
|
|
446
|
+
- `$data` (array): Reverse charge context
|
|
447
|
+
|
|
448
|
+
```
|
|
449
|
+
$data = [
|
|
450
|
+
'checkout_data' => $checkoutData, // array — the cart's checkout_data (includes the updated 'tax_data')
|
|
451
|
+
'product_lines' => $productLines, // array — cart product line items, already adjusted to net prices
|
|
452
|
+
];
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
**Source:** `app/Modules/Tax/TaxModule.php (line 750)`
|
|
456
|
+
|
|
457
|
+
**Usage:**
|
|
458
|
+
|
|
459
|
+
```
|
|
460
|
+
add_action('fluent_cart/tax/reverse_charge_applied', function ($data) {
|
|
461
|
+
$taxData = $data['checkout_data']['tax_data'] ?? [];
|
|
462
|
+
|
|
463
|
+
// Log or sync with an external tax service
|
|
464
|
+
my_tax_service_flag_reverse_charge($taxData);
|
|
465
|
+
}, 10, 1);
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### ` tax/reverse_charge_removed `
|
|
469
|
+
|
|
470
|
+
`fluent_cart/tax/reverse_charge_removed` — Fired when the EU VAT reverse charge is removed from the cart
|
|
471
|
+
|
|
472
|
+
**When it runs:** This action fires during cart tax calculation (`TaxModule::calculateCartTax()`) when a previously applicable reverse charge no longer applies (e.g. the VAT number was removed or the billing country changed). Product lines have already been restored to gross prices and the reverse charge fee adjustments cleared before it fires.
|
|
473
|
+
|
|
474
|
+
**Parameters:**
|
|
475
|
+
|
|
476
|
+
- `$data` (array): Reverse charge context
|
|
477
|
+
|
|
478
|
+
```
|
|
479
|
+
$data = [
|
|
480
|
+
'checkout_data' => $checkoutData, // array — the cart's checkout_data (includes 'tax_data')
|
|
481
|
+
'product_lines' => $productLines, // array — cart product line items, restored to gross prices
|
|
482
|
+
];
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
**Source:** `app/Modules/Tax/TaxModule.php (line 762)`
|
|
486
|
+
|
|
487
|
+
**Usage:**
|
|
488
|
+
|
|
489
|
+
```
|
|
490
|
+
add_action('fluent_cart/tax/reverse_charge_removed', function ($data) {
|
|
491
|
+
// React to the customer no longer qualifying for reverse charge
|
|
492
|
+
my_tax_service_clear_reverse_charge($data['checkout_data']);
|
|
493
|
+
}, 10, 1);
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
## Checkout Page Rendering
|
|
499
|
+
|
|
500
|
+
All hooks in this section fire during server-side HTML rendering of the checkout page. They use output buffering, so you should **echo** (not return) any custom HTML you want to inject.
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
### ` before_checkout_page_start `
|
|
505
|
+
|
|
506
|
+
`fluent_cart/before_checkout_page_start` — Before the checkout page wrapper div
|
|
507
|
+
|
|
508
|
+
**When it runs:** This action fires immediately before the main checkout page `` wrapper is opened. Use it to output HTML or scripts that should appear above the entire checkout page.
|
|
509
|
+
|
|
510
|
+
**Parameters:**
|
|
511
|
+
|
|
512
|
+
- `$data` (array): The current cart
|
|
513
|
+
|
|
514
|
+
```
|
|
515
|
+
$data = [
|
|
516
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
517
|
+
];
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
521
|
+
|
|
522
|
+
**Usage:**
|
|
523
|
+
|
|
524
|
+
```
|
|
525
|
+
add_action('fluent_cart/before_checkout_page_start', function ($data) {
|
|
526
|
+
$cart = $data['cart'];
|
|
527
|
+
echo '<div class="my-checkout-banner">';
|
|
528
|
+
echo '<p>Free shipping on orders over $50!</p>';
|
|
529
|
+
echo '</div>';
|
|
530
|
+
}, 10, 1);
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
### ` after_checkout_page_start `
|
|
534
|
+
|
|
535
|
+
`fluent_cart/after_checkout_page_start` — After the checkout page wrapper div opens
|
|
536
|
+
|
|
537
|
+
**When it runs:** This action fires right after the main checkout page `` wrapper opens, before any checkout content is rendered.
|
|
538
|
+
|
|
539
|
+
**Parameters:**
|
|
540
|
+
|
|
541
|
+
- `$data` (array): The current cart
|
|
542
|
+
|
|
543
|
+
```
|
|
544
|
+
$data = [
|
|
545
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
546
|
+
];
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php:154`
|
|
550
|
+
|
|
551
|
+
**Usage:**
|
|
552
|
+
|
|
553
|
+
```
|
|
554
|
+
add_action('fluent_cart/after_checkout_page_start', function ($data) {
|
|
555
|
+
$cart = $data['cart'];
|
|
556
|
+
echo '<div class="my-checkout-progress-bar">Step 1 of 3: Checkout</div>';
|
|
557
|
+
}, 10, 1);
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
### ` before_checkout_form `
|
|
561
|
+
|
|
562
|
+
`fluent_cart/before_checkout_form` — Before the checkout form element
|
|
563
|
+
|
|
564
|
+
**When it runs:** This action fires just before the `` tag for the checkout form is rendered.
|
|
565
|
+
|
|
566
|
+
**Parameters:**
|
|
567
|
+
|
|
568
|
+
- `$data` (array): The current cart
|
|
569
|
+
|
|
570
|
+
```
|
|
571
|
+
$data = [
|
|
572
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
573
|
+
];
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
577
|
+
|
|
578
|
+
**Usage:**
|
|
579
|
+
|
|
580
|
+
```
|
|
581
|
+
add_action('fluent_cart/before_checkout_form', function ($data) {
|
|
582
|
+
echo '<div class="my-trust-badges">';
|
|
583
|
+
echo '<img src="/wp-content/uploads/secure-checkout.svg" alt="Secure Checkout" />';
|
|
584
|
+
echo '</div>';
|
|
585
|
+
}, 10, 1);
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
### ` checkout_form_opening `
|
|
589
|
+
|
|
590
|
+
`fluent_cart/checkout_form_opening` — Right after the checkout form tag opens
|
|
591
|
+
|
|
592
|
+
**When it runs:** This action fires immediately after the `` tag opens, before any form fields are rendered. Use it to insert hidden fields, nonce fields, or other elements that must be inside the form.
|
|
593
|
+
|
|
594
|
+
**Parameters:**
|
|
595
|
+
|
|
596
|
+
- `$data` (array): The current cart
|
|
597
|
+
|
|
598
|
+
```
|
|
599
|
+
$data = [
|
|
600
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
601
|
+
];
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
605
|
+
|
|
606
|
+
**Usage:**
|
|
607
|
+
|
|
608
|
+
```
|
|
609
|
+
add_action('fluent_cart/checkout_form_opening', function ($data) {
|
|
610
|
+
// Add a hidden field for tracking
|
|
611
|
+
echo '<input type="hidden" name="my_tracking_ref" value="' . esc_attr(my_get_tracking_ref()) . '" />';
|
|
612
|
+
}, 10, 1);
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
### ` before_billing_fields `
|
|
616
|
+
|
|
617
|
+
`fluent_cart/before_billing_fields` — Before billing address fields
|
|
618
|
+
|
|
619
|
+
**When it runs:** This action fires after the name/email fields and the "create account" checkbox, but before the billing address fields section is rendered.
|
|
620
|
+
|
|
621
|
+
**Parameters:**
|
|
622
|
+
|
|
623
|
+
- `$data` (array): The current cart
|
|
624
|
+
|
|
625
|
+
```
|
|
626
|
+
$data = [
|
|
627
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
628
|
+
];
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
632
|
+
|
|
633
|
+
**Usage:**
|
|
634
|
+
|
|
635
|
+
```
|
|
636
|
+
add_action('fluent_cart/before_billing_fields', function ($data) {
|
|
637
|
+
echo '<p class="my-billing-note">Please enter your billing address exactly as it appears on your card statement.</p>';
|
|
638
|
+
}, 10, 1);
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
### ` before_billing_fields_section `
|
|
642
|
+
|
|
643
|
+
`fluent_cart/before_billing_fields_section` — Before the billing address field section renders
|
|
644
|
+
|
|
645
|
+
**When it runs:** This action fires right before the billing address form section (with its heading and input fields) is rendered. It fires inside the `renderBillingAddressFields()` method, after billing field data has been prepared and filtered.
|
|
646
|
+
|
|
647
|
+
**Parameters:**
|
|
648
|
+
|
|
649
|
+
- `$data` (array): The current cart
|
|
650
|
+
|
|
651
|
+
```
|
|
652
|
+
$data = [
|
|
653
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
654
|
+
];
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
658
|
+
|
|
659
|
+
**Usage:**
|
|
660
|
+
|
|
661
|
+
```
|
|
662
|
+
add_action('fluent_cart/before_billing_fields_section', function ($data) {
|
|
663
|
+
echo '<div class="my-billing-section-intro">';
|
|
664
|
+
echo '<h4>Where should we send the invoice?</h4>';
|
|
665
|
+
echo '</div>';
|
|
666
|
+
}, 10, 1);
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
### ` after_billing_fields_section `
|
|
670
|
+
|
|
671
|
+
`fluent_cart/after_billing_fields_section` — After the billing address field section
|
|
672
|
+
|
|
673
|
+
**When it runs:** This action fires after the billing address fields section and the "ship to different address" checkbox have been rendered. It only fires when the cart requires shipping.
|
|
674
|
+
|
|
675
|
+
**Parameters:**
|
|
676
|
+
|
|
677
|
+
- `$data` (array): The current cart
|
|
678
|
+
|
|
679
|
+
```
|
|
680
|
+
$data = [
|
|
681
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
682
|
+
];
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
686
|
+
|
|
687
|
+
**Usage:**
|
|
688
|
+
|
|
689
|
+
```
|
|
690
|
+
add_action('fluent_cart/after_billing_fields_section', function ($data) {
|
|
691
|
+
$cart = $data['cart'];
|
|
692
|
+
// Add a note between billing and shipping sections
|
|
693
|
+
echo '<div class="my-address-note">';
|
|
694
|
+
echo '<p>Shipping is calculated based on your delivery address.</p>';
|
|
695
|
+
echo '</div>';
|
|
696
|
+
}, 10, 1);
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
### ` checkout/b2b_extra_fields `
|
|
700
|
+
|
|
701
|
+
`fluent_cart/checkout/b2b_extra_fields` — Inside the billing fields area, for custom B2B fields
|
|
702
|
+
|
|
703
|
+
**When it runs:** This action fires within the billing address fields section of the checkout form (`CheckoutRenderer::renderBillingAddressFields()`), after the standard billing fields. Use it to render extra business-oriented fields such as a company name, tax ID/VAT number, or purchase-order reference.
|
|
704
|
+
|
|
705
|
+
**Parameters:**
|
|
706
|
+
|
|
707
|
+
- `$data` (array): The current cart
|
|
708
|
+
|
|
709
|
+
```
|
|
710
|
+
$data = [
|
|
711
|
+
'cart' => $this->cart, // \FluentCart\App\Models\Cart instance
|
|
712
|
+
];
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php:419`
|
|
716
|
+
|
|
717
|
+
**Usage:**
|
|
718
|
+
|
|
719
|
+
```
|
|
720
|
+
add_action('fluent_cart/checkout/b2b_extra_fields', function ($data) {
|
|
721
|
+
echo '<div class="fct-field-wrap">';
|
|
722
|
+
echo '<label for="company_vat_number">VAT Number</label>';
|
|
723
|
+
echo '<input type="text" id="company_vat_number" name="company_vat_number" />';
|
|
724
|
+
echo '</div>';
|
|
725
|
+
}, 10, 1);
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
### ` before_shipping_fields_section `
|
|
729
|
+
|
|
730
|
+
`fluent_cart/before_shipping_fields_section` — Before the shipping address field section
|
|
731
|
+
|
|
732
|
+
**When it runs:** This action fires right before the shipping address form section is rendered. The shipping section may be hidden via CSS if "ship to different address" is not checked.
|
|
733
|
+
|
|
734
|
+
**Parameters:**
|
|
735
|
+
|
|
736
|
+
- `$data` (array): The current cart
|
|
737
|
+
|
|
738
|
+
```
|
|
739
|
+
$data = [
|
|
740
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
741
|
+
];
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
745
|
+
|
|
746
|
+
**Usage:**
|
|
747
|
+
|
|
748
|
+
```
|
|
749
|
+
add_action('fluent_cart/before_shipping_fields_section', function ($data) {
|
|
750
|
+
echo '<p class="my-shipping-note">Enter the address where you want us to deliver your order.</p>';
|
|
751
|
+
}, 10, 1);
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
### ` after_shipping_fields_section `
|
|
755
|
+
|
|
756
|
+
`fluent_cart/after_shipping_fields_section` — After the shipping address field section
|
|
757
|
+
|
|
758
|
+
**When it runs:** This action fires immediately after the shipping address form section is rendered.
|
|
759
|
+
|
|
760
|
+
**Parameters:**
|
|
761
|
+
|
|
762
|
+
- `$data` (array): The current cart
|
|
763
|
+
|
|
764
|
+
```
|
|
765
|
+
$data = [
|
|
766
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
767
|
+
];
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
771
|
+
|
|
772
|
+
**Usage:**
|
|
773
|
+
|
|
774
|
+
```
|
|
775
|
+
add_action('fluent_cart/after_shipping_fields_section', function ($data) {
|
|
776
|
+
echo '<div class="my-delivery-estimate">';
|
|
777
|
+
echo '<p>Estimated delivery: 3-5 business days</p>';
|
|
778
|
+
echo '</div>';
|
|
779
|
+
}, 10, 1);
|
|
780
|
+
```
|
|
781
|
+
|
|
782
|
+
### ` before_payment_methods `
|
|
783
|
+
|
|
784
|
+
`fluent_cart/before_payment_methods` — Before payment method options
|
|
785
|
+
|
|
786
|
+
**When it runs:** This action fires before the payment methods section is rendered on the checkout page. It also fires in the modal checkout renderer and the Gutenberg block inner blocks renderer.
|
|
787
|
+
|
|
788
|
+
**Parameters:**
|
|
789
|
+
|
|
790
|
+
- `$data` (array): The current cart
|
|
791
|
+
|
|
792
|
+
```
|
|
793
|
+
$data = [
|
|
794
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
795
|
+
];
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`, `app/Services/Renderer/ModalCheckoutRenderer.php`, `app/Hooks/Handlers/BlockEditors/Checkout/InnerBlocks/InnerBlocks.php`
|
|
799
|
+
|
|
800
|
+
**Usage:**
|
|
801
|
+
|
|
802
|
+
```
|
|
803
|
+
add_action('fluent_cart/before_payment_methods', function ($data) {
|
|
804
|
+
echo '<div class="my-payment-security-note">';
|
|
805
|
+
echo '<p>All transactions are encrypted and secure.</p>';
|
|
806
|
+
echo '</div>';
|
|
807
|
+
}, 10, 1);
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
### ` after_payment_methods `
|
|
811
|
+
|
|
812
|
+
`fluent_cart/after_payment_methods` — After payment method options
|
|
813
|
+
|
|
814
|
+
**When it runs:** This action fires after the payment methods section has been rendered, before the checkout submit button.
|
|
815
|
+
|
|
816
|
+
**Parameters:**
|
|
817
|
+
|
|
818
|
+
- `$data` (array): The current cart
|
|
819
|
+
|
|
820
|
+
```
|
|
821
|
+
$data = [
|
|
822
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
823
|
+
];
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
827
|
+
|
|
828
|
+
**Usage:**
|
|
829
|
+
|
|
830
|
+
```
|
|
831
|
+
add_action('fluent_cart/after_payment_methods', function ($data) {
|
|
832
|
+
echo '<div class="my-payment-icons">';
|
|
833
|
+
echo '<img src="/wp-content/uploads/visa.svg" alt="Visa" />';
|
|
834
|
+
echo '<img src="/wp-content/uploads/mastercard.svg" alt="Mastercard" />';
|
|
835
|
+
echo '</div>';
|
|
836
|
+
}, 10, 1);
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
### ` checkout_embed_payment_method_content `
|
|
840
|
+
|
|
841
|
+
`fluent_cart/checkout_embed_payment_method_content` — Inside each embedded payment method's container div
|
|
842
|
+
|
|
843
|
+
**When it runs:** This action fires inside the per-method `fluent-cart-checkout_embed_payment_container_{route}` wrapper `` for each registered payment method on the checkout page (and the equivalent container in the modal checkout renderer). The container itself starts `aria-hidden="true"` and is revealed by JS when that method is selected. Use it to render gateway-specific embedded fields (e.g. a card element mount point).
|
|
844
|
+
|
|
845
|
+
**Parameters:**
|
|
846
|
+
|
|
847
|
+
- `$data` (array): Payment method render context
|
|
848
|
+
|
|
849
|
+
```
|
|
850
|
+
$data = [
|
|
851
|
+
'method' => $method, // \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway instance
|
|
852
|
+
'cart' => $this->cart, // \FluentCart\App\Models\Cart instance
|
|
853
|
+
'route' => $route, // string — the gateway's route/slug (e.g. 'stripe', 'paypal')
|
|
854
|
+
];
|
|
855
|
+
```
|
|
856
|
+
|
|
857
|
+
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:819` (modal checkout) and `app/Services/Renderer/CheckoutRenderer.php:944` (full checkout page)
|
|
858
|
+
|
|
859
|
+
**Usage:**
|
|
860
|
+
|
|
861
|
+
```
|
|
862
|
+
add_action('fluent_cart/checkout_embed_payment_method_content', function ($data) {
|
|
863
|
+
if ($data['route'] !== 'my_gateway') {
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
echo '<div id="my-gateway-card-element"></div>';
|
|
867
|
+
}, 10, 1);
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
### ` after_checkout_button `
|
|
871
|
+
|
|
872
|
+
`fluent_cart/after_checkout_button` — After the checkout submit button
|
|
873
|
+
|
|
874
|
+
**When it runs:** This action fires immediately after the "Place order" submit button is rendered.
|
|
875
|
+
|
|
876
|
+
**Parameters:**
|
|
877
|
+
|
|
878
|
+
- `$data` (array): The current cart
|
|
879
|
+
|
|
880
|
+
```
|
|
881
|
+
$data = [
|
|
882
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
883
|
+
];
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
887
|
+
|
|
888
|
+
**Usage:**
|
|
889
|
+
|
|
890
|
+
```
|
|
891
|
+
add_action('fluent_cart/after_checkout_button', function ($data) {
|
|
892
|
+
echo '<p class="my-checkout-disclaimer">';
|
|
893
|
+
echo 'By placing your order you agree to our <a href="/terms">Terms of Service</a>.';
|
|
894
|
+
echo '</p>';
|
|
895
|
+
}, 10, 1);
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
### ` after_order_notes `
|
|
899
|
+
|
|
900
|
+
`fluent_cart/after_order_notes` — After the order notes section in the summary sidebar
|
|
901
|
+
|
|
902
|
+
**When it runs:** This action fires after the order notes field in the checkout summary/sidebar section, inside the order summary wrapper.
|
|
903
|
+
|
|
904
|
+
**Parameters:**
|
|
905
|
+
|
|
906
|
+
- `$data` (array): The current cart
|
|
907
|
+
|
|
908
|
+
```
|
|
909
|
+
$data = [
|
|
910
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
911
|
+
];
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
915
|
+
|
|
916
|
+
**Usage:**
|
|
917
|
+
|
|
918
|
+
```
|
|
919
|
+
add_action('fluent_cart/after_order_notes', function ($data) {
|
|
920
|
+
echo '<div class="my-gift-wrap-option">';
|
|
921
|
+
echo '<label><input type="checkbox" name="gift_wrap" value="yes" /> Add gift wrapping (+$5.00)</label>';
|
|
922
|
+
echo '</div>';
|
|
923
|
+
}, 10, 1);
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
### ` after_order_notes_field `
|
|
927
|
+
|
|
928
|
+
`fluent_cart/after_order_notes_field` — After the order notes form field
|
|
929
|
+
|
|
930
|
+
**When it runs:** This action fires right after the order notes textarea field is rendered, inside the `renderOrderNoteField()` method. Note that the order notes field only appears when the cart requires shipping (unless overridden by the `fluent_cart/disable_order_notes_for_digital_products` filter).
|
|
931
|
+
|
|
932
|
+
**Parameters:**
|
|
933
|
+
|
|
934
|
+
- `$data` (array): The current cart
|
|
935
|
+
|
|
936
|
+
```
|
|
937
|
+
$data = [
|
|
938
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
939
|
+
];
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
943
|
+
|
|
944
|
+
**Usage:**
|
|
945
|
+
|
|
946
|
+
```
|
|
947
|
+
add_action('fluent_cart/after_order_notes_field', function ($data) {
|
|
948
|
+
echo '<p class="my-notes-hint"><em>Example: Leave package at the back door.</em></p>';
|
|
949
|
+
}, 10, 1);
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
### ` after_checkout_form `
|
|
953
|
+
|
|
954
|
+
`fluent_cart/after_checkout_form` — After the checkout form closes
|
|
955
|
+
|
|
956
|
+
**When it runs:** This action fires immediately after the closing `` tag of the checkout form.
|
|
957
|
+
|
|
958
|
+
**Parameters:**
|
|
959
|
+
|
|
960
|
+
- `$data` (array): The current cart
|
|
961
|
+
|
|
962
|
+
```
|
|
963
|
+
$data = [
|
|
964
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
965
|
+
];
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
969
|
+
|
|
970
|
+
**Usage:**
|
|
971
|
+
|
|
972
|
+
```
|
|
973
|
+
add_action('fluent_cart/after_checkout_form', function ($data) {
|
|
974
|
+
// Render a support chat widget below the form
|
|
975
|
+
echo '<div class="my-checkout-support">';
|
|
976
|
+
echo '<p>Need help? <a href="#" onclick="openChat()">Chat with us</a></p>';
|
|
977
|
+
echo '</div>';
|
|
978
|
+
}, 10, 1);
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
### ` before_checkout_page_close `
|
|
982
|
+
|
|
983
|
+
`fluent_cart/before_checkout_page_close` — Before the checkout page wrapper div closes
|
|
984
|
+
|
|
985
|
+
**When it runs:** This action fires just before the closing `` of the main checkout page wrapper.
|
|
986
|
+
|
|
987
|
+
**Parameters:**
|
|
988
|
+
|
|
989
|
+
- `$data` (array): The current cart
|
|
990
|
+
|
|
991
|
+
```
|
|
992
|
+
$data = [
|
|
993
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
994
|
+
];
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
998
|
+
|
|
999
|
+
**Usage:**
|
|
1000
|
+
|
|
1001
|
+
```
|
|
1002
|
+
add_action('fluent_cart/before_checkout_page_close', function ($data) {
|
|
1003
|
+
echo '<div class="my-checkout-footer-badges">';
|
|
1004
|
+
echo '<p>30-day money-back guarantee</p>';
|
|
1005
|
+
echo '</div>';
|
|
1006
|
+
}, 10, 1);
|
|
1007
|
+
```
|
|
1008
|
+
|
|
1009
|
+
### ` after_checkout_page `
|
|
1010
|
+
|
|
1011
|
+
`fluent_cart/after_checkout_page` — After the entire checkout page wrapper
|
|
1012
|
+
|
|
1013
|
+
**When it runs:** This action fires after the checkout page wrapper `` has been closed. Use it for scripts, tracking pixels, or other content that should appear after the entire checkout page.
|
|
1014
|
+
|
|
1015
|
+
**Parameters:**
|
|
1016
|
+
|
|
1017
|
+
- `$data` (array): The current cart
|
|
1018
|
+
|
|
1019
|
+
```
|
|
1020
|
+
$data = [
|
|
1021
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
1022
|
+
];
|
|
1023
|
+
```
|
|
1024
|
+
|
|
1025
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php`
|
|
1026
|
+
|
|
1027
|
+
**Usage:**
|
|
1028
|
+
|
|
1029
|
+
```
|
|
1030
|
+
add_action('fluent_cart/after_checkout_page', function ($data) {
|
|
1031
|
+
$cart = $data['cart'];
|
|
1032
|
+
// Output a tracking script after the checkout page
|
|
1033
|
+
echo '<script>myAnalytics.trackCheckoutView({ cartId: ' . intval($cart->id) . ' });</script>';
|
|
1034
|
+
}, 10, 1);
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
### ` before_summary_total `
|
|
1038
|
+
|
|
1039
|
+
`fluent_cart/checkout/before_summary_total` — Before the total line in the cart summary
|
|
1040
|
+
|
|
1041
|
+
**When it runs:** This action fires in the cart summary sidebar, after the subtotal, shipping, and discount lines but before the coupon input field and the final total line.
|
|
1042
|
+
|
|
1043
|
+
**Parameters:**
|
|
1044
|
+
|
|
1045
|
+
- `$data` (array): The current cart
|
|
1046
|
+
|
|
1047
|
+
```
|
|
1048
|
+
$data = [
|
|
1049
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart instance
|
|
1050
|
+
];
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
**Source:** `app/Services/Renderer/CartSummaryRender.php`
|
|
1054
|
+
|
|
1055
|
+
**Usage:**
|
|
1056
|
+
|
|
1057
|
+
```
|
|
1058
|
+
add_action('fluent_cart/checkout/before_summary_total', function ($data) {
|
|
1059
|
+
$cart = $data['cart'];
|
|
1060
|
+
// Add a custom fee line in the summary
|
|
1061
|
+
echo '<li class="my-custom-fee">';
|
|
1062
|
+
echo '<span class="fct_summary_label">Processing Fee</span>';
|
|
1063
|
+
echo '<span class="fct_summary_value">$2.50</span>';
|
|
1064
|
+
echo '</li>';
|
|
1065
|
+
}, 10, 1);
|
|
1066
|
+
```
|
|
1067
|
+
|
|
1068
|
+
---
|
|
1069
|
+
|
|
1070
|
+
## Cart Line Items Rendering
|
|
1071
|
+
|
|
1072
|
+
These hooks fire during the rendering of individual cart line items on the checkout page. They all receive the same parameter structure from `CartItemRenderer::getEventInfo()`, which includes [Cart](/database/models/cart.md), [Product](/database/models/product.md), and [ProductVariation](/database/models/product-variation.md) model instances. Use **echo** to output custom HTML.
|
|
1073
|
+
|
|
1074
|
+
---
|
|
1075
|
+
|
|
1076
|
+
### ` line_meta `
|
|
1077
|
+
|
|
1078
|
+
`fluent_cart/cart/line_item/line_meta` — After line item content, for custom metadata
|
|
1079
|
+
|
|
1080
|
+
**When it runs:** This action fires after the main item content (title, variant info, child variants) inside the item info area, but before the price section. Use it to display custom per-item metadata such as personalization details or custom options.
|
|
1081
|
+
|
|
1082
|
+
**Parameters:**
|
|
1083
|
+
|
|
1084
|
+
- `$data` (array): Line item rendering context
|
|
1085
|
+
|
|
1086
|
+
```
|
|
1087
|
+
$data = [
|
|
1088
|
+
'item' => $item, // array — the cart item data (post_id, title, quantity, unit_price, etc.)
|
|
1089
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1090
|
+
'product' => $product, // Product model or null
|
|
1091
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1092
|
+
];
|
|
1093
|
+
```
|
|
1094
|
+
|
|
1095
|
+
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1096
|
+
|
|
1097
|
+
**Usage:**
|
|
1098
|
+
|
|
1099
|
+
```
|
|
1100
|
+
add_action('fluent_cart/cart/line_item/line_meta', function ($data) {
|
|
1101
|
+
$item = $data['item'];
|
|
1102
|
+
|
|
1103
|
+
// Display custom engraving text if present
|
|
1104
|
+
$engraving = $item['custom_fields']['engraving'] ?? '';
|
|
1105
|
+
if ($engraving) {
|
|
1106
|
+
echo '<div class="my-engraving-preview">';
|
|
1107
|
+
echo '<small>Engraving: ' . esc_html($engraving) . '</small>';
|
|
1108
|
+
echo '</div>';
|
|
1109
|
+
}
|
|
1110
|
+
}, 10, 1);
|
|
1111
|
+
```
|
|
1112
|
+
|
|
1113
|
+
### ` before_total `
|
|
1114
|
+
|
|
1115
|
+
`fluent_cart/cart/line_item/before_total` — Before the line item price/total
|
|
1116
|
+
|
|
1117
|
+
**When it runs:** This action fires inside the price area of a cart line item, before the item total (and any promotional strikethrough price) is displayed.
|
|
1118
|
+
|
|
1119
|
+
**Parameters:**
|
|
1120
|
+
|
|
1121
|
+
- `$data` (array): Line item rendering context
|
|
1122
|
+
|
|
1123
|
+
```
|
|
1124
|
+
$data = [
|
|
1125
|
+
'item' => $item, // array — the cart item data
|
|
1126
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1127
|
+
'product' => $product, // Product model or null
|
|
1128
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1129
|
+
];
|
|
1130
|
+
```
|
|
1131
|
+
|
|
1132
|
+
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1133
|
+
|
|
1134
|
+
**Usage:**
|
|
1135
|
+
|
|
1136
|
+
```
|
|
1137
|
+
add_action('fluent_cart/cart/line_item/before_total', function ($data) {
|
|
1138
|
+
$item = $data['item'];
|
|
1139
|
+
$savings = ($item['other_info']['original_price'] ?? 0) - ($item['unit_price'] ?? 0);
|
|
1140
|
+
if ($savings > 0) {
|
|
1141
|
+
echo '<span class="my-savings-badge">You save ' . esc_html(\FluentCart\App\Helpers\Helper::toDecimal($savings)) . '</span>';
|
|
1142
|
+
}
|
|
1143
|
+
}, 10, 1);
|
|
1144
|
+
```
|
|
1145
|
+
|
|
1146
|
+
### ` after_total `
|
|
1147
|
+
|
|
1148
|
+
`fluent_cart/cart/line_item/after_total` — After the line item price/total
|
|
1149
|
+
|
|
1150
|
+
**When it runs:** This action fires inside the price area of a cart line item, after the item total is displayed.
|
|
1151
|
+
|
|
1152
|
+
**Parameters:**
|
|
1153
|
+
|
|
1154
|
+
- `$data` (array): Line item rendering context
|
|
1155
|
+
|
|
1156
|
+
```
|
|
1157
|
+
$data = [
|
|
1158
|
+
'item' => $item, // array — the cart item data
|
|
1159
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1160
|
+
'product' => $product, // Product model or null
|
|
1161
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1162
|
+
];
|
|
1163
|
+
```
|
|
1164
|
+
|
|
1165
|
+
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1166
|
+
|
|
1167
|
+
**Usage:**
|
|
1168
|
+
|
|
1169
|
+
```
|
|
1170
|
+
add_action('fluent_cart/cart/line_item/after_total', function ($data) {
|
|
1171
|
+
$item = $data['item'];
|
|
1172
|
+
$paymentType = $item['other_info']['payment_type'] ?? '';
|
|
1173
|
+
if ($paymentType === 'subscription') {
|
|
1174
|
+
echo '<span class="my-recurring-label"><small>Recurring</small></span>';
|
|
1175
|
+
}
|
|
1176
|
+
}, 10, 1);
|
|
1177
|
+
```
|
|
1178
|
+
|
|
1179
|
+
### ` before_main_title `
|
|
1180
|
+
|
|
1181
|
+
`fluent_cart/cart/line_item/before_main_title` — Before the product title in a line item
|
|
1182
|
+
|
|
1183
|
+
**When it runs:** This action fires at the very beginning of the item title area, before the quantity badge, product name, and variant title.
|
|
1184
|
+
|
|
1185
|
+
**Parameters:**
|
|
1186
|
+
|
|
1187
|
+
- `$data` (array): Line item rendering context
|
|
1188
|
+
|
|
1189
|
+
```
|
|
1190
|
+
$data = [
|
|
1191
|
+
'item' => $item, // array — the cart item data
|
|
1192
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1193
|
+
'product' => $product, // Product model or null
|
|
1194
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1195
|
+
];
|
|
1196
|
+
```
|
|
1197
|
+
|
|
1198
|
+
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1199
|
+
|
|
1200
|
+
**Usage:**
|
|
1201
|
+
|
|
1202
|
+
```
|
|
1203
|
+
add_action('fluent_cart/cart/line_item/before_main_title', function ($data) {
|
|
1204
|
+
$item = $data['item'];
|
|
1205
|
+
// Add a "Sale" badge before the product title
|
|
1206
|
+
if (!empty($item['other_info']['is_on_sale'])) {
|
|
1207
|
+
echo '<span class="my-sale-badge">Sale</span>';
|
|
1208
|
+
}
|
|
1209
|
+
}, 10, 1);
|
|
1210
|
+
```
|
|
1211
|
+
|
|
1212
|
+
### ` after_main_title `
|
|
1213
|
+
|
|
1214
|
+
`fluent_cart/cart/line_item/after_main_title` — After the product title in a line item
|
|
1215
|
+
|
|
1216
|
+
**When it runs:** This action fires at the end of the item title area, after the product name, variant title, and payment type information (subscription details / per-unit price).
|
|
1217
|
+
|
|
1218
|
+
**Parameters:**
|
|
1219
|
+
|
|
1220
|
+
- `$data` (array): Line item rendering context
|
|
1221
|
+
|
|
1222
|
+
```
|
|
1223
|
+
$data = [
|
|
1224
|
+
'item' => $item, // array — the cart item data
|
|
1225
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1226
|
+
'product' => $product, // Product model or null
|
|
1227
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1228
|
+
];
|
|
1229
|
+
```
|
|
1230
|
+
|
|
1231
|
+
**Source:** `app/Services/Renderer/CartItemRenderer.php`
|
|
1232
|
+
|
|
1233
|
+
**Usage:**
|
|
1234
|
+
|
|
1235
|
+
```
|
|
1236
|
+
add_action('fluent_cart/cart/line_item/after_main_title', function ($data) {
|
|
1237
|
+
$item = $data['item'];
|
|
1238
|
+
// Show estimated delivery date per item
|
|
1239
|
+
$deliveryDays = $item['other_info']['delivery_days'] ?? null;
|
|
1240
|
+
if ($deliveryDays) {
|
|
1241
|
+
$date = date('M j', strtotime("+{$deliveryDays} days"));
|
|
1242
|
+
echo '<div class="my-delivery-estimate"><small>Est. delivery: ' . esc_html($date) . '</small></div>';
|
|
1243
|
+
}
|
|
1244
|
+
}, 10, 1);
|
|
1245
|
+
```
|
|
1246
|
+
|
|
1247
|
+
### ` footer_start `
|
|
1248
|
+
|
|
1249
|
+
`fluent_cart/cart/line_item/footer_start` — Start of the line item footer area
|
|
1250
|
+
|
|
1251
|
+
**When it runs:** This action fires at the beginning of the `.fct_line_item_footer` area of a cart line item, before the payment-type info, setup-fee info, and any license activation-limit details. Fires in both the modal checkout renderer and the full checkout page renderer.
|
|
1252
|
+
|
|
1253
|
+
**Parameters:**
|
|
1254
|
+
|
|
1255
|
+
- `$data` (array): Line item rendering context (from `CartItemRenderer::getEventInfo()` / the modal renderer's equivalent)
|
|
1256
|
+
|
|
1257
|
+
```
|
|
1258
|
+
$data = [
|
|
1259
|
+
'item' => $item, // array — the cart item data
|
|
1260
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1261
|
+
'product' => $product, // Product model or null
|
|
1262
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1263
|
+
];
|
|
1264
|
+
```
|
|
1265
|
+
|
|
1266
|
+
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:326` (modal checkout) and `app/Services/Renderer/CartItemRenderer.php:92` (full checkout page)
|
|
1267
|
+
|
|
1268
|
+
**Usage:**
|
|
1269
|
+
|
|
1270
|
+
```
|
|
1271
|
+
add_action('fluent_cart/cart/line_item/footer_start', function ($data) {
|
|
1272
|
+
$item = $data['item'];
|
|
1273
|
+
if (!empty($item['other_info']['gift_wrapped'])) {
|
|
1274
|
+
echo '<span class="my-gift-wrap-icon">🎁 Gift wrapped</span>';
|
|
1275
|
+
}
|
|
1276
|
+
}, 10, 1);
|
|
1277
|
+
```
|
|
1278
|
+
|
|
1279
|
+
### ` unit_price_hint `
|
|
1280
|
+
|
|
1281
|
+
`fluent_cart/cart/line_item/unit_price_hint` — After the "$X each" unit price text
|
|
1282
|
+
|
|
1283
|
+
**When it runs:** This action fires right after the per-unit price hint (e.g. "$10.00 each") is printed for a line item, inside both the modal checkout renderer and the full checkout page's cart item renderer.
|
|
1284
|
+
|
|
1285
|
+
**Parameters:**
|
|
1286
|
+
|
|
1287
|
+
- `$data` (array): Line item rendering context
|
|
1288
|
+
|
|
1289
|
+
```
|
|
1290
|
+
$data = [
|
|
1291
|
+
'item' => $item, // array — the cart item data
|
|
1292
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1293
|
+
'product' => $product, // Product model or null
|
|
1294
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1295
|
+
];
|
|
1296
|
+
```
|
|
1297
|
+
|
|
1298
|
+
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:404` (modal checkout) and `app/Services/Renderer/CartItemRenderer.php:221` (full checkout page)
|
|
1299
|
+
|
|
1300
|
+
**Usage:**
|
|
1301
|
+
|
|
1302
|
+
```
|
|
1303
|
+
add_action('fluent_cart/cart/line_item/unit_price_hint', function ($data) {
|
|
1304
|
+
echo '<small class="my-price-note">(tax excl.)</small>';
|
|
1305
|
+
}, 10, 1);
|
|
1306
|
+
```
|
|
1307
|
+
|
|
1308
|
+
### ` setup_fee_price_info `
|
|
1309
|
+
|
|
1310
|
+
`fluent_cart/cart/line_item/setup_fee_price_info` — After a line item's setup fee amount
|
|
1311
|
+
|
|
1312
|
+
**When it runs:** This action fires inside `maybeRenderSetupFeeInfo()`, right after the setup-fee amount is printed for a subscription line item that has one. Only reachable for items with `other_info.payment_type === 'subscription'` and a non-zero setup fee.
|
|
1313
|
+
|
|
1314
|
+
**Parameters:**
|
|
1315
|
+
|
|
1316
|
+
- `$data` (array): Line item rendering context
|
|
1317
|
+
|
|
1318
|
+
```
|
|
1319
|
+
$data = [
|
|
1320
|
+
'item' => $item, // array — the cart item data
|
|
1321
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1322
|
+
'product' => $product, // Product model or null
|
|
1323
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1324
|
+
];
|
|
1325
|
+
```
|
|
1326
|
+
|
|
1327
|
+
**Source:** `app/Services/Renderer/CartItemRenderer.php:255`
|
|
1328
|
+
|
|
1329
|
+
**Usage:**
|
|
1330
|
+
|
|
1331
|
+
```
|
|
1332
|
+
add_action('fluent_cart/cart/line_item/setup_fee_price_info', function ($data) {
|
|
1333
|
+
echo '<span class="my-setup-fee-note">(one-time)</span>';
|
|
1334
|
+
}, 10, 1);
|
|
1335
|
+
```
|
|
1336
|
+
|
|
1337
|
+
### ` after_setup_fee_info `
|
|
1338
|
+
|
|
1339
|
+
`fluent_cart/cart/line_item/after_setup_fee_info` — After the entire setup fee block
|
|
1340
|
+
|
|
1341
|
+
**When it runs:** This action fires immediately after `renderSetupFeeInfo()` completes for a line item — i.e. after the whole setup-fee row (label + amount) has been printed, not just the amount. Only fires when the item actually has a setup fee.
|
|
1342
|
+
|
|
1343
|
+
**Parameters:**
|
|
1344
|
+
|
|
1345
|
+
- `$data` (array): Line item rendering context
|
|
1346
|
+
|
|
1347
|
+
```
|
|
1348
|
+
$data = [
|
|
1349
|
+
'item' => $item, // array — the cart item data
|
|
1350
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1351
|
+
'product' => $product, // Product model or null
|
|
1352
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1353
|
+
];
|
|
1354
|
+
```
|
|
1355
|
+
|
|
1356
|
+
**Source:** `app/Services/Renderer/CartItemRenderer.php:97`
|
|
1357
|
+
|
|
1358
|
+
**Usage:**
|
|
1359
|
+
|
|
1360
|
+
```
|
|
1361
|
+
add_action('fluent_cart/cart/line_item/after_setup_fee_info', function ($data) {
|
|
1362
|
+
echo '<div class="my-setup-fee-disclaimer"><small>Setup fee charged once at signup.</small></div>';
|
|
1363
|
+
}, 10, 1);
|
|
1364
|
+
```
|
|
1365
|
+
|
|
1366
|
+
### ` footer_end `
|
|
1367
|
+
|
|
1368
|
+
`fluent_cart/cart/line_item/footer_end` — End of the line item footer area
|
|
1369
|
+
|
|
1370
|
+
**When it runs:** This action fires at the very end of the `.fct_line_item_footer` area, after the setup-fee block (if any) and after `fluent_cart/cart/line_item/after_setup_fee_info`. It is the last hook in a cart line item's footer.
|
|
1371
|
+
|
|
1372
|
+
**Parameters:**
|
|
1373
|
+
|
|
1374
|
+
- `$data` (array): Line item rendering context
|
|
1375
|
+
|
|
1376
|
+
```
|
|
1377
|
+
$data = [
|
|
1378
|
+
'item' => $item, // array — the cart item data
|
|
1379
|
+
'cart' => $cart, // \FluentCart\App\Models\Cart|null instance
|
|
1380
|
+
'product' => $product, // Product model or null
|
|
1381
|
+
'variant' => $variant, // ProductVariation model or null
|
|
1382
|
+
];
|
|
1383
|
+
```
|
|
1384
|
+
|
|
1385
|
+
**Source:** `app/Services/Renderer/CartItemRenderer.php:99`
|
|
1386
|
+
|
|
1387
|
+
**Usage:**
|
|
1388
|
+
|
|
1389
|
+
```
|
|
1390
|
+
add_action('fluent_cart/cart/line_item/footer_end', function ($data) {
|
|
1391
|
+
$item = $data['item'];
|
|
1392
|
+
// Append a closing note after everything else in the item footer
|
|
1393
|
+
echo '<div class="my-line-item-footer-note"></div>';
|
|
1394
|
+
}, 10, 1);
|
|
1395
|
+
```
|
|
1396
|
+
|
|
1397
|
+
---
|
|
1398
|
+
|
|
1399
|
+
## Modal Checkout
|
|
1400
|
+
|
|
1401
|
+
Hooks specific to the modal (popup) checkout renderer, distinct from the full checkout page.
|
|
1402
|
+
|
|
1403
|
+
### ` modal_checkout/after_shipping_methods `
|
|
1404
|
+
|
|
1405
|
+
`fluent_cart/modal_checkout/after_shipping_methods` — After the shipping methods list in the modal checkout
|
|
1406
|
+
|
|
1407
|
+
**When it runs:** This action fires in the modal checkout renderer right after the shipping methods list is rendered. If the store is configured to place payment methods in the "details" section (via `fluent_cart/modal_checkout/before_payment_methods_placement`), the `fluent_cart/before_payment_methods` hook fires immediately after this one, at this same location.
|
|
1408
|
+
|
|
1409
|
+
**Parameters:**
|
|
1410
|
+
|
|
1411
|
+
- `$data` (array): The current cart
|
|
1412
|
+
|
|
1413
|
+
```
|
|
1414
|
+
$data = [
|
|
1415
|
+
'cart' => $this->cart, // \FluentCart\App\Models\Cart instance
|
|
1416
|
+
];
|
|
1417
|
+
```
|
|
1418
|
+
|
|
1419
|
+
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:253`
|
|
1420
|
+
|
|
1421
|
+
**Usage:**
|
|
1422
|
+
|
|
1423
|
+
```
|
|
1424
|
+
add_action('fluent_cart/modal_checkout/after_shipping_methods', function ($data) {
|
|
1425
|
+
echo '<p class="my-modal-shipping-note">Free shipping over $50!</p>';
|
|
1426
|
+
}, 10, 1);
|
|
1427
|
+
```
|
|
1428
|
+
|
|
1429
|
+
---
|
|
1430
|
+
|
|
1431
|
+
## Receipt / Thank You Page
|
|
1432
|
+
|
|
1433
|
+
These hooks fire during the rendering of the thank-you / receipt page shown after a successful checkout. The `$config` parameter passed to most hooks contains the [Order](/database/models/order.md) model instance along with view context. All rendering hooks use output buffering — use **echo** to inject custom HTML.
|
|
1434
|
+
|
|
1435
|
+
---
|
|
1436
|
+
|
|
1437
|
+
### ` before_header `
|
|
1438
|
+
|
|
1439
|
+
`fluent_cart/receipt/thank_you/before_header` — Before the thank-you page header
|
|
1440
|
+
|
|
1441
|
+
**When it runs:** This action fires at the very beginning of the thank-you page content, before the header section (which contains the success/pending icon and title).
|
|
1442
|
+
|
|
1443
|
+
**Parameters:**
|
|
1444
|
+
|
|
1445
|
+
- `$config` (array): Thank-you page configuration
|
|
1446
|
+
|
|
1447
|
+
```
|
|
1448
|
+
$config = [
|
|
1449
|
+
'order' => $order, // \FluentCart\App\Models\Order instance
|
|
1450
|
+
'is_first_time' => true|false, // bool — whether this is the first view of this receipt
|
|
1451
|
+
'order_operation' => $orderOperation, // mixed — order operation context or null
|
|
1452
|
+
];
|
|
1453
|
+
```
|
|
1454
|
+
|
|
1455
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1456
|
+
|
|
1457
|
+
**Usage:**
|
|
1458
|
+
|
|
1459
|
+
```
|
|
1460
|
+
add_action('fluent_cart/receipt/thank_you/before_header', function ($config) {
|
|
1461
|
+
$order = $config['order'];
|
|
1462
|
+
echo '<div class="my-confetti-wrapper" data-order-id="' . intval($order->id) . '"></div>';
|
|
1463
|
+
}, 10, 1);
|
|
1464
|
+
```
|
|
1465
|
+
|
|
1466
|
+
### ` after_header `
|
|
1467
|
+
|
|
1468
|
+
`fluent_cart/receipt/thank_you/after_header` — After the thank-you page header
|
|
1469
|
+
|
|
1470
|
+
**When it runs:** This action fires after the header section (the success/pending icon and title) is fully rendered, before the body section begins.
|
|
1471
|
+
|
|
1472
|
+
**Parameters:**
|
|
1473
|
+
|
|
1474
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1475
|
+
|
|
1476
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1477
|
+
|
|
1478
|
+
**Usage:**
|
|
1479
|
+
|
|
1480
|
+
```
|
|
1481
|
+
add_action('fluent_cart/receipt/thank_you/after_header', function ($config) {
|
|
1482
|
+
$order = $config['order'];
|
|
1483
|
+
if ($order->payment_status === 'paid') {
|
|
1484
|
+
echo '<div class="my-share-prompt">';
|
|
1485
|
+
echo '<p>Love your purchase? Share it with friends!</p>';
|
|
1486
|
+
echo '</div>';
|
|
1487
|
+
}
|
|
1488
|
+
}, 10, 1);
|
|
1489
|
+
```
|
|
1490
|
+
|
|
1491
|
+
### ` after_header_title `
|
|
1492
|
+
|
|
1493
|
+
`fluent_cart/receipt/thank_you/after_header_title` — After the header title text
|
|
1494
|
+
|
|
1495
|
+
**When it runs:** This action fires inside the header section, after the "Purchase Successful!" or "Payment Pending!" heading, but still within the header wrapper div. Use it to add a subtitle or additional context below the main title.
|
|
1496
|
+
|
|
1497
|
+
**Parameters:**
|
|
1498
|
+
|
|
1499
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1500
|
+
|
|
1501
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1502
|
+
|
|
1503
|
+
**Usage:**
|
|
1504
|
+
|
|
1505
|
+
```
|
|
1506
|
+
add_action('fluent_cart/receipt/thank_you/after_header_title', function ($config) {
|
|
1507
|
+
$order = $config['order'];
|
|
1508
|
+
echo '<p class="my-order-ref">Order Reference: #' . esc_html($order->invoice_no) . '</p>';
|
|
1509
|
+
}, 10, 1);
|
|
1510
|
+
```
|
|
1511
|
+
|
|
1512
|
+
### ` before_body `
|
|
1513
|
+
|
|
1514
|
+
`fluent_cart/receipt/thank_you/before_body` — Before the thank-you page body
|
|
1515
|
+
|
|
1516
|
+
**When it runs:** This action fires after the header section and before the body section, which contains the order details, items, subscriptions, downloads, licenses, and addresses.
|
|
1517
|
+
|
|
1518
|
+
**Parameters:**
|
|
1519
|
+
|
|
1520
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1521
|
+
|
|
1522
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1523
|
+
|
|
1524
|
+
**Usage:**
|
|
1525
|
+
|
|
1526
|
+
```
|
|
1527
|
+
add_action('fluent_cart/receipt/thank_you/before_body', function ($config) {
|
|
1528
|
+
echo '<div class="my-receipt-notice">';
|
|
1529
|
+
echo '<p>A confirmation email has been sent to your email address.</p>';
|
|
1530
|
+
echo '</div>';
|
|
1531
|
+
}, 10, 1);
|
|
1532
|
+
```
|
|
1533
|
+
|
|
1534
|
+
### ` after_body `
|
|
1535
|
+
|
|
1536
|
+
`fluent_cart/receipt/thank_you/after_body` — After the thank-you page body
|
|
1537
|
+
|
|
1538
|
+
**When it runs:** This action fires after the body section (order details, items, addresses) is fully rendered, before the page wrapper closes.
|
|
1539
|
+
|
|
1540
|
+
**Parameters:**
|
|
1541
|
+
|
|
1542
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1543
|
+
|
|
1544
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1545
|
+
|
|
1546
|
+
**Usage:**
|
|
1547
|
+
|
|
1548
|
+
```
|
|
1549
|
+
add_action('fluent_cart/receipt/thank_you/after_body', function ($config) {
|
|
1550
|
+
echo '<div class="my-upsell-section">';
|
|
1551
|
+
echo '<h3>You might also like</h3>';
|
|
1552
|
+
// Render recommended products
|
|
1553
|
+
echo '</div>';
|
|
1554
|
+
}, 10, 1);
|
|
1555
|
+
```
|
|
1556
|
+
|
|
1557
|
+
### ` before_order_header `
|
|
1558
|
+
|
|
1559
|
+
`fluent_cart/receipt/thank_you/before_order_header` — Before the order header in the receipt body
|
|
1560
|
+
|
|
1561
|
+
**When it runs:** This action fires inside the receipt body, before the order header area (which shows the customer greeting and order number).
|
|
1562
|
+
|
|
1563
|
+
**Parameters:**
|
|
1564
|
+
|
|
1565
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1566
|
+
|
|
1567
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1568
|
+
|
|
1569
|
+
**Usage:**
|
|
1570
|
+
|
|
1571
|
+
```
|
|
1572
|
+
add_action('fluent_cart/receipt/thank_you/before_order_header', function ($config) {
|
|
1573
|
+
echo '<div class="my-receipt-date">';
|
|
1574
|
+
echo '<p>Order placed on: ' . esc_html(date('F j, Y')) . '</p>';
|
|
1575
|
+
echo '</div>';
|
|
1576
|
+
}, 10, 1);
|
|
1577
|
+
```
|
|
1578
|
+
|
|
1579
|
+
### ` after_order_header `
|
|
1580
|
+
|
|
1581
|
+
`fluent_cart/receipt/thank_you/after_order_header` — After the order header in the receipt body
|
|
1582
|
+
|
|
1583
|
+
**When it runs:** This action fires after the order header (customer greeting, order number, and payment status message), before the tax information and order items.
|
|
1584
|
+
|
|
1585
|
+
**Parameters:**
|
|
1586
|
+
|
|
1587
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1588
|
+
|
|
1589
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1590
|
+
|
|
1591
|
+
**Usage:**
|
|
1592
|
+
|
|
1593
|
+
```
|
|
1594
|
+
add_action('fluent_cart/receipt/thank_you/after_order_header', function ($config) {
|
|
1595
|
+
$order = $config['order'];
|
|
1596
|
+
if ($order->note) {
|
|
1597
|
+
echo '<div class="my-order-note">';
|
|
1598
|
+
echo '<strong>Your note:</strong> ' . esc_html($order->note);
|
|
1599
|
+
echo '</div>';
|
|
1600
|
+
}
|
|
1601
|
+
}, 10, 1);
|
|
1602
|
+
```
|
|
1603
|
+
|
|
1604
|
+
### ` before_order_items `
|
|
1605
|
+
|
|
1606
|
+
`fluent_cart/receipt/thank_you/before_order_items` — Before the order items list in the receipt
|
|
1607
|
+
|
|
1608
|
+
**When it runs:** This action fires after the store tax information and before the order items table is rendered.
|
|
1609
|
+
|
|
1610
|
+
**Parameters:**
|
|
1611
|
+
|
|
1612
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1613
|
+
|
|
1614
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1615
|
+
|
|
1616
|
+
**Usage:**
|
|
1617
|
+
|
|
1618
|
+
```
|
|
1619
|
+
add_action('fluent_cart/receipt/thank_you/before_order_items', function ($config) {
|
|
1620
|
+
echo '<div class="my-items-intro"><h4>Here is what you ordered:</h4></div>';
|
|
1621
|
+
}, 10, 1);
|
|
1622
|
+
```
|
|
1623
|
+
|
|
1624
|
+
### ` after_order_items `
|
|
1625
|
+
|
|
1626
|
+
`fluent_cart/receipt/thank_you/after_order_items` — After the order items list in the receipt
|
|
1627
|
+
|
|
1628
|
+
**When it runs:** This action fires after the order items table (including the totals breakdown), before the subscription items, downloads, licenses, and address sections.
|
|
1629
|
+
|
|
1630
|
+
**Parameters:**
|
|
1631
|
+
|
|
1632
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1633
|
+
|
|
1634
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1635
|
+
|
|
1636
|
+
**Usage:**
|
|
1637
|
+
|
|
1638
|
+
```
|
|
1639
|
+
add_action('fluent_cart/receipt/thank_you/after_order_items', function ($config) {
|
|
1640
|
+
$order = $config['order'];
|
|
1641
|
+
// Show a referral code after the items list
|
|
1642
|
+
echo '<div class="my-referral-block">';
|
|
1643
|
+
echo '<p>Share your referral code <strong>REF-' . intval($order->customer_id) . '</strong> and earn 10% credit!</p>';
|
|
1644
|
+
echo '</div>';
|
|
1645
|
+
}, 10, 1);
|
|
1646
|
+
```
|
|
1647
|
+
|
|
1648
|
+
### ` before_footer_buttons `
|
|
1649
|
+
|
|
1650
|
+
`fluent_cart/receipt/thank_you/before_footer_buttons` — Before the footer buttons
|
|
1651
|
+
|
|
1652
|
+
**When it runs:** This action fires in the receipt footer area, before the "View Order" and "Download Receipt" buttons are rendered.
|
|
1653
|
+
|
|
1654
|
+
**Parameters:**
|
|
1655
|
+
|
|
1656
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1657
|
+
|
|
1658
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1659
|
+
|
|
1660
|
+
**Usage:**
|
|
1661
|
+
|
|
1662
|
+
```
|
|
1663
|
+
add_action('fluent_cart/receipt/thank_you/before_footer_buttons', function ($config) {
|
|
1664
|
+
echo '<div class="my-footer-message">';
|
|
1665
|
+
echo '<p>Thank you for shopping with us!</p>';
|
|
1666
|
+
echo '</div>';
|
|
1667
|
+
}, 10, 1);
|
|
1668
|
+
```
|
|
1669
|
+
|
|
1670
|
+
### ` after_footer_buttons `
|
|
1671
|
+
|
|
1672
|
+
`fluent_cart/receipt/thank_you/after_footer_buttons` — After the footer buttons
|
|
1673
|
+
|
|
1674
|
+
**When it runs:** This action fires in the receipt footer area, after the "View Order" and "Download Receipt" buttons have been rendered.
|
|
1675
|
+
|
|
1676
|
+
**Parameters:**
|
|
1677
|
+
|
|
1678
|
+
- `$config` (array): Thank-you page configuration (same structure as `before_header`)
|
|
1679
|
+
|
|
1680
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`
|
|
1681
|
+
|
|
1682
|
+
**Usage:**
|
|
1683
|
+
|
|
1684
|
+
```
|
|
1685
|
+
add_action('fluent_cart/receipt/thank_you/after_footer_buttons', function ($config) {
|
|
1686
|
+
echo '<div class="my-social-share">';
|
|
1687
|
+
echo '<p>Follow us on social media for updates and exclusive offers.</p>';
|
|
1688
|
+
echo '</div>';
|
|
1689
|
+
}, 10, 1);
|
|
1690
|
+
```
|
|
1691
|
+
|
|
1692
|
+
### ` after_receipt `
|
|
1693
|
+
|
|
1694
|
+
`fluent_cart/after_receipt` — After the entire receipt/thank-you page
|
|
1695
|
+
|
|
1696
|
+
**When it runs:** This action fires after the complete thank-you page has been rendered, including the footer. It fires on every receipt view (both first-time and returning visits). This hook is also present in the legacy `thank_you.php` view template.
|
|
1697
|
+
|
|
1698
|
+
**Parameters:**
|
|
1699
|
+
|
|
1700
|
+
- `$data` (array): Order and view context
|
|
1701
|
+
|
|
1702
|
+
```
|
|
1703
|
+
$data = [
|
|
1704
|
+
'order' => $order, // \FluentCart\App\Models\Order instance
|
|
1705
|
+
'is_first_time' => true|false, // bool — whether this is the first view of this receipt
|
|
1706
|
+
'order_operation' => $orderOperation, // mixed — order operation context or null
|
|
1707
|
+
];
|
|
1708
|
+
```
|
|
1709
|
+
|
|
1710
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`, `app/Views/invoice/thank_you.php`
|
|
1711
|
+
|
|
1712
|
+
**Usage:**
|
|
1713
|
+
|
|
1714
|
+
```
|
|
1715
|
+
add_action('fluent_cart/after_receipt', function ($data) {
|
|
1716
|
+
$order = $data['order'];
|
|
1717
|
+
|
|
1718
|
+
// Render a customer satisfaction survey
|
|
1719
|
+
echo '<div class="my-survey-widget">';
|
|
1720
|
+
echo '<h4>How was your experience?</h4>';
|
|
1721
|
+
echo '<a href="/survey?order=' . intval($order->id) . '">Take a quick survey</a>';
|
|
1722
|
+
echo '</div>';
|
|
1723
|
+
}, 10, 1);
|
|
1724
|
+
```
|
|
1725
|
+
|
|
1726
|
+
### ` after_receipt_first_time `
|
|
1727
|
+
|
|
1728
|
+
`fluent_cart/after_receipt_first_time` — Only on the first receipt view (for conversion tracking)
|
|
1729
|
+
|
|
1730
|
+
**When it runs:** This action fires only on the first time a customer views the receipt page after a purchase. It does not fire on subsequent visits to the same receipt URL. This is the ideal hook for firing conversion tracking pixels, analytics events, or affiliate postback URLs.
|
|
1731
|
+
|
|
1732
|
+
**Parameters:**
|
|
1733
|
+
|
|
1734
|
+
- `$data` (array): Order and operation context
|
|
1735
|
+
|
|
1736
|
+
```
|
|
1737
|
+
$data = [
|
|
1738
|
+
'order' => $order, // \FluentCart\App\Models\Order instance
|
|
1739
|
+
'order_operation' => $orderOperation, // mixed — order operation context or null
|
|
1740
|
+
];
|
|
1741
|
+
```
|
|
1742
|
+
|
|
1743
|
+
**Source:** `app/Services/Renderer/Receipt/ThankYouRender.php`, `app/Views/invoice/thank_you.php`
|
|
1744
|
+
|
|
1745
|
+
**Usage:**
|
|
1746
|
+
|
|
1747
|
+
```
|
|
1748
|
+
add_action('fluent_cart/after_receipt_first_time', function ($data) {
|
|
1749
|
+
$order = $data['order'];
|
|
1750
|
+
$total = \FluentCart\App\Helpers\Helper::toDecimal($order->total_amount);
|
|
1751
|
+
|
|
1752
|
+
// Fire a conversion pixel only on first receipt view
|
|
1753
|
+
echo '<script>';
|
|
1754
|
+
echo 'fbq("track", "Purchase", { value: ' . esc_js($total) . ', currency: "' . esc_js($order->currency) . '" });';
|
|
1755
|
+
echo '</script>';
|
|
1756
|
+
|
|
1757
|
+
// Google Ads conversion
|
|
1758
|
+
echo '<script>';
|
|
1759
|
+
echo 'gtag("event", "conversion", { send_to: "AW-XXXXX/YYYYY", value: ' . esc_js($total) . ', currency: "' . esc_js($order->currency) . '", transaction_id: "' . esc_js($order->invoice_no) . '" });';
|
|
1760
|
+
echo '</script>';
|
|
1761
|
+
}, 10, 1);
|
|
1762
|
+
```
|
|
1763
|
+
|
|
1764
|
+
### ` before_render_redirect_page `
|
|
1765
|
+
|
|
1766
|
+
`fluent_cart/before_render_redirect_page` — Before the payment redirect/receipt page renders
|
|
1767
|
+
|
|
1768
|
+
**When it runs:** This action fires at the very beginning of the receipt shortcode handler, before any receipt or redirect page content is rendered. It provides the raw URL parameters used to identify the order and transaction. Use it for early validation, logging, or to set up resources needed by the receipt page.
|
|
1769
|
+
|
|
1770
|
+
**Parameters:**
|
|
1771
|
+
|
|
1772
|
+
- `$data` (array): URL parameters for the receipt/redirect
|
|
1773
|
+
|
|
1774
|
+
```
|
|
1775
|
+
$data = [
|
|
1776
|
+
'order_hash' => $orderHash, // string — the order UUID from the URL
|
|
1777
|
+
'trx_hash' => $transactionHash, // string — the transaction hash from the URL
|
|
1778
|
+
'method' => $method, // string — the payment method slug
|
|
1779
|
+
'is_receipt' => $isReceipt, // bool — true if this is a receipt page, false if redirect
|
|
1780
|
+
];
|
|
1781
|
+
```
|
|
1782
|
+
|
|
1783
|
+
**Source:** `app/Hooks/Handlers/ShortCodes/ReceiptHandler.php`
|
|
1784
|
+
|
|
1785
|
+
**Usage:**
|
|
1786
|
+
|
|
1787
|
+
```
|
|
1788
|
+
add_action('fluent_cart/before_render_redirect_page', function ($data) {
|
|
1789
|
+
// Log receipt page visits for debugging payment callbacks
|
|
1790
|
+
if ($data['is_receipt'] && $data['order_hash']) {
|
|
1791
|
+
error_log('Receipt page visited for order: ' . $data['order_hash']
|
|
1792
|
+
. ' via method: ' . $data['method']);
|
|
1793
|
+
}
|
|
1794
|
+
}, 10, 1);
|
|
1795
|
+
```
|