fluentcart-developer 2.3.3 → 3.0.0
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/dist/cards/fluentcart/tools.d.ts.map +1 -1
- package/dist/cards/fluentcart/tools.js +2368 -2323
- package/dist/cards/fluentcart/tools.js.map +1 -1
- package/dist/paths.d.ts +1 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +1 -1
- package/dist/paths.js.map +1 -1
- package/dist/reference-reader.d.ts +32 -1
- package/dist/reference-reader.d.ts.map +1 -1
- package/dist/reference-reader.js +111 -22
- package/dist/reference-reader.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -1
- package/dist/server.js.map +1 -1
- package/dist/skills/fluentcart-developer/SKILL.md +66 -538
- package/dist/skills/fluentcart-developer/references/api/authentication.md +452 -0
- package/dist/skills/fluentcart-developer/references/api/coupons.md +786 -0
- package/dist/skills/fluentcart-developer/references/api/customers.md +889 -0
- package/dist/skills/fluentcart-developer/references/api/files.md +609 -0
- package/dist/skills/fluentcart-developer/references/api/index.md +432 -0
- package/dist/skills/fluentcart-developer/references/api/licensing.md +633 -0
- package/dist/skills/fluentcart-developer/references/api/order-bump.md +384 -0
- package/dist/skills/fluentcart-developer/references/api/orders.md +814 -0
- package/dist/skills/fluentcart-developer/references/api/products.md +866 -0
- package/dist/skills/fluentcart-developer/references/api/roles-permissions.md +536 -0
- package/dist/skills/fluentcart-developer/references/api/subscriptions.md +827 -0
- package/dist/skills/fluentcart-developer/references/database/index.md +44 -0
- package/dist/skills/fluentcart-developer/references/database/models/activity.md +178 -0
- package/dist/skills/fluentcart-developer/references/database/models/applied-coupon.md +291 -0
- package/dist/skills/fluentcart-developer/references/database/models/attribute-group.md +239 -0
- package/dist/skills/fluentcart-developer/references/database/models/attribute-relation.md +181 -0
- package/dist/skills/fluentcart-developer/references/database/models/attribute-term.md +219 -0
- package/dist/skills/fluentcart-developer/references/database/models/cart.md +645 -0
- package/dist/skills/fluentcart-developer/references/database/models/coupon.md +427 -0
- package/dist/skills/fluentcart-developer/references/database/models/customer-addresses.md +348 -0
- package/dist/skills/fluentcart-developer/references/database/models/customer-meta.md +156 -0
- package/dist/skills/fluentcart-developer/references/database/models/customer.md +584 -0
- package/dist/skills/fluentcart-developer/references/database/models/dynamic-model.md +163 -0
- package/dist/skills/fluentcart-developer/references/database/models/label-relationship.md +155 -0
- package/dist/skills/fluentcart-developer/references/database/models/label.md +153 -0
- package/dist/skills/fluentcart-developer/references/database/models/license-activation.md +182 -0
- package/dist/skills/fluentcart-developer/references/database/models/license-meta.md +163 -0
- package/dist/skills/fluentcart-developer/references/database/models/license-site.md +208 -0
- package/dist/skills/fluentcart-developer/references/database/models/license.md +640 -0
- package/dist/skills/fluentcart-developer/references/database/models/meta.md +233 -0
- package/dist/skills/fluentcart-developer/references/database/models/order-address.md +391 -0
- package/dist/skills/fluentcart-developer/references/database/models/order-download-permission.md +144 -0
- package/dist/skills/fluentcart-developer/references/database/models/order-item.md +383 -0
- package/dist/skills/fluentcart-developer/references/database/models/order-meta.md +303 -0
- package/dist/skills/fluentcart-developer/references/database/models/order-operation.md +158 -0
- package/dist/skills/fluentcart-developer/references/database/models/order-promotion-stat.md +175 -0
- package/dist/skills/fluentcart-developer/references/database/models/order-promotion.md +250 -0
- package/dist/skills/fluentcart-developer/references/database/models/order-tax-rate.md +172 -0
- package/dist/skills/fluentcart-developer/references/database/models/order-transaction.md +440 -0
- package/dist/skills/fluentcart-developer/references/database/models/order.md +727 -0
- package/dist/skills/fluentcart-developer/references/database/models/product-detail.md +397 -0
- package/dist/skills/fluentcart-developer/references/database/models/product-download.md +258 -0
- package/dist/skills/fluentcart-developer/references/database/models/product-meta.md +153 -0
- package/dist/skills/fluentcart-developer/references/database/models/product-variation.md +556 -0
- package/dist/skills/fluentcart-developer/references/database/models/product.md +580 -0
- package/dist/skills/fluentcart-developer/references/database/models/relationships.md +427 -0
- package/dist/skills/fluentcart-developer/references/database/models/scheduled-action.md +175 -0
- package/dist/skills/fluentcart-developer/references/database/models/shipping-class.md +148 -0
- package/dist/skills/fluentcart-developer/references/database/models/shipping-method.md +280 -0
- package/dist/skills/fluentcart-developer/references/database/models/shipping-zone.md +205 -0
- package/dist/skills/fluentcart-developer/references/database/models/subscription-meta.md +173 -0
- package/dist/skills/fluentcart-developer/references/database/models/subscription.md +528 -0
- package/dist/skills/fluentcart-developer/references/database/models/tax-class.md +195 -0
- package/dist/skills/fluentcart-developer/references/database/models/tax-rate.md +225 -0
- package/dist/skills/fluentcart-developer/references/database/models/user-meta.md +166 -0
- package/dist/skills/fluentcart-developer/references/database/models/user.md +220 -0
- package/dist/skills/fluentcart-developer/references/database/models.md +404 -0
- package/dist/skills/fluentcart-developer/references/database/query-builder.md +860 -0
- package/dist/skills/fluentcart-developer/references/database/readme.md +276 -0
- package/dist/skills/fluentcart-developer/references/database/schema.md +1002 -0
- package/dist/skills/fluentcart-developer/references/engineering/adding-custom-pages-to-the-customer-dashboard.md +395 -0
- package/dist/skills/fluentcart-developer/references/engineering/index.md +4 -0
- package/dist/skills/fluentcart-developer/references/engineering.md +4 -0
- package/dist/skills/fluentcart-developer/references/getting-started.md +249 -0
- package/dist/skills/fluentcart-developer/references/guides/frontend.md +519 -0
- package/dist/skills/fluentcart-developer/references/guides/index.md +107 -0
- package/dist/skills/fluentcart-developer/references/guides/integrations.md +600 -0
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/index.md +237 -0
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/labels-and-tracking.md +481 -0
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/live-rates.md +269 -0
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/reference.md +223 -0
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/settings.md +370 -0
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier.md +237 -0
- package/dist/skills/fluentcart-developer/references/{subscription-customization.md → guides/subscriptions.md} +57 -37
- package/dist/skills/fluentcart-developer/references/hooks/actions/admin-and-templates.md +1079 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions/cart-and-checkout.md +1795 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions/customers-and-users.md +327 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions/licenses.md +829 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions/modules.md +81 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions/orders.md +757 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions/payments-and-integrations.md +1163 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions/pro-modules.md +219 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions/products-and-coupons.md +1019 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions/subscriptions.md +1290 -0
- package/dist/skills/fluentcart-developer/references/hooks/actions.md +16 -0
- package/dist/skills/fluentcart-developer/references/hooks/deprecated.md +60 -0
- package/dist/skills/fluentcart-developer/references/hooks/filters/cart-and-checkout.md +2032 -0
- package/dist/skills/fluentcart-developer/references/hooks/filters/customers-and-subscriptions.md +1746 -0
- package/dist/skills/fluentcart-developer/references/hooks/filters/integrations-and-advanced.md +2439 -0
- package/dist/skills/fluentcart-developer/references/hooks/filters/modules.md +464 -0
- package/dist/skills/fluentcart-developer/references/hooks/filters/orders-and-payments.md +2658 -0
- package/dist/skills/fluentcart-developer/references/hooks/filters/pro-modules.md +502 -0
- package/dist/skills/fluentcart-developer/references/hooks/filters/products-and-pricing.md +1785 -0
- package/dist/skills/fluentcart-developer/references/hooks/filters/settings-and-configuration.md +2966 -0
- package/dist/skills/fluentcart-developer/references/hooks/filters.md +14 -0
- package/dist/skills/fluentcart-developer/references/hooks/index.md +35 -0
- package/dist/skills/fluentcart-developer/references/index.md +625 -0
- package/dist/skills/fluentcart-developer/references/{fee-system-guide.md → modules/fee-system.md} +38 -60
- package/dist/skills/fluentcart-developer/references/{ghost-product-selling.md → modules/ghost-product-selling.md} +71 -89
- package/dist/skills/fluentcart-developer/references/modules/index.md +484 -0
- package/dist/skills/fluentcart-developer/references/modules/licensing.md +342 -0
- package/dist/skills/fluentcart-developer/references/modules/order-bump.md +433 -0
- package/dist/skills/fluentcart-developer/references/modules/payment-methods.md +129 -0
- package/dist/skills/fluentcart-developer/references/modules/refunds.md +170 -0
- package/dist/skills/fluentcart-developer/references/modules/shipping.md +846 -0
- package/dist/skills/fluentcart-developer/references/modules/storage.md +986 -0
- package/dist/skills/fluentcart-developer/references/modules/subscription-vendor-ids.md +186 -0
- package/dist/skills/fluentcart-developer/references/modules/subscriptions.md +678 -0
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/index.md +164 -0
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/paddle-example.md +1648 -0
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/payment/setting/fields.md +353 -0
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/quick-implementation.md +1079 -0
- package/dist/skills/fluentcart-developer/references/payment-methods-integration.md +164 -0
- package/dist/skills/fluentcart-developer/references/restapi/checkout.md +573 -0
- package/dist/skills/fluentcart-developer/references/restapi/coupons.md +958 -0
- package/dist/skills/fluentcart-developer/references/restapi/customer-profile.md +1423 -0
- package/dist/skills/fluentcart-developer/references/{rest-api-customers.md → restapi/customers.md} +406 -424
- package/dist/skills/fluentcart-developer/references/restapi/dashboard.md +1083 -0
- package/dist/skills/fluentcart-developer/references/restapi/data-export.md +132 -0
- package/dist/skills/fluentcart-developer/references/restapi/email-notifications.md +846 -0
- package/dist/skills/fluentcart-developer/references/restapi/files.md +313 -0
- package/dist/skills/fluentcart-developer/references/restapi/index.md +127 -0
- package/dist/skills/fluentcart-developer/references/restapi/integrations.md +1000 -0
- package/dist/skills/fluentcart-developer/references/restapi/inventory.md +192 -0
- package/dist/skills/fluentcart-developer/references/restapi/labels-and-attributes.md +797 -0
- package/dist/skills/fluentcart-developer/references/restapi/licensing.md +1733 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-available-shipping-methods.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-checkout-summary.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-country-info.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-order-info.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-shipping-methods-list-view.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/login.md +66 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/place-order.md +179 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/apply-coupon.md +83 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/cancel-coupon.md +87 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/check-product-eligibility.md +59 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/create-coupon.md +230 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/delete-coupon.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon-settings.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupon-codes.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupons.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/re-apply-coupons.md +75 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/store-coupon-settings.md +40 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/update-coupon.md +133 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-address-checkout.md +138 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-profile-address.md +119 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/dashboard-overview.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/delete-profile-address.md +46 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-order-details.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-portal-sections.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-profile-details.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-transaction-billing-address.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-upgrade-paths.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-downloads.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-orders.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/make-profile-address-primary.md +55 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/pause-subscription.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/resume-subscription.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/save-transaction-billing-address.md +92 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/select-address-for-checkout.md +32 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-address.md +115 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-details.md +69 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/attach-user.md +50 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/bulk-actions.md +65 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-address.md +135 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-customer.md +108 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/delete-address.md +62 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/detach-user.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/find-customer-order.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-attachable-users.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-addresses.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-orders.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-stats.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer.md +32 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/list-customers.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/recalculate-ltv.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/set-primary-address.md +72 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-additional-info.md +55 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-address.md +144 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-customer.md +123 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/attach-note-to-order.md +49 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-all-pages.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-single-page.md +55 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/delete-activity.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-country-info.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-dashboard-stats.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-filter-options.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-data.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-settings.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-print-templates.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-search-options.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-widgets.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/initialize-app.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-activities.md +33 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-attachments.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-countries.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/mark-activity-read.md +53 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/run-data-backfills.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-settings.md +54 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-tax-settings.md +73 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-print-templates.md +64 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/upload-attachment.md +42 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-customers-batch.md +129 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-licenses-batch.md +133 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-orders-batch.md +129 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-subscriptions-batch.md +129 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-customers-export-schema.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-licenses-export-schema.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-orders-export-schema.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-subscriptions-export-schema.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/enable-notification.md +57 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-digest-settings.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-notification.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-reminders.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-settings.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-shortcodes.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/list-notifications.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-default-template.md +66 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-notification.md +50 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-digest-settings.md +101 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-reminders.md +162 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-settings.md +99 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-digest-test.md +47 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-manual-reminder.md +51 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/update-notification.md +93 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/delete-file.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/get-bucket-list.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/list-files.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-editor-file.md +32 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-file.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/chained-data-request.md +46 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/change-feed-status.md +51 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/delete-feed.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-dynamic-options.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-lists.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-settings.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-feeds.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-settings.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/install-addon-plugin.md +49 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/list-addons.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/save-feed-settings.md +52 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/set-global-settings.md +50 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/bulk-update-stock.md +94 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/export-inventory.md +81 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-adjustment-history.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-inventory-stats.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/list-inventory.md +33 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/update-stock.md +75 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-attribute-group.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-label.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-terms.md +90 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-group.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-term.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-group.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-library.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-groups.md +32 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-terms.md +33 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-labels.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-groups.md +51 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-terms.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-group.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-term.md +39 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-label-selections.md +32 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-plugin-license.md +41 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-site-admin.md +60 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-plugin-license.md +18 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-admin.md +67 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-customer.md +47 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/delete-license.md +24 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/extend-license-validity.md +47 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-license-details.md +25 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-licenses-admin.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-activations.md +25 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-details.md +25 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-site.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-plugin-license-status.md +18 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-product-license-settings.md +24 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-customer-licenses.md +25 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-license-sites.md +33 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-licenses.md +38 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-activate-license.md +54 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-check-license.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-deactivate-license.md +46 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-download-license-package.md +23 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-get-license-version.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/regenerate-license-key.md +24 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/save-product-license-settings.md +193 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-activation-limit.md +53 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-status.md +52 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/create-order-bump.md +47 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/delete-order-bump.md +25 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/get-order-bump.md +25 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/list-order-bumps.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/update-order-bump.md +141 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/accept-dispute.md +47 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/bulk-actions.md +72 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-shipping.md +67 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-tax.md +98 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/change-customer.md +50 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/charge-now.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-and-change-customer.md +92 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-custom-order-item.md +68 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-order.md +351 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-renewal-now.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/delete-order.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/generate-missing-licenses.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order-transactions.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-renewal.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-shipping-methods.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-single-transaction.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-order-currencies.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-orders.md +42 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-renewals.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/mark-as-paid.md +61 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/price-order.md +135 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/refund-order.md +72 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/resend-renewal-invoice.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/skip-renewal.md +48 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-order-statuses.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-pending-transaction.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address-id.md +60 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address.md +98 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order.md +172 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-statuses.md +77 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-subscription-details.md +84 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-transaction-status.md +51 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/void-renewal.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/create-pdf-template.md +42 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/delete-pdf-template.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/download-pdf-preview.md +44 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-factory-default-templates.md +19 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-status.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-template.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-saved-templates.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-seller-details.md +19 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/list-pdf-templates.md +19 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-pdf-template.md +53 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-seller-details.md +97 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/add-product-terms.md +64 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-edit-fetch.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-insert-products.md +62 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-products.md +59 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-variants.md +83 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/change-integration-status.md +64 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-dummy-products.md +45 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-product.md +81 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-variation.md +181 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-downloadable-file.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product-integration.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-taxonomy-term.md +55 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-upgrade-path.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-variation.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/do-bulk-action.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/duplicate-product.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-products-by-ids.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-taxonomy-terms.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-terms-by-parent.md +60 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-variations-by-ids.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/find-subscription-variants.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-bundle-info.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-downloadable-url.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-max-excerpt-word-count.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-pricing-widgets.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-feeds.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-settings.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-pricing.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-related-products.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-upgrade-settings.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-variation-upgrade-paths.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/group-bulk-update-variants.md +103 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-all-variants.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-product-variations.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-products.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-shipping-class.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-tax-class.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-bundle-info.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-product-integration.md +62 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-upgrade-path.md +78 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-product-variant-options.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-products-by-name.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-variants-by-name.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/set-variation-media.md +74 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/suggest-sku.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-downloadable-files.md +134 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-taxonomy-terms.md +61 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/toggle-product-tax-exemption.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-downloadable-file.md +98 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-inventory.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-long-desc-editor-mode.md +49 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-manage-stock.md +53 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-detail.md +58 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-pricing.md +225 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-shipping-class.md +49 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-tax-class.md +49 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-upgrade-path.md +78 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-option.md +79 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-tax-exemption.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation-pricing-table.md +49 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation.md +105 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/get-product-views.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/list-products.md +42 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/search-products.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/channel-rules.md +24 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/country-heat-map.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupon-overview.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupons.md +36 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-insights.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-overview.md +36 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-repeat.md +35 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segment-customers.md +36 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segments.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-value.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/dashboard-stats.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/failed-orders.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-new-vs-returning-customer.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-by-day-and-hour.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-meta.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-top-sold-products.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/future-renewals.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/generate-retention-snapshots.md +24 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-overview.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-activities.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-orders.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-revenue.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-at-risk.md +35 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-variations.md +33 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments.md +33 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/item-count-distribution.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-chart.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-pie-chart.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-summary.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/locations.md +43 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-chart.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-completion-time.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-mix.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-value-distribution.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-disputes.md +38 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-methods.md +36 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison-launch.md +33 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison.md +40 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-detail.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-sales.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/refunds-overview.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/retention-snapshots-step.md +45 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sales-growth-chart.md +35 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/save-channel-rules.md +73 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/source-channels.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sources.md +49 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-cohorts.md +33 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-health.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-rebuys.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-retention.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-variations.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscriptions-overview.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/weeks-between-refund.md +34 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/assign-role.md +48 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/delete-role-assignment.md +47 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/get-role.md +25 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-managers.md +18 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-roles.md +18 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/search-users.md +25 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/update-role.md +43 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/create-saved-view.md +106 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/delete-saved-view.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/list-saved-views.md +25 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/update-saved-view.md +83 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-payment-addon.md +44 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-plugin-addon.md +44 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/change-storage-driver-status.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/check-paypal-webhook.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/create-storage-bucket.md +63 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/disconnect-payment-method.md +55 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/exchange-paypal-seller-auth-token.md +62 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-active-storage-drivers.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-checkout-fields.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-email-shortcodes.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-config-snippets.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-status.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-module-settings.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-connection-info.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-settings.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-permissions.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-plugin-addons.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-storage-driver-settings.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-store-settings.md +26 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-mcp-adapter.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-payment-addon.md +60 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-plugin-addon.md +64 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-payment-methods.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-storage-drivers.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-storage-buckets.md +67 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reorder-payment-methods.md +55 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reset-storage-driver-settings.md +45 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-checkout-fields.md +133 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-confirmation-settings.md +68 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-module-settings.md +68 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-design.md +67 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-settings.md +58 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-permissions.md +68 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-storage-driver-settings.md +62 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-store-settings.md +239 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/setup-paypal-webhook.md +48 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/toggle-mcp.md +40 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-storage-driver-connection.md +62 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-turnstile-keys.md +55 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-class.md +73 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-method.md +110 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-zone.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-class.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-method.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-zone.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class-profile.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-packages.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-zone.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-countries.md +22 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-states.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-classes.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-zones.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/save-shipping-packages.md +112 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-class.md +79 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-method.md +113 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-zone.md +62 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-zone-order.md +52 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-auto-renew.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-subscription.md +52 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/confirm-subscription-switch.md +70 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/fetch-subscription-remote.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/generate-early-payment-link.md +29 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-customer-subscription.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-or-create-plan.md +69 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-setup-intent-attempts.md +30 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-subscription.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/initiate-early-payment.md +31 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-customer-subscriptions.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-subscriptions.md +39 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/pause-subscription.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/reactivate-subscription.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/resume-subscription.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/switch-payment-method.md +70 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-payment-method.md +69 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-vendor-ids.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/verify-vendor-ids.md +56 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-class.md +51 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-rate.md +117 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-product-override.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-shipping-tax-override.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-class.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-rate.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-id.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-rates.md +28 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-eu-vat-product-overrides.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-oss-country-rates.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-preconfigured-tax-rates.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-product-overrides.md +27 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-tax-settings.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-all-tax-rates.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-classes.md +20 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-records.md +37 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/mark-taxes-as-filed.md +58 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/reset-eu-vat-rates.md +21 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-configured-countries.md +57 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-country-tax-id.md +50 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-eu-vat-cross-border-settings.md +127 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-oss-country-rates.md +100 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-product-override.md +110 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-shipping-tax-override.md +52 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-tax-settings.md +166 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-country-status.md +54 -0
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-tax-rate.md +116 -0
- package/dist/skills/fluentcart-developer/references/restapi/order-bumps.md +433 -0
- package/dist/skills/fluentcart-developer/references/{rest-api-orders.md → restapi/orders.md} +146 -396
- package/dist/skills/fluentcart-developer/references/restapi/pdf-templates.md +212 -0
- package/dist/skills/fluentcart-developer/references/{rest-api-products.md → restapi/products.md} +354 -566
- package/dist/skills/fluentcart-developer/references/restapi/public-shop.md +191 -0
- package/dist/skills/fluentcart-developer/references/restapi/reports.md +3773 -0
- package/dist/skills/fluentcart-developer/references/restapi/roles.md +403 -0
- package/dist/skills/fluentcart-developer/references/restapi/saved-views.md +136 -0
- package/dist/skills/fluentcart-developer/references/restapi/settings.md +1423 -0
- package/dist/skills/fluentcart-developer/references/{rest-api-shipping.md → restapi/shipping.md} +243 -138
- package/dist/skills/fluentcart-developer/references/restapi/subscriptions.md +1169 -0
- package/dist/skills/fluentcart-developer/references/restapi/tax.md +1551 -0
- package/dist/skills/fluentcart-developer/references/restapi.md +127 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/skills/fluentcart-developer/.claude-plugin/plugin.json +0 -12
- package/dist/skills/fluentcart-developer/.mcp.json +0 -11
- package/dist/skills/fluentcart-developer/references/action-hooks-admin-templates.md +0 -787
- package/dist/skills/fluentcart-developer/references/action-hooks-cart-checkout.md +0 -1355
- package/dist/skills/fluentcart-developer/references/action-hooks-customers-users.md +0 -266
- package/dist/skills/fluentcart-developer/references/action-hooks-licenses.md +0 -855
- package/dist/skills/fluentcart-developer/references/action-hooks-orders.md +0 -631
- package/dist/skills/fluentcart-developer/references/action-hooks-payments-integrations.md +0 -963
- package/dist/skills/fluentcart-developer/references/action-hooks-products-coupons.md +0 -585
- package/dist/skills/fluentcart-developer/references/action-hooks-subscriptions.md +0 -661
- package/dist/skills/fluentcart-developer/references/customer-dashboard-endpoints.md +0 -169
- package/dist/skills/fluentcart-developer/references/database-models-query-builder.md +0 -194
- package/dist/skills/fluentcart-developer/references/database-models-reference.md +0 -604
- package/dist/skills/fluentcart-developer/references/database-schema-reference.md +0 -947
- package/dist/skills/fluentcart-developer/references/engineering-notes.md +0 -154
- package/dist/skills/fluentcart-developer/references/filter-hooks-cart-checkout.md +0 -1202
- package/dist/skills/fluentcart-developer/references/filter-hooks-customers-subscriptions.md +0 -902
- package/dist/skills/fluentcart-developer/references/filter-hooks-integrations-advanced.md +0 -1598
- package/dist/skills/fluentcart-developer/references/filter-hooks-orders-payments.md +0 -1319
- package/dist/skills/fluentcart-developer/references/filter-hooks-products-pricing.md +0 -628
- package/dist/skills/fluentcart-developer/references/filter-hooks-settings-configuration.md +0 -1177
- package/dist/skills/fluentcart-developer/references/fluentcart-developer-guide.md +0 -154
- package/dist/skills/fluentcart-developer/references/hooks-complete-index.md +0 -834
- package/dist/skills/fluentcart-developer/references/models-complete-index.md +0 -912
- package/dist/skills/fluentcart-developer/references/modules-and-extensions-reference.md +0 -224
- package/dist/skills/fluentcart-developer/references/order-bump-module.md +0 -163
- package/dist/skills/fluentcart-developer/references/paddle-gateway-case-study.md +0 -1931
- package/dist/skills/fluentcart-developer/references/payment-gateway-integration.md +0 -761
- package/dist/skills/fluentcart-developer/references/rest-api-checkout.md +0 -288
- package/dist/skills/fluentcart-developer/references/rest-api-coupons.md +0 -801
- package/dist/skills/fluentcart-developer/references/rest-api-customer-profile.md +0 -190
- package/dist/skills/fluentcart-developer/references/rest-api-dashboard-utilities.md +0 -219
- package/dist/skills/fluentcart-developer/references/rest-api-email-notifications.md +0 -619
- package/dist/skills/fluentcart-developer/references/rest-api-files.md +0 -290
- package/dist/skills/fluentcart-developer/references/rest-api-integrations.md +0 -324
- package/dist/skills/fluentcart-developer/references/rest-api-labels-attributes.md +0 -321
- package/dist/skills/fluentcart-developer/references/rest-api-licensing.md +0 -174
- package/dist/skills/fluentcart-developer/references/rest-api-order-bumps.md +0 -200
- package/dist/skills/fluentcart-developer/references/rest-api-overview.md +0 -131
- package/dist/skills/fluentcart-developer/references/rest-api-public-shop.md +0 -172
- package/dist/skills/fluentcart-developer/references/rest-api-reference.md +0 -552
- package/dist/skills/fluentcart-developer/references/rest-api-reports.md +0 -377
- package/dist/skills/fluentcart-developer/references/rest-api-roles-permissions.md +0 -147
- package/dist/skills/fluentcart-developer/references/rest-api-settings.md +0 -528
- package/dist/skills/fluentcart-developer/references/rest-api-subscriptions.md +0 -938
- package/dist/skills/fluentcart-developer/references/rest-api-tax.md +0 -356
- package/dist/skills/fluentcart-developer/references/shipping-module-guide.md +0 -126
- package/dist/skills/fluentcart-developer/references/software-licensing-sdk.md +0 -228
- package/dist/skills/fluentcart-developer/references/storage-drivers-module.md +0 -140
|
@@ -0,0 +1,2032 @@
|
|
|
1
|
+
# Cart & Checkout
|
|
2
|
+
|
|
3
|
+
All filters related to the shopping flow from [Cart](/database/models/cart.md) to checkout.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Cart Items & Validation
|
|
8
|
+
|
|
9
|
+
### ` cart/item_modify `
|
|
10
|
+
|
|
11
|
+
`fluent_cart/cart/item_modify` — Modify cart item variation before adding
|
|
12
|
+
|
|
13
|
+
**When it runs:** This filter is applied when a product variation is being added to the cart or when an existing cart item is updated. It allows you to modify the variation object before it gets processed, or return `null` to block the item from being added.
|
|
14
|
+
|
|
15
|
+
**Source:**
|
|
16
|
+
|
|
17
|
+
- `api/Resource/FrontendResource/CartResource.php:44` (add to cart)
|
|
18
|
+
- `api/Resource/FrontendResource/CartResource.php:307` (update cart item)
|
|
19
|
+
|
|
20
|
+
**Parameters:**
|
|
21
|
+
|
|
22
|
+
- `$variation` ([ProductVariation](/database/models/product-variation.md)|null): The product variation model instance
|
|
23
|
+
- `$data` (array): Context data
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
$data = [
|
|
27
|
+
'item_id' => 42, // Variation ID being added
|
|
28
|
+
'quantity' => 1, // Requested quantity
|
|
29
|
+
];
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Returns:**
|
|
33
|
+
|
|
34
|
+
- [ProductVariation](/database/models/product-variation.md)|null — The modified variation, or `null` to prevent the item from being added
|
|
35
|
+
|
|
36
|
+
**Usage:**
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
add_filter('fluent_cart/cart/item_modify', function ($variation, $data) {
|
|
40
|
+
if (!$variation) {
|
|
41
|
+
return $variation;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Block a specific variation from being added
|
|
45
|
+
if ($variation->id === 99) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return $variation;
|
|
50
|
+
}, 10, 2);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### ` item_max_quantity `
|
|
54
|
+
|
|
55
|
+
`fluent_cart/item_max_quantity` — Limit the maximum quantity for a cart item
|
|
56
|
+
|
|
57
|
+
**When it runs:** This filter is applied immediately after the variation is resolved, before the item is added to the cart. It allows you to cap or adjust the quantity a customer can add.
|
|
58
|
+
|
|
59
|
+
**Source:** `api/Resource/FrontendResource/CartResource.php:79`
|
|
60
|
+
|
|
61
|
+
**Parameters:**
|
|
62
|
+
|
|
63
|
+
- `$quantity` (int): The requested quantity
|
|
64
|
+
- `$data` (array): Context data
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
$data = [
|
|
68
|
+
'variation' => $variation, // ProductVariation instance
|
|
69
|
+
'product' => $product, // Product instance (empty array for custom items)
|
|
70
|
+
];
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Returns:**
|
|
74
|
+
|
|
75
|
+
- `int` — The (possibly capped) quantity
|
|
76
|
+
|
|
77
|
+
**Usage:**
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
add_filter('fluent_cart/item_max_quantity', function ($quantity, $data) {
|
|
81
|
+
$variation = $data['variation'];
|
|
82
|
+
|
|
83
|
+
// Limit subscription products to 1
|
|
84
|
+
if ($variation->payment_type === 'subscription') {
|
|
85
|
+
return 1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Cap all items at 10
|
|
89
|
+
return min($quantity, 10);
|
|
90
|
+
}, 10, 2);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### ` cart/custom_item_quantity_changed `
|
|
94
|
+
|
|
95
|
+
`fluent_cart/cart/custom_item_quantity_changed` — Handle custom item quantity changes
|
|
96
|
+
|
|
97
|
+
**When it runs:** This filter fires when the quantity of a custom (externally-managed) item already in the cart is changed. It lets you recalculate pricing or validate the new quantity.
|
|
98
|
+
|
|
99
|
+
**Source:** `api/Resource/FrontendResource/CartResource.php:310`
|
|
100
|
+
|
|
101
|
+
**Parameters:**
|
|
102
|
+
|
|
103
|
+
- `$existingItem` (object): The existing cart item object
|
|
104
|
+
- `$data` (array): Context data
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
$data = [
|
|
108
|
+
'old_quantity' => 2, // Previous quantity
|
|
109
|
+
'new_quantity' => 3, // Requested new quantity
|
|
110
|
+
'by_input' => false, // Whether quantity was set directly
|
|
111
|
+
'is_changed' => true, // Whether a change occurred
|
|
112
|
+
'is_custom' => true, // Whether this is a custom item
|
|
113
|
+
];
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Returns:**
|
|
117
|
+
|
|
118
|
+
- `object` — The modified item object with updated quantity and totals
|
|
119
|
+
|
|
120
|
+
**Usage:**
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
add_filter('fluent_cart/cart/custom_item_quantity_changed', function ($variation, $data) {
|
|
124
|
+
if (empty($data['is_custom'])) {
|
|
125
|
+
return $variation;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Recalculate line total based on new quantity
|
|
129
|
+
$variation->quantity = $data['new_quantity'];
|
|
130
|
+
$variation->line_total = $variation->price * $data['new_quantity'];
|
|
131
|
+
|
|
132
|
+
return $variation;
|
|
133
|
+
}, 10, 2);
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### ` cart/validate_custom_item `
|
|
137
|
+
|
|
138
|
+
`fluent_cart/cart/validate_custom_item` — Validate a custom or externally-managed cart item
|
|
139
|
+
|
|
140
|
+
**When it runs:** This filter fires when a custom (non-FluentCart) item is being added to the cart. Use it to validate and construct the item object that will be stored in the cart. Runs both during regular add-to-cart and instant checkout flows.
|
|
141
|
+
|
|
142
|
+
**Source:**
|
|
143
|
+
|
|
144
|
+
- `api/Resource/FrontendResource/CartResource.php:289`
|
|
145
|
+
- `app/Http/Routes/WebRoutes.php:99`
|
|
146
|
+
|
|
147
|
+
**Parameters:**
|
|
148
|
+
|
|
149
|
+
- `$existingItem` (object|null): The existing item object, or `null` for new items
|
|
150
|
+
- `$data` (array): Context data
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
$data = [
|
|
154
|
+
'item_id' => 'custom_item_123', // External item identifier
|
|
155
|
+
'quantity' => 1, // Requested quantity
|
|
156
|
+
'is_custom' => true, // Always true for custom items
|
|
157
|
+
];
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Returns:**
|
|
161
|
+
|
|
162
|
+
- `object` — A variation-like object with the required cart item properties
|
|
163
|
+
|
|
164
|
+
**Usage:**
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
add_filter('fluent_cart/cart/validate_custom_item', function ($variation, $data) {
|
|
168
|
+
if (!(bool) $data['is_custom']) {
|
|
169
|
+
return $variation;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Build a custom item object
|
|
173
|
+
return (object) [
|
|
174
|
+
'item_id' => absint($data['item_id']),
|
|
175
|
+
'object_id' => absint($data['item_id']),
|
|
176
|
+
'title' => 'Custom Product',
|
|
177
|
+
'price' => 2500, // $25.00 in cents
|
|
178
|
+
'quantity' => (int) $data['quantity'],
|
|
179
|
+
'payment_type' => 'one_time',
|
|
180
|
+
'is_custom' => true,
|
|
181
|
+
];
|
|
182
|
+
}, 10, 2);
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### ` cart_item_product_variation `
|
|
186
|
+
|
|
187
|
+
`fluent_cart/cart_item_product_variation` — Provide a fallback product variation for a cart item
|
|
188
|
+
|
|
189
|
+
**When it runs:** This filter fires when a product variation cannot be found in the database during cart operations. It serves as a fallback mechanism to supply a variation from an external source.
|
|
190
|
+
|
|
191
|
+
**Source:** `api/Resource/FrontendResource/CartResource.php:710`
|
|
192
|
+
|
|
193
|
+
**Parameters:**
|
|
194
|
+
|
|
195
|
+
- `$productVariation` ([ProductVariation](/database/models/product-variation.md)|null): Always `null` at this point (no variation found)
|
|
196
|
+
- `$itemId` (int): The variation/item ID being looked up
|
|
197
|
+
- `$incrementBy` (int): The quantity increment value
|
|
198
|
+
- `$existingItemsArray` (array): The current cart items array
|
|
199
|
+
|
|
200
|
+
**Returns:**
|
|
201
|
+
|
|
202
|
+
- [ProductVariation](/database/models/product-variation.md)|null — A variation model instance, or `null` if the item should be skipped
|
|
203
|
+
|
|
204
|
+
**Usage:**
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
add_filter('fluent_cart/cart_item_product_variation', function ($variation, $itemId, $incrementBy, $existingItems) {
|
|
208
|
+
if (!$variation && $itemId > 10000) {
|
|
209
|
+
// Provide a variation for external items
|
|
210
|
+
return MyExternalService::getVariation($itemId);
|
|
211
|
+
}
|
|
212
|
+
return $variation;
|
|
213
|
+
}, 10, 4);
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### ` cart/can_purchase `
|
|
217
|
+
|
|
218
|
+
`fluent_cart/cart/can_purchase` — Determine whether a variation can be added to the cart
|
|
219
|
+
|
|
220
|
+
**When it runs:** This filter fires after the built-in `canPurchase()` check on the variation model, inside `Cart::addItem()`. It allows you to add additional purchase restrictions or override the default validation.
|
|
221
|
+
|
|
222
|
+
**Source:** `app/Models/Cart.php:451`
|
|
223
|
+
|
|
224
|
+
**Parameters:**
|
|
225
|
+
|
|
226
|
+
- `$canPurchase` (true|WP_Error): The result of the built-in purchase validation
|
|
227
|
+
- `$data` (array): Context data
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
$data = [
|
|
231
|
+
'cart' => $cart, // Cart model instance
|
|
232
|
+
'variation' => $variation, // ProductVariation model
|
|
233
|
+
'quantity' => 2, // Requested quantity
|
|
234
|
+
];
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Returns:**
|
|
238
|
+
|
|
239
|
+
- `true|WP_Error` — Return `true` to allow purchase, or a `WP_Error` to block it with a message
|
|
240
|
+
|
|
241
|
+
**Usage:**
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
add_filter('fluent_cart/cart/can_purchase', function ($canPurchase, $data) {
|
|
245
|
+
if (is_wp_error($canPurchase)) {
|
|
246
|
+
return $canPurchase;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
$cart = $data['cart'];
|
|
250
|
+
$variation = $data['variation'];
|
|
251
|
+
|
|
252
|
+
// Limit cart to 5 unique items
|
|
253
|
+
$existingItems = $cart->getItems();
|
|
254
|
+
if (count($existingItems) >= 5 && !isset($existingItems[$variation->id])) {
|
|
255
|
+
return new \WP_Error(
|
|
256
|
+
'cart_limit',
|
|
257
|
+
__('You can only have up to 5 different items in your cart.', 'fluent-cart')
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return true;
|
|
262
|
+
}, 10, 2);
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### ` cart/estimated_total `
|
|
266
|
+
|
|
267
|
+
`fluent_cart/cart/estimated_total` — Filter the cart estimated total
|
|
268
|
+
|
|
269
|
+
**When it runs:** This filter is applied when calculating the cart's estimated total. It fires in both the [Cart](/database/models/cart.md) model's `getEstimatedTotal()` method and the web checkout handler. The total includes item subtotals, shipping, and any custom checkout adjustments.
|
|
270
|
+
|
|
271
|
+
**Source:**
|
|
272
|
+
|
|
273
|
+
- `app/Models/Cart.php:766`
|
|
274
|
+
- `app/Hooks/Cart/WebCheckoutHandler.php:358`
|
|
275
|
+
|
|
276
|
+
**Parameters:**
|
|
277
|
+
|
|
278
|
+
- `$total` (int): The cart total in cents
|
|
279
|
+
- `$data` (array): Context data
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
$data = [
|
|
283
|
+
'cart' => $cart, // Cart model instance
|
|
284
|
+
];
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Returns:**
|
|
288
|
+
|
|
289
|
+
- `int` — The modified cart total in cents
|
|
290
|
+
|
|
291
|
+
**Usage:**
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
add_filter('fluent_cart/cart/estimated_total', function ($total, $data) {
|
|
295
|
+
$cart = $data['cart'];
|
|
296
|
+
|
|
297
|
+
// Add a flat processing fee of $2.00
|
|
298
|
+
$processingFee = 200; // in cents
|
|
299
|
+
return $total + $processingFee;
|
|
300
|
+
}, 10, 2);
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### ` cart_cookie_minutes `
|
|
304
|
+
|
|
305
|
+
`fluent_cart/cart_cookie_minutes` — Control cart cookie expiration time
|
|
306
|
+
|
|
307
|
+
**When it runs:** This filter fires when setting the cart hash cookie. Despite the name, the default value is a Unix timestamp (not minutes). You can change how long the cart cookie persists in the browser.
|
|
308
|
+
|
|
309
|
+
**Source:** `api/Cookie/Cookie.php:22`
|
|
310
|
+
|
|
311
|
+
**Parameters:**
|
|
312
|
+
|
|
313
|
+
- `$expireTime` (int): Unix timestamp for cookie expiration. Default is `time() + 24 * 60 * 30` (30 days from now)
|
|
314
|
+
|
|
315
|
+
**Returns:**
|
|
316
|
+
|
|
317
|
+
- `int` — The Unix timestamp when the cookie should expire
|
|
318
|
+
|
|
319
|
+
**Usage:**
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
add_filter('fluent_cart/cart_cookie_minutes', function ($expireTime) {
|
|
323
|
+
// Set cookie to expire in 7 days instead of 30
|
|
324
|
+
return time() + (7 * DAY_IN_SECONDS);
|
|
325
|
+
});
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### ` variation/can_purchase_bundle `
|
|
329
|
+
|
|
330
|
+
`fluent_cart/variation/can_purchase_bundle` — Validate whether a bundle product can be purchased
|
|
331
|
+
|
|
332
|
+
**When it runs:** This filter fires during the `canPurchase()` check on a [ProductVariation](/database/models/product-variation.md) when the product is a bundle. It allows external modules (like StockManagement) to validate stock for bundled child items.
|
|
333
|
+
|
|
334
|
+
**Source:** `app/Models/ProductVariation.php:330`
|
|
335
|
+
|
|
336
|
+
**Parameters:**
|
|
337
|
+
|
|
338
|
+
- `$result` (null): Always `null` initially
|
|
339
|
+
- `$data` (array): Context data
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
$data = [
|
|
343
|
+
'variation' => $variation, // ProductVariation model
|
|
344
|
+
'quantity' => 1, // Requested purchase quantity
|
|
345
|
+
];
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Returns:**
|
|
349
|
+
|
|
350
|
+
- `null|true|false|WP_Error` — Return `null` or `true` to allow, `false` for a generic out-of-stock error, or `WP_Error` with a custom message to block
|
|
351
|
+
|
|
352
|
+
**Usage:**
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
add_filter('fluent_cart/variation/can_purchase_bundle', function ($result, $data) {
|
|
356
|
+
$variation = $data['variation'];
|
|
357
|
+
$quantity = (int) $data['quantity'];
|
|
358
|
+
|
|
359
|
+
// Check if all bundle children have sufficient stock
|
|
360
|
+
$children = $variation->bundleChildren()->get();
|
|
361
|
+
foreach ($children as $child) {
|
|
362
|
+
if ($child->available < ($child->pivot->quantity * $quantity)) {
|
|
363
|
+
return new \WP_Error(
|
|
364
|
+
'bundle_stock',
|
|
365
|
+
sprintf(__('%s does not have enough stock.', 'fluent-cart'), $child->title)
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return $result;
|
|
371
|
+
}, 10, 2);
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Cart Totals & Fees
|
|
377
|
+
|
|
378
|
+
### ` cart/context_data `
|
|
379
|
+
|
|
380
|
+
`fluent_cart/cart/context_data` — Filter the cart's context data snapshot
|
|
381
|
+
|
|
382
|
+
**When it runs:** This filter is applied at the end of the [Cart](/database/models/cart.md) model's context-data builder, which assembles a snapshot describing the current cart used by gateways and integrations that need cart context without holding the full model.
|
|
383
|
+
|
|
384
|
+
**Source:** `app/Models/Cart.php:1297`
|
|
385
|
+
|
|
386
|
+
**Parameters:**
|
|
387
|
+
|
|
388
|
+
- `$context` (array): The cart context data
|
|
389
|
+
|
|
390
|
+
```
|
|
391
|
+
$context = [
|
|
392
|
+
// ...additional cart context keys assembled earlier in the method...
|
|
393
|
+
'order_type' => 'initial', // from $cart->checkout_data['order_type'], defaults to 'initial'
|
|
394
|
+
];
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
- `$data` (array): Context data
|
|
398
|
+
|
|
399
|
+
```
|
|
400
|
+
$data = [
|
|
401
|
+
'cart' => $cart, // Cart model instance
|
|
402
|
+
];
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
**Returns:**
|
|
406
|
+
|
|
407
|
+
- `array` — The modified context data
|
|
408
|
+
|
|
409
|
+
**Usage:**
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
add_filter('fluent_cart/cart/context_data', function ($context, $data) {
|
|
413
|
+
$context['is_renewal'] = $data['cart']->checkout_data['order_type'] ?? '' === 'renewal';
|
|
414
|
+
return $context;
|
|
415
|
+
}, 10, 2);
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### ` cart/fees `
|
|
419
|
+
|
|
420
|
+
`fluent_cart/cart/fees` — Add or modify dynamic (computed) cart fees
|
|
421
|
+
|
|
422
|
+
**When it runs:** This filter is applied while calculating the cart total, after the cart's stored fees have been loaded. It lets add-ons append computed fees (e.g. a surcharge based on payment method or region) that were never persisted to the cart record.
|
|
423
|
+
|
|
424
|
+
**Source:** `app/Models/Cart.php:902`
|
|
425
|
+
|
|
426
|
+
**Parameters:**
|
|
427
|
+
|
|
428
|
+
- `$storedFees` (array): The fees already stored on the cart
|
|
429
|
+
- `$data` (array): Context data
|
|
430
|
+
|
|
431
|
+
```
|
|
432
|
+
$data = [
|
|
433
|
+
'cart' => $cart, // Cart model instance
|
|
434
|
+
'cart_items' => $cart->cart_data, // Raw cart line items
|
|
435
|
+
'cart_subtotal' => 4999, // Items subtotal, in cents
|
|
436
|
+
'shipping_total' => 500, // Shipping total, in cents
|
|
437
|
+
'customer_id' => 123, // Customer ID (or 0 for guest)
|
|
438
|
+
'payment_method' => 'stripe', // Selected payment method route
|
|
439
|
+
'checkout_data' => $cart->checkout_data, // Full checkout session data
|
|
440
|
+
];
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
**Returns:**
|
|
444
|
+
|
|
445
|
+
- `array` — The modified list of fees to apply to the cart
|
|
446
|
+
|
|
447
|
+
**Usage:**
|
|
448
|
+
|
|
449
|
+
```
|
|
450
|
+
add_filter('fluent_cart/cart/fees', function ($fees, $data) {
|
|
451
|
+
// Add a $2.00 surcharge for cash-on-delivery
|
|
452
|
+
if ($data['payment_method'] === 'cod') {
|
|
453
|
+
$fees[] = [
|
|
454
|
+
'label' => __('COD Surcharge', 'fluent-cart'),
|
|
455
|
+
'amount' => 200, // cents
|
|
456
|
+
];
|
|
457
|
+
}
|
|
458
|
+
return $fees;
|
|
459
|
+
}, 10, 2);
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### ` cart/item_dynamic_discount `
|
|
463
|
+
|
|
464
|
+
`fluent_cart/cart/item_dynamic_discount` — Filter cart item data before totals are calculated
|
|
465
|
+
|
|
466
|
+
**When it runs:** This filter is applied at the start of the cart total calculation, right after `fluent_cart/cart/before_totals_calculation` fires. It lets add-ons (e.g. a dynamic pricing module) rewrite cart line items — for example to inject a computed per-item discount — before the [CheckoutService](/database/models/cart.md) splits them into subscription and one-time items.
|
|
467
|
+
|
|
468
|
+
**Source:** `app/Models/Cart.php:1198`
|
|
469
|
+
|
|
470
|
+
**Parameters:**
|
|
471
|
+
|
|
472
|
+
- `$cartData` (array): The raw cart line items (`$cart->cart_data`)
|
|
473
|
+
- `$data` (array): Context data
|
|
474
|
+
|
|
475
|
+
```
|
|
476
|
+
$data = [
|
|
477
|
+
'cart' => $cart, // Cart model instance
|
|
478
|
+
];
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
**Returns:**
|
|
482
|
+
|
|
483
|
+
- `array` — The (possibly rewritten) cart line items
|
|
484
|
+
|
|
485
|
+
**Usage:**
|
|
486
|
+
|
|
487
|
+
```
|
|
488
|
+
add_filter('fluent_cart/cart/item_dynamic_discount', function ($cartData, $data) {
|
|
489
|
+
foreach ($cartData as &$item) {
|
|
490
|
+
// Apply a flat 10% dynamic discount to every line item
|
|
491
|
+
$item['other_info']['dynamic_discount'] = (int) round($item['unit_price'] * 0.10);
|
|
492
|
+
}
|
|
493
|
+
return $cartData;
|
|
494
|
+
}, 10, 2);
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
### ` cart/item_price `
|
|
498
|
+
|
|
499
|
+
`fluent_cart/cart/item_price` — Filter a cart line item's unit price
|
|
500
|
+
|
|
501
|
+
**When it runs:** This filter is applied when computing a line item's subtotal, right after the variation's base `item_price` is read and before it's multiplied by quantity. The filtered value is clamped to a non-negative integer.
|
|
502
|
+
|
|
503
|
+
**Source:** `app/Helpers/CartHelper.php:34`
|
|
504
|
+
|
|
505
|
+
**Parameters:**
|
|
506
|
+
|
|
507
|
+
- `$itemPrice` (int): The variation's base unit price, in cents
|
|
508
|
+
- `$data` (array): Context data
|
|
509
|
+
|
|
510
|
+
```
|
|
511
|
+
$data = [
|
|
512
|
+
'variation' => $variation, // ProductVariation model
|
|
513
|
+
'quantity' => 2, // Requested quantity
|
|
514
|
+
];
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
**Returns:**
|
|
518
|
+
|
|
519
|
+
- `int` — The (possibly modified) unit price, in cents. Negative values are clamped to `0`.
|
|
520
|
+
|
|
521
|
+
**Usage:**
|
|
522
|
+
|
|
523
|
+
```
|
|
524
|
+
add_filter('fluent_cart/cart/item_price', function ($itemPrice, $data) {
|
|
525
|
+
// Give a flat $1.00 discount per unit on a specific variation
|
|
526
|
+
if ($data['variation']->id === 42) {
|
|
527
|
+
return max(0, $itemPrice - 100);
|
|
528
|
+
}
|
|
529
|
+
return $itemPrice;
|
|
530
|
+
}, 10, 2);
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
### ` cart/items_total `
|
|
534
|
+
|
|
535
|
+
`fluent_cart/cart/items_total` — Filter the combined items + shipping total
|
|
536
|
+
|
|
537
|
+
**When it runs:** This filter is applied in `OrderService::getItemsTotal()` after the items subtotal and shipping total have been summed. The result is clamped to a non-negative integer afterward.
|
|
538
|
+
|
|
539
|
+
**Source:** `app/Services/OrderService.php:441`
|
|
540
|
+
|
|
541
|
+
**Parameters:**
|
|
542
|
+
|
|
543
|
+
- `$total` (int): The combined items + shipping total, in cents
|
|
544
|
+
- `$data` (array): Context data
|
|
545
|
+
|
|
546
|
+
```
|
|
547
|
+
$data = [
|
|
548
|
+
'items' => $items, // The order/cart items array
|
|
549
|
+
'shipping_total' => 500, // Shipping total already added in, cents
|
|
550
|
+
];
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
**Returns:**
|
|
554
|
+
|
|
555
|
+
- `int` — The modified total, in cents. Negative values are clamped to `0`.
|
|
556
|
+
|
|
557
|
+
**Usage:**
|
|
558
|
+
|
|
559
|
+
```
|
|
560
|
+
add_filter('fluent_cart/cart/items_total', function ($total, $data) {
|
|
561
|
+
// Round up to the nearest dollar
|
|
562
|
+
return (int) (ceil($total / 100) * 100);
|
|
563
|
+
}, 10, 2);
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### ` cart/shipping_total `
|
|
567
|
+
|
|
568
|
+
`fluent_cart/cart/shipping_total` — Filter the cart's shipping total
|
|
569
|
+
|
|
570
|
+
**When it runs:** This filter is applied whenever the cart's shipping charge is read — both from the [Cart](/database/models/cart.md) model's own getter and again in `CheckoutApi::placeOrder()` right before the final shipping charge is stored on the order (where the TaxModule reduces it to a net amount for tax-inclusive, reverse-charge pricing).
|
|
571
|
+
|
|
572
|
+
**Source:**
|
|
573
|
+
|
|
574
|
+
- `app/Models/Cart.php:857`
|
|
575
|
+
- `api/Checkout/CheckoutApi.php:226`
|
|
576
|
+
|
|
577
|
+
**Parameters:**
|
|
578
|
+
|
|
579
|
+
- `$shippingTotal` (int): The shipping charge, in cents
|
|
580
|
+
- `$data` (array): Context data
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
$data = [
|
|
584
|
+
'cart' => $cart, // Cart model instance
|
|
585
|
+
];
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
**Returns:**
|
|
589
|
+
|
|
590
|
+
- `int` — The modified shipping total, in cents
|
|
591
|
+
|
|
592
|
+
**Usage:**
|
|
593
|
+
|
|
594
|
+
```
|
|
595
|
+
add_filter('fluent_cart/cart/shipping_total', function ($shippingTotal, $data) {
|
|
596
|
+
// Free shipping over $75
|
|
597
|
+
if ($data['cart']->getItemsSubtotal() >= 7500) {
|
|
598
|
+
return 0;
|
|
599
|
+
}
|
|
600
|
+
return $shippingTotal;
|
|
601
|
+
}, 10, 2);
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
### ` shipping/auto_select_single_method `
|
|
605
|
+
|
|
606
|
+
`fluent_cart/shipping/auto_select_single_method` — Control whether a lone shipping method is auto-selected
|
|
607
|
+
|
|
608
|
+
**When it runs:** This filter is applied when only one shipping method is available for the cart. By default that single method is auto-selected on the customer's behalf; return `false` to require an explicit selection instead.
|
|
609
|
+
|
|
610
|
+
**Source:** `app/Helpers/CartHelper.php:905`
|
|
611
|
+
|
|
612
|
+
**Parameters:**
|
|
613
|
+
|
|
614
|
+
- `$shouldAutoSelect` (bool): Whether to auto-select the single method. Default `true`.
|
|
615
|
+
- `$data` (array): Context data
|
|
616
|
+
|
|
617
|
+
```
|
|
618
|
+
$data = [
|
|
619
|
+
'cart' => $cart, // Cart model instance
|
|
620
|
+
'method' => $method, // The single available shipping method
|
|
621
|
+
];
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
**Returns:**
|
|
625
|
+
|
|
626
|
+
- `bool` — `true` to auto-select the method, `false` to leave the selection empty
|
|
627
|
+
|
|
628
|
+
**Usage:**
|
|
629
|
+
|
|
630
|
+
```
|
|
631
|
+
add_filter('fluent_cart/shipping/auto_select_single_method', function ($shouldAutoSelect, $data) {
|
|
632
|
+
// Always require an explicit choice for local pickup
|
|
633
|
+
if ($data['method']->title === 'Local Pickup') {
|
|
634
|
+
return false;
|
|
635
|
+
}
|
|
636
|
+
return $shouldAutoSelect;
|
|
637
|
+
}, 10, 2);
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
---
|
|
641
|
+
|
|
642
|
+
## Checkout Validation
|
|
643
|
+
|
|
644
|
+
### ` checkout/validate_before_process `
|
|
645
|
+
|
|
646
|
+
`fluent_cart/checkout/validate_before_process` — Pre-validate the checkout before processing
|
|
647
|
+
|
|
648
|
+
**When it runs:** This filter fires early in the `placeOrder()` flow, before any field or product validation occurs. It is the first opportunity for modules to reject a checkout attempt (e.g., CAPTCHA verification, rate limiting, or custom business rules).
|
|
649
|
+
|
|
650
|
+
**Source:** `api/Checkout/CheckoutApi.php:114`
|
|
651
|
+
|
|
652
|
+
**Parameters:**
|
|
653
|
+
|
|
654
|
+
- `$validation` (true): Always `true` initially
|
|
655
|
+
- `$data` (array): The full checkout submission data (billing address, payment method, form fields, etc.)
|
|
656
|
+
|
|
657
|
+
**Returns:**
|
|
658
|
+
|
|
659
|
+
- `true|WP_Error` — Return `true` to continue processing, or a `WP_Error` to abort checkout with an error message
|
|
660
|
+
|
|
661
|
+
**Usage:**
|
|
662
|
+
|
|
663
|
+
```
|
|
664
|
+
add_filter('fluent_cart/checkout/validate_before_process', function ($validation, $data) {
|
|
665
|
+
// Require a minimum order amount
|
|
666
|
+
$cart = \FluentCart\App\Models\Cart::query()
|
|
667
|
+
->where('cart_hash', $data['cart_hash'])
|
|
668
|
+
->first();
|
|
669
|
+
|
|
670
|
+
if ($cart && $cart->getEstimatedTotal() < 500) {
|
|
671
|
+
return new \WP_Error(
|
|
672
|
+
'min_order',
|
|
673
|
+
__('Minimum order amount is $5.00.', 'fluent-cart')
|
|
674
|
+
);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
return $validation;
|
|
678
|
+
}, 10, 2);
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
### ` cart/tax_behavior `
|
|
682
|
+
|
|
683
|
+
`fluent_cart/cart/tax_behavior` — Filter the tax behavior amount for the cart
|
|
684
|
+
|
|
685
|
+
**When it runs:** This filter fires during order creation in `CheckoutApi::placeOrder()`. It determines the tax behavior value that controls how tax is applied to the order total. The TaxModule hooks into this to read the computed tax behavior from the cart's checkout data.
|
|
686
|
+
|
|
687
|
+
**Source:** `api/Checkout/CheckoutApi.php:216`
|
|
688
|
+
|
|
689
|
+
**Parameters:**
|
|
690
|
+
|
|
691
|
+
- `$behavior` (int): The default tax behavior value (`0`)
|
|
692
|
+
- `$data` (array): Context data
|
|
693
|
+
|
|
694
|
+
```
|
|
695
|
+
$data = [
|
|
696
|
+
'cart' => $cart, // Cart model instance
|
|
697
|
+
];
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
**Returns:**
|
|
701
|
+
|
|
702
|
+
- `int` — The tax behavior value (e.g., `0` for tax-exclusive, `1` for tax-inclusive)
|
|
703
|
+
|
|
704
|
+
**Usage:**
|
|
705
|
+
|
|
706
|
+
```
|
|
707
|
+
add_filter('fluent_cart/cart/tax_behavior', function ($behavior, $data) {
|
|
708
|
+
$cart = $data['cart'];
|
|
709
|
+
|
|
710
|
+
// Force tax-inclusive behavior for a specific region
|
|
711
|
+
$country = $cart->checkout_data['billing_address']['country'] ?? '';
|
|
712
|
+
if (in_array($country, ['DE', 'FR', 'GB'])) {
|
|
713
|
+
return 1; // Inclusive
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
return $behavior;
|
|
717
|
+
}, 10, 2);
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
### ` checkout/validate_data `
|
|
721
|
+
|
|
722
|
+
`fluent_cart/checkout/validate_data` — Add or modify checkout validation errors
|
|
723
|
+
|
|
724
|
+
**When it runs:** This filter fires after the core field, shipping, and terms validation has run, but before the order is created. It lets you append custom validation errors or clear existing ones.
|
|
725
|
+
|
|
726
|
+
**Source:** `api/Checkout/CheckoutApi.php:1042`
|
|
727
|
+
|
|
728
|
+
**Parameters:**
|
|
729
|
+
|
|
730
|
+
- `$errors` (array): Associative array of validation errors (keyed by field name)
|
|
731
|
+
- `$data` (array): Context data
|
|
732
|
+
|
|
733
|
+
```
|
|
734
|
+
$data = [
|
|
735
|
+
'data' => $submittedData, // The checkout form data
|
|
736
|
+
'cart' => $cart, // Cart model instance
|
|
737
|
+
];
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
**Returns:**
|
|
741
|
+
|
|
742
|
+
- `array` — The modified errors array. An empty array means validation passes.
|
|
743
|
+
|
|
744
|
+
**Usage:**
|
|
745
|
+
|
|
746
|
+
```
|
|
747
|
+
add_filter('fluent_cart/checkout/validate_data', function ($errors, $data) {
|
|
748
|
+
$formData = $data['data'];
|
|
749
|
+
|
|
750
|
+
// Require a phone number for physical products
|
|
751
|
+
$cart = $data['cart'];
|
|
752
|
+
if ($cart->requireShipping() && empty($formData['billing_address']['phone'])) {
|
|
753
|
+
$errors['billing_phone'] = [
|
|
754
|
+
'required' => __('Phone number is required for physical products.', 'fluent-cart'),
|
|
755
|
+
];
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
return $errors;
|
|
759
|
+
}, 10, 2);
|
|
760
|
+
```
|
|
761
|
+
|
|
762
|
+
---
|
|
763
|
+
|
|
764
|
+
## Checkout Page Rendering
|
|
765
|
+
|
|
766
|
+
### ` checkout_page_css_classes `
|
|
767
|
+
|
|
768
|
+
`fluent_cart/checkout_page_css_classes` — Modify checkout page CSS classes
|
|
769
|
+
|
|
770
|
+
**When it runs:** This filter fires when the checkout page container is being rendered. It lets you add, remove, or modify the CSS classes on the checkout wrapper element.
|
|
771
|
+
|
|
772
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php:133`
|
|
773
|
+
|
|
774
|
+
**Parameters:**
|
|
775
|
+
|
|
776
|
+
- `$classNames` (array): Array of CSS class strings
|
|
777
|
+
- `$data` (array): Context data
|
|
778
|
+
|
|
779
|
+
```
|
|
780
|
+
$data = [
|
|
781
|
+
'cart' => $cart, // Cart model instance
|
|
782
|
+
];
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
**Returns:**
|
|
786
|
+
|
|
787
|
+
- `array` — The modified array of CSS class strings
|
|
788
|
+
|
|
789
|
+
**Usage:**
|
|
790
|
+
|
|
791
|
+
```
|
|
792
|
+
add_filter('fluent_cart/checkout_page_css_classes', function ($classes, $data) {
|
|
793
|
+
$cart = $data['cart'];
|
|
794
|
+
|
|
795
|
+
// Add a class when cart has subscription items
|
|
796
|
+
if ($cart->hasSubscription()) {
|
|
797
|
+
$classes[] = 'has-subscription-items';
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
return $classes;
|
|
801
|
+
}, 10, 2);
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
### ` checkout_page_notices `
|
|
805
|
+
|
|
806
|
+
`fluent_cart/checkout_page_notices` — Add custom notices to the checkout page
|
|
807
|
+
|
|
808
|
+
**When it runs:** This filter fires during checkout page rendering, allowing you to inject notice messages that appear at the top of the checkout form.
|
|
809
|
+
|
|
810
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php:160`
|
|
811
|
+
|
|
812
|
+
**Parameters:**
|
|
813
|
+
|
|
814
|
+
- `$notices` (array): Array of notice items (empty by default)
|
|
815
|
+
- `$data` (array): Context data
|
|
816
|
+
|
|
817
|
+
```
|
|
818
|
+
$data = [
|
|
819
|
+
'cart' => $cart, // Cart model instance
|
|
820
|
+
];
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
**Returns:**
|
|
824
|
+
|
|
825
|
+
- `array` — Array of notice items to display
|
|
826
|
+
|
|
827
|
+
**Usage:**
|
|
828
|
+
|
|
829
|
+
```
|
|
830
|
+
add_filter('fluent_cart/checkout_page_notices', function ($notices, $data) {
|
|
831
|
+
$cart = $data['cart'];
|
|
832
|
+
|
|
833
|
+
// Show a free shipping notice
|
|
834
|
+
$total = $cart->getEstimatedTotal();
|
|
835
|
+
if ($total < 5000 && $cart->requireShipping()) {
|
|
836
|
+
$notices[] = [
|
|
837
|
+
'type' => 'info',
|
|
838
|
+
'message' => sprintf(
|
|
839
|
+
__('Add %s more to qualify for free shipping!', 'fluent-cart'),
|
|
840
|
+
'$' . number_format((5000 - $total) / 100, 2)
|
|
841
|
+
),
|
|
842
|
+
];
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
return $notices;
|
|
846
|
+
}, 10, 2);
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
### ` checkout/summary_extra_lines `
|
|
850
|
+
|
|
851
|
+
`fluent_cart/checkout/summary_extra_lines` — Add extra rendered lines to the checkout order summary
|
|
852
|
+
|
|
853
|
+
**When it runs:** This filter is applied while rendering the order summary sidebar (`CartSummaryRender`), right after the fee rows are rendered and before the total. It lets add-ons inject additional line items into the summary.
|
|
854
|
+
|
|
855
|
+
**Source:** `app/Services/Renderer/CartSummaryRender.php:123`
|
|
856
|
+
|
|
857
|
+
**Parameters:**
|
|
858
|
+
|
|
859
|
+
- `$extraLines` (array): Extra summary line items. Empty by default.
|
|
860
|
+
- `$data` (array): Context data
|
|
861
|
+
|
|
862
|
+
```
|
|
863
|
+
$data = [
|
|
864
|
+
'cart' => $cart, // Cart model instance
|
|
865
|
+
];
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
**Returns:**
|
|
869
|
+
|
|
870
|
+
- `array` — The extra line items to render in the order summary (a non-array return is discarded and treated as empty)
|
|
871
|
+
|
|
872
|
+
**Usage:**
|
|
873
|
+
|
|
874
|
+
```
|
|
875
|
+
add_filter('fluent_cart/checkout/summary_extra_lines', function ($extraLines, $data) {
|
|
876
|
+
$extraLines[] = [
|
|
877
|
+
'label' => __('Estimated delivery', 'fluent-cart'),
|
|
878
|
+
'value' => '3-5 business days',
|
|
879
|
+
];
|
|
880
|
+
return $extraLines;
|
|
881
|
+
}, 10, 2);
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
### ` checkout_renderer/billing_fields `
|
|
885
|
+
|
|
886
|
+
`fluent_cart/checkout_renderer/billing_fields` — Modify rendered billing fields on the checkout page
|
|
887
|
+
|
|
888
|
+
**When it runs:** This filter fires after the billing address fields have been assembled and rearranged in the checkout renderer. It allows modification of the fully prepared billing field HTML structures before output.
|
|
889
|
+
|
|
890
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php:558`
|
|
891
|
+
|
|
892
|
+
**Parameters:**
|
|
893
|
+
|
|
894
|
+
- `$billingFields` (array): Array of billing field definitions with their rendered state
|
|
895
|
+
- `$data` (array): Context data
|
|
896
|
+
|
|
897
|
+
```
|
|
898
|
+
$data = [
|
|
899
|
+
'checkout_renderer' => $renderer, // CheckoutRenderer instance
|
|
900
|
+
'cart' => $cart, // Cart model instance
|
|
901
|
+
];
|
|
902
|
+
```
|
|
903
|
+
|
|
904
|
+
**Returns:**
|
|
905
|
+
|
|
906
|
+
- `array` — The modified billing fields array
|
|
907
|
+
|
|
908
|
+
**Usage:**
|
|
909
|
+
|
|
910
|
+
```
|
|
911
|
+
add_filter('fluent_cart/checkout_renderer/billing_fields', function ($fields, $data) {
|
|
912
|
+
// Remove the company field from rendered billing fields
|
|
913
|
+
foreach ($fields as $sectionKey => &$section) {
|
|
914
|
+
if (isset($section['schema']) && is_array($section['schema'])) {
|
|
915
|
+
unset($section['schema']['billing_company']);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
return $fields;
|
|
920
|
+
}, 10, 2);
|
|
921
|
+
```
|
|
922
|
+
|
|
923
|
+
### ` checkout_renderer/shipping_fields `
|
|
924
|
+
|
|
925
|
+
`fluent_cart/checkout_renderer/shipping_fields` — Modify rendered shipping fields on the checkout page
|
|
926
|
+
|
|
927
|
+
**When it runs:** This filter fires after shipping address fields have been assembled and validated in the checkout renderer, before they are output as HTML.
|
|
928
|
+
|
|
929
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php:631`
|
|
930
|
+
|
|
931
|
+
**Parameters:**
|
|
932
|
+
|
|
933
|
+
- `$shippingFields` (array): Array of shipping field definitions
|
|
934
|
+
- `$data` (array): Context data
|
|
935
|
+
|
|
936
|
+
```
|
|
937
|
+
$data = [
|
|
938
|
+
'checkout_renderer' => $renderer, // CheckoutRenderer instance
|
|
939
|
+
'cart' => $cart, // Cart model instance
|
|
940
|
+
];
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
**Returns:**
|
|
944
|
+
|
|
945
|
+
- `array` — The modified shipping fields array
|
|
946
|
+
|
|
947
|
+
**Usage:**
|
|
948
|
+
|
|
949
|
+
```
|
|
950
|
+
add_filter('fluent_cart/checkout_renderer/shipping_fields', function ($fields, $data) {
|
|
951
|
+
// Make the address line 2 required for shipping
|
|
952
|
+
foreach ($fields as &$field) {
|
|
953
|
+
if (isset($field['name']) && $field['name'] === 'shipping_address_2') {
|
|
954
|
+
$field['required'] = 'yes';
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
return $fields;
|
|
959
|
+
}, 10, 2);
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
### ` disable_order_notes_for_digital_products `
|
|
963
|
+
|
|
964
|
+
`fluent_cart/disable_order_notes_for_digital_products` — Control order notes visibility for digital products
|
|
965
|
+
|
|
966
|
+
**When it runs:** This filter fires when the checkout renderer decides whether to show the order notes textarea. By default, order notes are hidden when the cart contains only digital (non-shippable) products.
|
|
967
|
+
|
|
968
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php:670`
|
|
969
|
+
|
|
970
|
+
**Parameters:**
|
|
971
|
+
|
|
972
|
+
- `$disable` (bool): Whether to hide order notes for digital-only carts. Default `true`.
|
|
973
|
+
- `$data` (array): Context data
|
|
974
|
+
|
|
975
|
+
```
|
|
976
|
+
$data = [
|
|
977
|
+
'cart' => $cart, // Cart model instance
|
|
978
|
+
];
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
**Returns:**
|
|
982
|
+
|
|
983
|
+
- `bool` — `true` to hide order notes for digital products, `false` to always show them
|
|
984
|
+
|
|
985
|
+
**Usage:**
|
|
986
|
+
|
|
987
|
+
```
|
|
988
|
+
add_filter('fluent_cart/disable_order_notes_for_digital_products', function ($disable, $data) {
|
|
989
|
+
// Always show order notes, even for digital products
|
|
990
|
+
return false;
|
|
991
|
+
}, 10, 2);
|
|
992
|
+
```
|
|
993
|
+
|
|
994
|
+
### ` checkout_active_payment_methods `
|
|
995
|
+
|
|
996
|
+
`fluent_cart/checkout_active_payment_methods` — Filter active payment methods on the checkout page
|
|
997
|
+
|
|
998
|
+
**When it runs:** This filter fires when listing the available payment methods on both the standard checkout and modal checkout renderers. It lets you add, remove, or reorder payment gateway instances.
|
|
999
|
+
|
|
1000
|
+
**Source:**
|
|
1001
|
+
|
|
1002
|
+
- `app/Services/Renderer/CheckoutRenderer.php:781`
|
|
1003
|
+
- `app/Services/Renderer/ModalCheckoutRenderer.php:675`
|
|
1004
|
+
|
|
1005
|
+
**Parameters:**
|
|
1006
|
+
|
|
1007
|
+
- `$activePaymentMethods` (array): Array of payment method instances
|
|
1008
|
+
- `$data` (array): Context data
|
|
1009
|
+
|
|
1010
|
+
```
|
|
1011
|
+
$data = [
|
|
1012
|
+
'cart' => $cart, // Cart model instance
|
|
1013
|
+
];
|
|
1014
|
+
```
|
|
1015
|
+
|
|
1016
|
+
**Returns:**
|
|
1017
|
+
|
|
1018
|
+
- `array` — The modified array of payment method instances
|
|
1019
|
+
|
|
1020
|
+
**Usage:**
|
|
1021
|
+
|
|
1022
|
+
```
|
|
1023
|
+
add_filter('fluent_cart/checkout_active_payment_methods', function ($methods, $data) {
|
|
1024
|
+
$cart = $data['cart'];
|
|
1025
|
+
|
|
1026
|
+
// Remove COD for orders over $500
|
|
1027
|
+
if ($cart->getEstimatedTotal() > 50000) {
|
|
1028
|
+
$methods = array_filter($methods, function ($method) {
|
|
1029
|
+
return $method->getMeta('route') !== 'cod';
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
return array_values($methods);
|
|
1034
|
+
}, 10, 2);
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
### ` checkout_page_order_button_text `
|
|
1038
|
+
|
|
1039
|
+
`fluent_cart/checkout_page_order_button_text` — Customize the place order button text
|
|
1040
|
+
|
|
1041
|
+
**When it runs:** This filter fires when the checkout submit button is being rendered, allowing you to change its label.
|
|
1042
|
+
|
|
1043
|
+
**Source:** `app/Services/Renderer/CheckoutRenderer.php:840`
|
|
1044
|
+
|
|
1045
|
+
**Parameters:**
|
|
1046
|
+
|
|
1047
|
+
- `$text` (string): The button text. Default: `__('Place order', 'fluent-cart')`
|
|
1048
|
+
|
|
1049
|
+
**Returns:**
|
|
1050
|
+
|
|
1051
|
+
- `string` — The modified button text
|
|
1052
|
+
|
|
1053
|
+
**Usage:**
|
|
1054
|
+
|
|
1055
|
+
```
|
|
1056
|
+
add_filter('fluent_cart/checkout_page_order_button_text', function ($text) {
|
|
1057
|
+
return __('Complete Purchase', 'fluent-cart');
|
|
1058
|
+
});
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
### ` payment_method_list_class `
|
|
1062
|
+
|
|
1063
|
+
`fluent_cart/payment_method_list_class` — Add CSS classes to a payment method wrapper
|
|
1064
|
+
|
|
1065
|
+
**When it runs:** Fires when rendering each individual payment method option, in both the standard and the modal checkout. The returned string is appended to the payment method wrapper's class attribute.
|
|
1066
|
+
|
|
1067
|
+
**Source:**
|
|
1068
|
+
|
|
1069
|
+
- `app/Services/Renderer/CheckoutRenderer.php:938`
|
|
1070
|
+
- `app/Services/Renderer/ModalCheckoutRenderer.php:806`
|
|
1071
|
+
|
|
1072
|
+
**Parameters:**
|
|
1073
|
+
|
|
1074
|
+
- `$class` (string): The CSS class string, already possibly modified by the deprecated filter above
|
|
1075
|
+
- `$data` (array): Context data
|
|
1076
|
+
|
|
1077
|
+
```
|
|
1078
|
+
$data = [
|
|
1079
|
+
'route' => 'stripe', // Payment method route/slug
|
|
1080
|
+
'method_title' => 'Stripe', // Display title
|
|
1081
|
+
'method_style' => 'logo', // Display style
|
|
1082
|
+
];
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
**Returns:**
|
|
1086
|
+
|
|
1087
|
+
- `string` — The modified CSS class string
|
|
1088
|
+
|
|
1089
|
+
**Usage:**
|
|
1090
|
+
|
|
1091
|
+
```
|
|
1092
|
+
add_filter('fluent_cart/payment_method_list_class', function ($class, $data) {
|
|
1093
|
+
if ($data['route'] === 'stripe') {
|
|
1094
|
+
return trim($class . ' payment-method-recommended');
|
|
1095
|
+
}
|
|
1096
|
+
return $class;
|
|
1097
|
+
}, 10, 2);
|
|
1098
|
+
```
|
|
1099
|
+
|
|
1100
|
+
### ` modal_checkout/filter_active_payment_methods `
|
|
1101
|
+
|
|
1102
|
+
`fluent_cart/modal_checkout/filter_active_payment_methods` — Restrict payment methods in modal checkout
|
|
1103
|
+
|
|
1104
|
+
**When it runs:** This filter fires during modal checkout rendering, after the active payment methods have been resolved. If a non-empty array of payment method route slugs is returned, only those methods will be shown in the modal.
|
|
1105
|
+
|
|
1106
|
+
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:680`
|
|
1107
|
+
|
|
1108
|
+
**Parameters:**
|
|
1109
|
+
|
|
1110
|
+
- `$selectedMethods` (array): Empty array by default
|
|
1111
|
+
|
|
1112
|
+
**Returns:**
|
|
1113
|
+
|
|
1114
|
+
- `array` — Array of payment method route slugs to show (e.g., `['stripe', 'paypal']`). An empty array shows all active methods.
|
|
1115
|
+
|
|
1116
|
+
**Usage:**
|
|
1117
|
+
|
|
1118
|
+
```
|
|
1119
|
+
add_filter('fluent_cart/modal_checkout/filter_active_payment_methods', function ($methods) {
|
|
1120
|
+
// Only show Stripe in the modal checkout
|
|
1121
|
+
return ['stripe'];
|
|
1122
|
+
});
|
|
1123
|
+
```
|
|
1124
|
+
|
|
1125
|
+
### ` modal_checkout/before_payment_methods_placement `
|
|
1126
|
+
|
|
1127
|
+
`fluent_cart/modal_checkout/before_payment_methods_placement` — Choose where the pre-payment-methods action fires in modal checkout
|
|
1128
|
+
|
|
1129
|
+
**When it runs:** This filter is applied once per modal checkout render to decide where the `fluent_cart/before_payment_methods` action hook fires: alongside the payment method list (`'payment'`, the default) or with the order details block (`'details'`). Any value other than `'details'` falls back to `'payment'`.
|
|
1130
|
+
|
|
1131
|
+
**Source:** `app/Services/Renderer/ModalCheckoutRenderer.php:216`
|
|
1132
|
+
|
|
1133
|
+
**Parameters:**
|
|
1134
|
+
|
|
1135
|
+
- `$placement` (string): The placement. Default `'payment'`.
|
|
1136
|
+
- `$data` (array): Context data
|
|
1137
|
+
|
|
1138
|
+
```
|
|
1139
|
+
$data = [
|
|
1140
|
+
'cart' => $cart, // Cart model instance
|
|
1141
|
+
];
|
|
1142
|
+
```
|
|
1143
|
+
|
|
1144
|
+
**Returns:**
|
|
1145
|
+
|
|
1146
|
+
- `string` — `'payment'` or `'details'`
|
|
1147
|
+
|
|
1148
|
+
**Usage:**
|
|
1149
|
+
|
|
1150
|
+
```
|
|
1151
|
+
add_filter('fluent_cart/modal_checkout/before_payment_methods_placement', function ($placement, $data) {
|
|
1152
|
+
// Move the hook next to the order details block instead
|
|
1153
|
+
return 'details';
|
|
1154
|
+
}, 10, 2);
|
|
1155
|
+
```
|
|
1156
|
+
|
|
1157
|
+
### ` enable_modal_checkout `
|
|
1158
|
+
|
|
1159
|
+
`fluent_cart/enable_modal_checkout` — Enable or disable modal checkout
|
|
1160
|
+
|
|
1161
|
+
**When it runs:** This filter fires when checking whether modal (popup) checkout is enabled. By default, modal checkout is disabled.
|
|
1162
|
+
|
|
1163
|
+
**Source:** `app/Helpers/Helper.php:1928`
|
|
1164
|
+
|
|
1165
|
+
**Parameters:**
|
|
1166
|
+
|
|
1167
|
+
- `$enabled` (bool): Whether modal checkout is enabled. Default: `false`
|
|
1168
|
+
|
|
1169
|
+
**Returns:**
|
|
1170
|
+
|
|
1171
|
+
- `bool` — `true` to enable modal checkout, `false` to use the standard checkout page
|
|
1172
|
+
|
|
1173
|
+
**Usage:**
|
|
1174
|
+
|
|
1175
|
+
```
|
|
1176
|
+
add_filter('fluent_cart/enable_modal_checkout', function ($enabled) {
|
|
1177
|
+
// Enable modal checkout
|
|
1178
|
+
return true;
|
|
1179
|
+
});
|
|
1180
|
+
```
|
|
1181
|
+
|
|
1182
|
+
---
|
|
1183
|
+
|
|
1184
|
+
## Checkout Data & Session
|
|
1185
|
+
|
|
1186
|
+
### ` checkout/checkout_data_changed `
|
|
1187
|
+
|
|
1188
|
+
`fluent_cart/checkout/checkout_data_changed` — Modify checkout data after a change is detected
|
|
1189
|
+
|
|
1190
|
+
**When it runs:** This filter fires after checkout session data has been patched and saved, letting you modify the response data that is sent back to the browser. It runs in both the standard and AJAX checkout data change handlers.
|
|
1191
|
+
|
|
1192
|
+
**Source:**
|
|
1193
|
+
|
|
1194
|
+
- `app/Hooks/Cart/WebCheckoutHandler.php:495`
|
|
1195
|
+
- `app/Hooks/Cart/WebCheckoutHandler.php:1115`
|
|
1196
|
+
|
|
1197
|
+
**Parameters:**
|
|
1198
|
+
|
|
1199
|
+
- `$checkoutData` (array): The checkout change response data
|
|
1200
|
+
|
|
1201
|
+
```
|
|
1202
|
+
$checkoutData = [
|
|
1203
|
+
'message' => 'Data saved',
|
|
1204
|
+
'fragments' => [...],
|
|
1205
|
+
'estimated_total' => 15000,
|
|
1206
|
+
'estimated_total_changed' => true,
|
|
1207
|
+
'totals' => [
|
|
1208
|
+
'old' => 14000,
|
|
1209
|
+
'new' => 15000,
|
|
1210
|
+
],
|
|
1211
|
+
'tax_total_changes' => false,
|
|
1212
|
+
'shipping_charge_changes' => true,
|
|
1213
|
+
];
|
|
1214
|
+
```
|
|
1215
|
+
|
|
1216
|
+
- `$data` (array): Context data
|
|
1217
|
+
|
|
1218
|
+
```
|
|
1219
|
+
$data = [
|
|
1220
|
+
'cart' => $cart, // Cart model instance
|
|
1221
|
+
];
|
|
1222
|
+
```
|
|
1223
|
+
|
|
1224
|
+
**Returns:**
|
|
1225
|
+
|
|
1226
|
+
- `array` — The modified checkout data response
|
|
1227
|
+
|
|
1228
|
+
**Usage:**
|
|
1229
|
+
|
|
1230
|
+
```
|
|
1231
|
+
add_filter('fluent_cart/checkout/checkout_data_changed', function ($checkoutData, $data) {
|
|
1232
|
+
// Add custom data to the response
|
|
1233
|
+
$checkoutData['custom_notice'] = __('Your order qualifies for a bonus!', 'fluent-cart');
|
|
1234
|
+
return $checkoutData;
|
|
1235
|
+
}, 10, 2);
|
|
1236
|
+
```
|
|
1237
|
+
|
|
1238
|
+
### ` checkout/cart_updated `
|
|
1239
|
+
|
|
1240
|
+
`fluent_cart/checkout/cart_updated` — Filter the cart update response data
|
|
1241
|
+
|
|
1242
|
+
**When it runs:** This filter fires when the cart has been updated during the checkout session (e.g., items added or removed). It lets you append additional data to the success response.
|
|
1243
|
+
|
|
1244
|
+
**Source:** `app/Hooks/Cart/WebCheckoutHandler.php:750`
|
|
1245
|
+
|
|
1246
|
+
**Parameters:**
|
|
1247
|
+
|
|
1248
|
+
- `$data` (array): The response data
|
|
1249
|
+
|
|
1250
|
+
```
|
|
1251
|
+
$data = [
|
|
1252
|
+
'cart' => $cart, // The updated Cart model instance
|
|
1253
|
+
];
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
**Returns:**
|
|
1257
|
+
|
|
1258
|
+
- `array` — The modified response data array
|
|
1259
|
+
|
|
1260
|
+
**Usage:**
|
|
1261
|
+
|
|
1262
|
+
```
|
|
1263
|
+
add_filter('fluent_cart/checkout/cart_updated', function ($data) {
|
|
1264
|
+
$cart = $data['cart'];
|
|
1265
|
+
$data['item_count'] = count($cart->getItems());
|
|
1266
|
+
$data['free_shipping_eligible'] = $cart->getEstimatedTotal() >= 5000;
|
|
1267
|
+
return $data;
|
|
1268
|
+
});
|
|
1269
|
+
```
|
|
1270
|
+
|
|
1271
|
+
### ` checkout/before_patch_checkout_data `
|
|
1272
|
+
|
|
1273
|
+
`fluent_cart/checkout/before_patch_checkout_data` — Modify fill data before patching the checkout session
|
|
1274
|
+
|
|
1275
|
+
**When it runs:** This filter fires before the checkout session data is persisted to the database. Modules like Shipping and Tax hook in to recalculate charges whenever address or form data changes.
|
|
1276
|
+
|
|
1277
|
+
**Source:**
|
|
1278
|
+
|
|
1279
|
+
- `app/Hooks/Cart/WebCheckoutHandler.php:791`
|
|
1280
|
+
- `app/Hooks/Cart/WebCheckoutHandler.php:967`
|
|
1281
|
+
|
|
1282
|
+
**Parameters:**
|
|
1283
|
+
|
|
1284
|
+
- `$fillData` (array): The data to be merged into the cart's checkout session
|
|
1285
|
+
|
|
1286
|
+
```
|
|
1287
|
+
$fillData = [
|
|
1288
|
+
'checkout_data' => [...], // Checkout data to persist
|
|
1289
|
+
'cart_data' => [...], // Cart data updates
|
|
1290
|
+
'hook_changes' => [
|
|
1291
|
+
'shipping' => false, // Whether shipping was recalculated
|
|
1292
|
+
'tax' => false, // Whether tax was recalculated
|
|
1293
|
+
],
|
|
1294
|
+
];
|
|
1295
|
+
```
|
|
1296
|
+
|
|
1297
|
+
- `$data` (array): Context data
|
|
1298
|
+
|
|
1299
|
+
```
|
|
1300
|
+
$data = [
|
|
1301
|
+
'cart' => $cart, // Cart model instance
|
|
1302
|
+
'prev_data' => $prevFlatData, // Previous checkout data
|
|
1303
|
+
'changes' => $normalizeData, // The incoming changes
|
|
1304
|
+
'all_data' => $allData, // All submitted data
|
|
1305
|
+
];
|
|
1306
|
+
```
|
|
1307
|
+
|
|
1308
|
+
**Returns:**
|
|
1309
|
+
|
|
1310
|
+
- `array` — The modified fill data
|
|
1311
|
+
|
|
1312
|
+
**Usage:**
|
|
1313
|
+
|
|
1314
|
+
```
|
|
1315
|
+
add_filter('fluent_cart/checkout/before_patch_checkout_data', function ($fillData, $data) {
|
|
1316
|
+
$cart = $data['cart'];
|
|
1317
|
+
$changes = $data['changes'];
|
|
1318
|
+
|
|
1319
|
+
// Recalculate a custom surcharge when the country changes
|
|
1320
|
+
if (isset($changes['billing_country'])) {
|
|
1321
|
+
$surcharge = MyModule::calculateSurcharge($changes['billing_country']);
|
|
1322
|
+
$fillData['checkout_data']['custom_surcharge'] = $surcharge;
|
|
1323
|
+
$fillData['hook_changes']['custom'] = true;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
return $fillData;
|
|
1327
|
+
}, 10, 2);
|
|
1328
|
+
```
|
|
1329
|
+
|
|
1330
|
+
### ` checkout/after_patch_checkout_data_fragments `
|
|
1331
|
+
|
|
1332
|
+
`fluent_cart/checkout/after_patch_checkout_data_fragments` — Modify HTML fragments returned after patching checkout data
|
|
1333
|
+
|
|
1334
|
+
**When it runs:** This filter fires after the checkout session has been patched and the HTML fragments for the AJAX response have been generated. It allows modules to add or modify the HTML fragments that will be swapped into the checkout page.
|
|
1335
|
+
|
|
1336
|
+
**Source:** `app/Hooks/Cart/WebCheckoutHandler.php:1019`
|
|
1337
|
+
|
|
1338
|
+
**Parameters:**
|
|
1339
|
+
|
|
1340
|
+
- `$fragments` (array): Associative array of HTML fragment selectors and content
|
|
1341
|
+
- `$data` (array): Context data
|
|
1342
|
+
|
|
1343
|
+
```
|
|
1344
|
+
$data = [
|
|
1345
|
+
'cart' => $cart, // Cart model instance
|
|
1346
|
+
'changes' => $normalizeData, // The changes that were applied
|
|
1347
|
+
];
|
|
1348
|
+
```
|
|
1349
|
+
|
|
1350
|
+
**Returns:**
|
|
1351
|
+
|
|
1352
|
+
- `array` — The modified fragments array
|
|
1353
|
+
|
|
1354
|
+
**Usage:**
|
|
1355
|
+
|
|
1356
|
+
```
|
|
1357
|
+
add_filter('fluent_cart/checkout/after_patch_checkout_data_fragments', function ($fragments, $data) {
|
|
1358
|
+
$cart = $data['cart'];
|
|
1359
|
+
|
|
1360
|
+
// Add a custom fragment for a surcharge display
|
|
1361
|
+
$fragments['.custom-surcharge-display'] = [
|
|
1362
|
+
'content' => '<span class="custom-surcharge">' . esc_html('$5.00') . '</span>',
|
|
1363
|
+
'type' => 'replace',
|
|
1364
|
+
];
|
|
1365
|
+
|
|
1366
|
+
return $fragments;
|
|
1367
|
+
}, 10, 2);
|
|
1368
|
+
```
|
|
1369
|
+
|
|
1370
|
+
### ` apply_order_bump `
|
|
1371
|
+
|
|
1372
|
+
`fluent_cart/apply_order_bump` — Handle order bump application on the checkout page
|
|
1373
|
+
|
|
1374
|
+
**When it runs:** This filter fires when a customer toggles an order bump on the checkout page. By default it returns a `WP_Error`; modules that implement order bumps must hook in to handle the logic and return success data.
|
|
1375
|
+
|
|
1376
|
+
**Source:** `app/Hooks/Cart/WebCheckoutHandler.php:1052`
|
|
1377
|
+
|
|
1378
|
+
**Parameters:**
|
|
1379
|
+
|
|
1380
|
+
- `$response` (WP_Error): Default error response
|
|
1381
|
+
- `$data` (array): Context data
|
|
1382
|
+
|
|
1383
|
+
```
|
|
1384
|
+
$data = [
|
|
1385
|
+
'bump_id' => 5, // The order bump ID
|
|
1386
|
+
'cart' => $cart, // Cart model instance
|
|
1387
|
+
'request_data' => $requestData, // The full request data
|
|
1388
|
+
];
|
|
1389
|
+
```
|
|
1390
|
+
|
|
1391
|
+
**Returns:**
|
|
1392
|
+
|
|
1393
|
+
- `array|WP_Error` — Return an array with success data to apply the bump, or a `WP_Error` to reject it
|
|
1394
|
+
|
|
1395
|
+
**Usage:**
|
|
1396
|
+
|
|
1397
|
+
```
|
|
1398
|
+
add_filter('fluent_cart/apply_order_bump', function ($response, $data) {
|
|
1399
|
+
$bumpId = $data['bump_id'];
|
|
1400
|
+
$cart = $data['cart'];
|
|
1401
|
+
|
|
1402
|
+
$bump = MyOrderBumpModule::find($bumpId);
|
|
1403
|
+
if (!$bump) {
|
|
1404
|
+
return $response; // Keep the WP_Error
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
// Apply the bump to the cart
|
|
1408
|
+
$cart->addItem($bump->variation_id, 1);
|
|
1409
|
+
|
|
1410
|
+
return [
|
|
1411
|
+
'message' => __('Order bump applied!', 'fluent-cart'),
|
|
1412
|
+
'cart' => $cart,
|
|
1413
|
+
];
|
|
1414
|
+
}, 10, 2);
|
|
1415
|
+
```
|
|
1416
|
+
|
|
1417
|
+
---
|
|
1418
|
+
|
|
1419
|
+
## Checkout Field Schema
|
|
1420
|
+
|
|
1421
|
+
### ` checkout_address_fields `
|
|
1422
|
+
|
|
1423
|
+
`fluent_cart/checkout_address_fields` — Modify address field definitions
|
|
1424
|
+
|
|
1425
|
+
**When it runs:** This filter fires when the address field schema is built inside `CartCheckoutHelper`. It controls which fields appear in both billing and shipping address sections.
|
|
1426
|
+
|
|
1427
|
+
**Source:** `app/Helpers/CartCheckoutHelper.php:692`
|
|
1428
|
+
|
|
1429
|
+
**Parameters:**
|
|
1430
|
+
|
|
1431
|
+
- `$fields` (array): Associative array of address field definitions
|
|
1432
|
+
|
|
1433
|
+
**Returns:**
|
|
1434
|
+
|
|
1435
|
+
- `array` — The modified fields array
|
|
1436
|
+
|
|
1437
|
+
**Usage:**
|
|
1438
|
+
|
|
1439
|
+
```
|
|
1440
|
+
add_filter('fluent_cart/checkout_address_fields', function ($fields) {
|
|
1441
|
+
// Add a company field
|
|
1442
|
+
$fields['company'] = [
|
|
1443
|
+
'label' => __('Company Name', 'fluent-cart'),
|
|
1444
|
+
'type' => 'text',
|
|
1445
|
+
'required' => false,
|
|
1446
|
+
];
|
|
1447
|
+
|
|
1448
|
+
return $fields;
|
|
1449
|
+
});
|
|
1450
|
+
```
|
|
1451
|
+
|
|
1452
|
+
### ` checkout_billing_fields `
|
|
1453
|
+
|
|
1454
|
+
`fluent_cart/checkout_billing_fields` — Modify billing address field schema
|
|
1455
|
+
|
|
1456
|
+
**When it runs:** This filter fires when the billing fields are being assembled in `CartCheckoutHelper`. It runs after address fields have been merged with account creation options and section labels.
|
|
1457
|
+
|
|
1458
|
+
**Source:** `app/Helpers/CartCheckoutHelper.php:730`
|
|
1459
|
+
|
|
1460
|
+
**Parameters:**
|
|
1461
|
+
|
|
1462
|
+
- `$fields` (array): The billing field definitions organized in sections
|
|
1463
|
+
- `$data` (array): Context data
|
|
1464
|
+
|
|
1465
|
+
```
|
|
1466
|
+
$data = [
|
|
1467
|
+
'viewData' => $viewData, // Block/view configuration data
|
|
1468
|
+
'customer' => $customer, // Current customer (or null)
|
|
1469
|
+
'labels' => $labels, // Custom labels from block settings
|
|
1470
|
+
'has_subscription' => false, // Whether the cart has subscription items
|
|
1471
|
+
];
|
|
1472
|
+
```
|
|
1473
|
+
|
|
1474
|
+
**Returns:**
|
|
1475
|
+
|
|
1476
|
+
- `array` — The modified billing fields array
|
|
1477
|
+
|
|
1478
|
+
**Usage:**
|
|
1479
|
+
|
|
1480
|
+
```
|
|
1481
|
+
add_filter('fluent_cart/checkout_billing_fields', function ($fields, $data) {
|
|
1482
|
+
// Make the phone field required when cart has subscriptions
|
|
1483
|
+
if ($data['has_subscription']) {
|
|
1484
|
+
if (isset($fields['address_section']['schema']['billing_phone'])) {
|
|
1485
|
+
$fields['address_section']['schema']['billing_phone']['required'] = 'yes';
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
return $fields;
|
|
1490
|
+
}, 10, 2);
|
|
1491
|
+
```
|
|
1492
|
+
|
|
1493
|
+
### ` checkout_shipping_fields `
|
|
1494
|
+
|
|
1495
|
+
`fluent_cart/checkout_shipping_fields` — Modify shipping address field schema
|
|
1496
|
+
|
|
1497
|
+
**When it runs:** This filter fires when the shipping address fields are being assembled in `CartCheckoutHelper`.
|
|
1498
|
+
|
|
1499
|
+
**Source:** `app/Helpers/CartCheckoutHelper.php:771`
|
|
1500
|
+
|
|
1501
|
+
**Parameters:**
|
|
1502
|
+
|
|
1503
|
+
- `$fields` (array): The shipping field definitions organized in sections
|
|
1504
|
+
- `$data` (array): Context data
|
|
1505
|
+
|
|
1506
|
+
```
|
|
1507
|
+
$data = [
|
|
1508
|
+
'viewData' => $viewData, // Block/view configuration data
|
|
1509
|
+
'labels' => $labels, // Custom labels from block settings
|
|
1510
|
+
];
|
|
1511
|
+
```
|
|
1512
|
+
|
|
1513
|
+
**Returns:**
|
|
1514
|
+
|
|
1515
|
+
- `array` — The modified shipping fields array
|
|
1516
|
+
|
|
1517
|
+
**Usage:**
|
|
1518
|
+
|
|
1519
|
+
```
|
|
1520
|
+
add_filter('fluent_cart/checkout_shipping_fields', function ($fields, $data) {
|
|
1521
|
+
// Remove address line 2 from shipping
|
|
1522
|
+
if (isset($fields['address_section']['schema']['shipping_address_2'])) {
|
|
1523
|
+
unset($fields['address_section']['schema']['shipping_address_2']);
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
return $fields;
|
|
1527
|
+
}, 10, 2);
|
|
1528
|
+
```
|
|
1529
|
+
|
|
1530
|
+
### ` checkout_signup_fields `
|
|
1531
|
+
|
|
1532
|
+
`fluent_cart/checkout_signup_fields` — Modify the account signup form fields
|
|
1533
|
+
|
|
1534
|
+
**When it runs:** This filter fires when the guest checkout signup form fields (username, email, password) are assembled.
|
|
1535
|
+
|
|
1536
|
+
**Source:** `app/Helpers/CartCheckoutHelper.php:846`
|
|
1537
|
+
|
|
1538
|
+
**Parameters:**
|
|
1539
|
+
|
|
1540
|
+
- `$fields` (array): Associative array of signup field definitions
|
|
1541
|
+
|
|
1542
|
+
```
|
|
1543
|
+
$fields = [
|
|
1544
|
+
'user_login' => [
|
|
1545
|
+
'type' => 'text',
|
|
1546
|
+
'label' => 'Username or Email',
|
|
1547
|
+
'required' => 'yes',
|
|
1548
|
+
...
|
|
1549
|
+
],
|
|
1550
|
+
'user_pass' => [
|
|
1551
|
+
'type' => 'password',
|
|
1552
|
+
'label' => 'Password',
|
|
1553
|
+
'required' => 'no',
|
|
1554
|
+
...
|
|
1555
|
+
],
|
|
1556
|
+
];
|
|
1557
|
+
```
|
|
1558
|
+
|
|
1559
|
+
**Returns:**
|
|
1560
|
+
|
|
1561
|
+
- `array` — The modified signup fields array
|
|
1562
|
+
|
|
1563
|
+
**Usage:**
|
|
1564
|
+
|
|
1565
|
+
```
|
|
1566
|
+
add_filter('fluent_cart/checkout_signup_fields', function ($fields) {
|
|
1567
|
+
// Make password required
|
|
1568
|
+
if (isset($fields['user_pass'])) {
|
|
1569
|
+
$fields['user_pass']['required'] = 'yes';
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
return $fields;
|
|
1573
|
+
});
|
|
1574
|
+
```
|
|
1575
|
+
|
|
1576
|
+
### ` checkout_login_fields `
|
|
1577
|
+
|
|
1578
|
+
`fluent_cart/checkout_login_fields` — Modify the checkout login form fields
|
|
1579
|
+
|
|
1580
|
+
**When it runs:** This filter fires when the login form fields (username, password) are assembled for the checkout page.
|
|
1581
|
+
|
|
1582
|
+
**Source:** `app/Helpers/CartCheckoutHelper.php:872`
|
|
1583
|
+
|
|
1584
|
+
**Parameters:**
|
|
1585
|
+
|
|
1586
|
+
- `$fields` (array): Associative array of login field definitions
|
|
1587
|
+
|
|
1588
|
+
```
|
|
1589
|
+
$fields = [
|
|
1590
|
+
'user_login' => [
|
|
1591
|
+
'type' => 'text',
|
|
1592
|
+
'label' => 'Username or Email',
|
|
1593
|
+
'required' => 'yes',
|
|
1594
|
+
...
|
|
1595
|
+
],
|
|
1596
|
+
'user_pass' => [
|
|
1597
|
+
'type' => 'password',
|
|
1598
|
+
'label' => 'Password',
|
|
1599
|
+
'required' => 'yes',
|
|
1600
|
+
...
|
|
1601
|
+
],
|
|
1602
|
+
];
|
|
1603
|
+
```
|
|
1604
|
+
|
|
1605
|
+
**Returns:**
|
|
1606
|
+
|
|
1607
|
+
- `array` — The modified login fields array
|
|
1608
|
+
|
|
1609
|
+
**Usage:**
|
|
1610
|
+
|
|
1611
|
+
```
|
|
1612
|
+
add_filter('fluent_cart/checkout_login_fields', function ($fields) {
|
|
1613
|
+
// Change the username label
|
|
1614
|
+
if (isset($fields['user_login'])) {
|
|
1615
|
+
$fields['user_login']['label'] = __('Email Address', 'fluent-cart');
|
|
1616
|
+
$fields['user_login']['placeholder'] = __('Enter your email', 'fluent-cart');
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
return $fields;
|
|
1620
|
+
});
|
|
1621
|
+
```
|
|
1622
|
+
|
|
1623
|
+
### ` checkout_coupon_fields `
|
|
1624
|
+
|
|
1625
|
+
`fluent_cart/checkout_coupon_fields` — Modify the coupon input fields
|
|
1626
|
+
|
|
1627
|
+
**When it runs:** This filter fires when the coupon code input fields are assembled for the checkout page.
|
|
1628
|
+
|
|
1629
|
+
**Source:** `app/Helpers/CartCheckoutHelper.php:925`
|
|
1630
|
+
|
|
1631
|
+
**Parameters:**
|
|
1632
|
+
|
|
1633
|
+
- `$fields` (array): Associative array of coupon field definitions (typically includes a coupon code input and a hidden applied-coupons field)
|
|
1634
|
+
|
|
1635
|
+
**Returns:**
|
|
1636
|
+
|
|
1637
|
+
- `array` — The modified coupon fields array
|
|
1638
|
+
|
|
1639
|
+
**Usage:**
|
|
1640
|
+
|
|
1641
|
+
```
|
|
1642
|
+
add_filter('fluent_cart/checkout_coupon_fields', function ($fields) {
|
|
1643
|
+
// Customize the coupon input placeholder
|
|
1644
|
+
if (isset($fields['coupon_code'])) {
|
|
1645
|
+
$fields['coupon_code']['placeholder'] = __('Got a discount code?', 'fluent-cart');
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
return $fields;
|
|
1649
|
+
});
|
|
1650
|
+
```
|
|
1651
|
+
|
|
1652
|
+
### ` checkout_page_name_fields_schema `
|
|
1653
|
+
|
|
1654
|
+
`fluent_cart/checkout_page_name_fields_schema` — Modify name fields on the checkout page
|
|
1655
|
+
|
|
1656
|
+
**When it runs:** This filter fires when the checkout name fields schema (first name, last name, email, and optionally company) is being built. Modules like FluentCRM hook in to pre-fill name and email from CRM contact data.
|
|
1657
|
+
|
|
1658
|
+
**Source:** `app/Services/Renderer/CheckoutFieldsSchema.php:113`
|
|
1659
|
+
|
|
1660
|
+
**Parameters:**
|
|
1661
|
+
|
|
1662
|
+
- `$nameFields` (array): Associative array of name/email field definitions
|
|
1663
|
+
- `$data` (array): Context data
|
|
1664
|
+
|
|
1665
|
+
```
|
|
1666
|
+
$data = [
|
|
1667
|
+
'cart' => $cart, // Cart model instance (may be null)
|
|
1668
|
+
'scope' => 'billing', // Field scope (billing or shipping)
|
|
1669
|
+
];
|
|
1670
|
+
```
|
|
1671
|
+
|
|
1672
|
+
**Returns:**
|
|
1673
|
+
|
|
1674
|
+
- `array` — The modified name fields array
|
|
1675
|
+
|
|
1676
|
+
**Usage:**
|
|
1677
|
+
|
|
1678
|
+
```
|
|
1679
|
+
add_filter('fluent_cart/checkout_page_name_fields_schema', function ($fields, $data) {
|
|
1680
|
+
// Pre-fill from logged-in user
|
|
1681
|
+
if ($userId = get_current_user_id()) {
|
|
1682
|
+
$user = get_userdata($userId);
|
|
1683
|
+
if (!empty($fields['billing_email']) && empty($fields['billing_email']['value'])) {
|
|
1684
|
+
$fields['billing_email']['value'] = $user->user_email;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
return $fields;
|
|
1689
|
+
}, 10, 2);
|
|
1690
|
+
```
|
|
1691
|
+
|
|
1692
|
+
### ` fields/address_base_fields `
|
|
1693
|
+
|
|
1694
|
+
`fluent_cart/fields/address_base_fields` — Modify base address field definitions
|
|
1695
|
+
|
|
1696
|
+
**When it runs:** This filter fires when the low-level address field definitions are assembled in `CheckoutFieldsSchema`. These are the raw field configurations (country, state, city, zip, address lines) that form the foundation for both billing and shipping sections.
|
|
1697
|
+
|
|
1698
|
+
**Source:** `app/Services/Renderer/CheckoutFieldsSchema.php:348`
|
|
1699
|
+
|
|
1700
|
+
**Parameters:**
|
|
1701
|
+
|
|
1702
|
+
- `$fields` (array): Array of base address field definitions
|
|
1703
|
+
- `$data` (array): Context data
|
|
1704
|
+
|
|
1705
|
+
```
|
|
1706
|
+
$data = [
|
|
1707
|
+
'config' => $config, // Address field configuration
|
|
1708
|
+
'scope' => 'billing', // Field scope (billing or shipping)
|
|
1709
|
+
'requirements' => $requireFields, // Required field requirements
|
|
1710
|
+
];
|
|
1711
|
+
```
|
|
1712
|
+
|
|
1713
|
+
**Returns:**
|
|
1714
|
+
|
|
1715
|
+
- `array` — The modified base address fields array
|
|
1716
|
+
|
|
1717
|
+
**Usage:**
|
|
1718
|
+
|
|
1719
|
+
```
|
|
1720
|
+
add_filter('fluent_cart/fields/address_base_fields', function ($fields, $data) {
|
|
1721
|
+
// Make the city field optional for billing
|
|
1722
|
+
if ($data['scope'] === 'billing') {
|
|
1723
|
+
foreach ($fields as &$field) {
|
|
1724
|
+
if (isset($field['name']) && $field['name'] === 'billing_city') {
|
|
1725
|
+
unset($field['required']);
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
return $fields;
|
|
1731
|
+
}, 10, 2);
|
|
1732
|
+
```
|
|
1733
|
+
|
|
1734
|
+
### ` default_billing_country_for_checkout `
|
|
1735
|
+
|
|
1736
|
+
`fluent_cart/default_billing_country_for_checkout` — Set the default billing country
|
|
1737
|
+
|
|
1738
|
+
**When it runs:** This filter fires when determining the default billing country for the checkout form. By default, it attempts to read the country from the Cloudflare `HTTP_CF_IPCOUNTRY` header for geo-detection.
|
|
1739
|
+
|
|
1740
|
+
**Source:** `app/Helpers/AddressHelper.php:627`
|
|
1741
|
+
|
|
1742
|
+
**Parameters:**
|
|
1743
|
+
|
|
1744
|
+
- `$countryCode` (string): The detected country code (ISO 3166-1 alpha-2), or an empty string if not detected
|
|
1745
|
+
|
|
1746
|
+
**Returns:**
|
|
1747
|
+
|
|
1748
|
+
- `string` — A valid ISO 3166-1 alpha-2 country code
|
|
1749
|
+
|
|
1750
|
+
**Usage:**
|
|
1751
|
+
|
|
1752
|
+
```
|
|
1753
|
+
add_filter('fluent_cart/default_billing_country_for_checkout', function ($countryCode) {
|
|
1754
|
+
// Default to US if no country was detected
|
|
1755
|
+
if (empty($countryCode)) {
|
|
1756
|
+
return 'US';
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
return $countryCode;
|
|
1760
|
+
});
|
|
1761
|
+
```
|
|
1762
|
+
|
|
1763
|
+
---
|
|
1764
|
+
|
|
1765
|
+
## Checkout Localization
|
|
1766
|
+
|
|
1767
|
+
### ` checkout/localize_data `
|
|
1768
|
+
|
|
1769
|
+
`fluent_cart/checkout/localize_data` — Modify checkout JavaScript localized data
|
|
1770
|
+
|
|
1771
|
+
**When it runs:** This filter fires when the checkout page assets are being enqueued. It allows modules to add or modify the data that is passed to the checkout JavaScript via `wp_localize_script()`. Modules like Turnstile hook in to add their client-side configuration.
|
|
1772
|
+
|
|
1773
|
+
**Source:** `app/Modules/Templating/AssetLoader.php:574`
|
|
1774
|
+
|
|
1775
|
+
**Parameters:**
|
|
1776
|
+
|
|
1777
|
+
- `$data` (array): The localized data array
|
|
1778
|
+
|
|
1779
|
+
```
|
|
1780
|
+
$data = [
|
|
1781
|
+
'fluentcart_checkout_vars' => [
|
|
1782
|
+
'rest' => [...], // REST API info
|
|
1783
|
+
'ajaxurl' => '...', // Admin AJAX URL
|
|
1784
|
+
'is_all_digital' => false, // Whether cart is digital-only
|
|
1785
|
+
'is_cart_locked' => 'no', // Cart lock state
|
|
1786
|
+
'disable_coupons' => 'no', // Coupon toggle
|
|
1787
|
+
'tax_settings' => [...], // Tax configuration
|
|
1788
|
+
'cart_hash' => '...', // Cart hash
|
|
1789
|
+
'is_instant_checkout' => false, // Instant checkout flag
|
|
1790
|
+
'redirect_url' => '...', // Checkout page URL
|
|
1791
|
+
'store_country' => 'US', // Store country
|
|
1792
|
+
'is_zero_payment' => 'no', // Zero total flag
|
|
1793
|
+
// ...and more
|
|
1794
|
+
],
|
|
1795
|
+
];
|
|
1796
|
+
```
|
|
1797
|
+
|
|
1798
|
+
- `$cart` ([Cart](/database/models/cart.md)): The Cart model instance
|
|
1799
|
+
|
|
1800
|
+
**Returns:**
|
|
1801
|
+
|
|
1802
|
+
- `array` — The modified localized data array
|
|
1803
|
+
|
|
1804
|
+
**Usage:**
|
|
1805
|
+
|
|
1806
|
+
```
|
|
1807
|
+
add_filter('fluent_cart/checkout/localize_data', function ($data, $cart) {
|
|
1808
|
+
// Add custom JS configuration
|
|
1809
|
+
$data['fluentcart_checkout_vars']['my_module'] = [
|
|
1810
|
+
'enabled' => true,
|
|
1811
|
+
'endpoint' => rest_url('my-module/v1/validate'),
|
|
1812
|
+
];
|
|
1813
|
+
|
|
1814
|
+
return $data;
|
|
1815
|
+
}, 10, 2);
|
|
1816
|
+
```
|
|
1817
|
+
|
|
1818
|
+
### ` payment_methods_with_custom_checkout_buttons `
|
|
1819
|
+
|
|
1820
|
+
`fluent_cart/payment_methods_with_custom_checkout_buttons` — Register payment methods that use custom checkout buttons
|
|
1821
|
+
|
|
1822
|
+
**When it runs:** This filter fires when building the checkout localized data. Payment gateways that render their own submit button (like PayPal's smart buttons) register themselves here so the default "Place Order" button behavior is adapted accordingly.
|
|
1823
|
+
|
|
1824
|
+
**Source:** `app/Modules/Templating/AssetLoader.php:542`
|
|
1825
|
+
|
|
1826
|
+
**Parameters:**
|
|
1827
|
+
|
|
1828
|
+
- `$methods` (array): Array of payment method route slugs that have custom buttons. Default: `[]`
|
|
1829
|
+
|
|
1830
|
+
**Returns:**
|
|
1831
|
+
|
|
1832
|
+
- `array` — The modified array of payment method route slugs
|
|
1833
|
+
|
|
1834
|
+
**Usage:**
|
|
1835
|
+
|
|
1836
|
+
```
|
|
1837
|
+
add_filter('fluent_cart/payment_methods_with_custom_checkout_buttons', function ($methods) {
|
|
1838
|
+
// Register my custom gateway as having its own button
|
|
1839
|
+
$methods[] = 'my_custom_gateway';
|
|
1840
|
+
return $methods;
|
|
1841
|
+
});
|
|
1842
|
+
```
|
|
1843
|
+
|
|
1844
|
+
### ` instant_checkout/allowed_redirect_hosts `
|
|
1845
|
+
|
|
1846
|
+
`fluent_cart/instant_checkout/allowed_redirect_hosts` — Control allowed redirect hosts for instant checkout
|
|
1847
|
+
|
|
1848
|
+
**When it runs:** This filter fires during the instant checkout (add-to-cart via URL) flow when a `redirect_to` parameter is provided. For security, only URLs whose hosts are in the allowed list will be accepted as redirect targets.
|
|
1849
|
+
|
|
1850
|
+
**Source:** `app/Http/Routes/WebRoutes.php:190`
|
|
1851
|
+
|
|
1852
|
+
**Parameters:**
|
|
1853
|
+
|
|
1854
|
+
- `$allowedHosts` (array): Array of allowed hostnames. Default: the current site's host.
|
|
1855
|
+
|
|
1856
|
+
```
|
|
1857
|
+
$allowedHosts = [
|
|
1858
|
+
'example.com', // parse_url(home_url(), PHP_URL_HOST)
|
|
1859
|
+
];
|
|
1860
|
+
```
|
|
1861
|
+
|
|
1862
|
+
- `$data` (array): Context data
|
|
1863
|
+
|
|
1864
|
+
```
|
|
1865
|
+
$data = [
|
|
1866
|
+
'allowed_hosts' => $allowedHosts,
|
|
1867
|
+
];
|
|
1868
|
+
```
|
|
1869
|
+
|
|
1870
|
+
**Returns:**
|
|
1871
|
+
|
|
1872
|
+
- `array` — Array of allowed redirect hostnames
|
|
1873
|
+
|
|
1874
|
+
**Usage:**
|
|
1875
|
+
|
|
1876
|
+
```
|
|
1877
|
+
add_filter('fluent_cart/instant_checkout/allowed_redirect_hosts', function ($hosts) {
|
|
1878
|
+
// Allow redirects to a subdomain
|
|
1879
|
+
$hosts[] = 'shop.example.com';
|
|
1880
|
+
$hosts[] = 'members.example.com';
|
|
1881
|
+
return $hosts;
|
|
1882
|
+
});
|
|
1883
|
+
```
|
|
1884
|
+
|
|
1885
|
+
---
|
|
1886
|
+
|
|
1887
|
+
## Tax & VAT
|
|
1888
|
+
|
|
1889
|
+
### ` checkout/is_business `
|
|
1890
|
+
|
|
1891
|
+
`fluent_cart/checkout/is_business` — Filter whether the checkout is a business (B2B) purchase
|
|
1892
|
+
|
|
1893
|
+
**When it runs:** This filter is applied in `TaxModule::storeBusinessInfoOnOrder()` (hooked to `fluent_cart/checkout/prepare_other_data`) right after an order is placed. It decides whether the checkout counts as a business purchase — and therefore whether business info (company name, VAT number, etc.) is persisted onto the order. The default value is taken from the submitted `is_business` request field, falling back to the cart's saved `form_data.is_business` when the key was never submitted.
|
|
1894
|
+
|
|
1895
|
+
**Parameters:**
|
|
1896
|
+
|
|
1897
|
+
- `$isBusinessCheckout` (bool): Whether the checkout is treated as a business purchase
|
|
1898
|
+
- `$data` (array): Context data
|
|
1899
|
+
|
|
1900
|
+
```
|
|
1901
|
+
$data = [
|
|
1902
|
+
'checkout_data' => $checkoutData, // array — the cart's checkout_data
|
|
1903
|
+
'order' => $order, // \FluentCart\App\Models\Order — the just-created order
|
|
1904
|
+
];
|
|
1905
|
+
```
|
|
1906
|
+
|
|
1907
|
+
**Returns:**
|
|
1908
|
+
|
|
1909
|
+
- `bool` — `true` to treat the checkout as a business purchase
|
|
1910
|
+
|
|
1911
|
+
**Source:** `app/Modules/Tax/TaxModule.php (line 1047)`
|
|
1912
|
+
|
|
1913
|
+
**Usage:**
|
|
1914
|
+
|
|
1915
|
+
```
|
|
1916
|
+
add_filter('fluent_cart/checkout/is_business', function ($isBusiness, $data) {
|
|
1917
|
+
// Treat every checkout with a company name as a business purchase
|
|
1918
|
+
$company = $data['checkout_data']['form_data']['company_name'] ?? '';
|
|
1919
|
+
|
|
1920
|
+
return $isBusiness || $company !== '';
|
|
1921
|
+
}, 10, 2);
|
|
1922
|
+
```
|
|
1923
|
+
|
|
1924
|
+
### ` tax/reverse_charge_line_adjustment `
|
|
1925
|
+
|
|
1926
|
+
`fluent_cart/tax/reverse_charge_line_adjustment` — Filter the per-line price adjustment when reverse charge is applied
|
|
1927
|
+
|
|
1928
|
+
**When it runs:** This filter is applied in `TaxModule::calculateCartTax()` while applying the EU VAT reverse charge to tax-inclusive product lines. For each inclusive line, the included tax amount (in cents) is calculated and then passed through this filter before being subtracted from the line's unit price. The result is re-clamped to `0..subtotal` after filtering, so a filter cannot produce a negative unit price.
|
|
1929
|
+
|
|
1930
|
+
**Parameters:**
|
|
1931
|
+
|
|
1932
|
+
- `$adjustment` (int): The amount in cents to deduct from the line (default: the line's included tax total, clamped to the line subtotal)
|
|
1933
|
+
- `$data` (array): Context data
|
|
1934
|
+
|
|
1935
|
+
```
|
|
1936
|
+
$data = [
|
|
1937
|
+
'line' => $line, // array — the cart product line (unit_price, quantity, subtotal, line_meta, ...)
|
|
1938
|
+
'rc_mode' => $rcMode, // string — the effective reverse charge price mode
|
|
1939
|
+
];
|
|
1940
|
+
```
|
|
1941
|
+
|
|
1942
|
+
**Returns:**
|
|
1943
|
+
|
|
1944
|
+
- `int` — The adjustment amount in cents
|
|
1945
|
+
|
|
1946
|
+
**Source:** `app/Modules/Tax/TaxModule.php (line 689)`
|
|
1947
|
+
|
|
1948
|
+
**Usage:**
|
|
1949
|
+
|
|
1950
|
+
```
|
|
1951
|
+
add_filter('fluent_cart/tax/reverse_charge_line_adjustment', function ($adjustment, $data) {
|
|
1952
|
+
// Keep gross prices (no deduction) for a specific product line
|
|
1953
|
+
if (($data['line']['post_id'] ?? 0) === 123) {
|
|
1954
|
+
return 0;
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
return $adjustment;
|
|
1958
|
+
}, 10, 2);
|
|
1959
|
+
```
|
|
1960
|
+
|
|
1961
|
+
### ` tax/reverse_charge_notice_text `
|
|
1962
|
+
|
|
1963
|
+
`fluent_cart/tax/reverse_charge_notice_text` — Filter the reverse charge notice shown on receipts and invoices
|
|
1964
|
+
|
|
1965
|
+
**When it runs:** This filter is applied in `TaxModule::getReverseChargeNoticeText()` whenever the reverse charge notice is rendered — on the thank-you page, order receipts, and order emails. EU VAT Directive 2006/112/EC Article 226(11a) requires the invoice to carry the literal mention "Reverse charge", so any override should keep those words; stores supplying intra-EU goods (Art. 138) or needing other jurisdiction-specific wording can adjust the rest of the sentence.
|
|
1966
|
+
|
|
1967
|
+
**Parameters:**
|
|
1968
|
+
|
|
1969
|
+
- `$text` (string): The notice text (default: `'Reverse charge — Article 196, Council Directive 2006/112/EC. Customer is liable for VAT.'`)
|
|
1970
|
+
|
|
1971
|
+
**Returns:**
|
|
1972
|
+
|
|
1973
|
+
- `string` — The notice text to display
|
|
1974
|
+
|
|
1975
|
+
**Source:** `app/Modules/Tax/TaxModule.php (line 1688)`
|
|
1976
|
+
|
|
1977
|
+
**Usage:**
|
|
1978
|
+
|
|
1979
|
+
```
|
|
1980
|
+
add_filter('fluent_cart/tax/reverse_charge_notice_text', function ($text) {
|
|
1981
|
+
// Intra-EU supply of goods wording
|
|
1982
|
+
return __('Reverse charge — Article 138, Council Directive 2006/112/EC. Customer is liable for VAT.', 'my-plugin');
|
|
1983
|
+
}, 10, 1);
|
|
1984
|
+
```
|
|
1985
|
+
|
|
1986
|
+
### ` tax/validate_eu_vat_number `
|
|
1987
|
+
|
|
1988
|
+
`fluent_cart/tax/validate_eu_vat_number` — Short-circuit EU VAT number validation with a custom validator
|
|
1989
|
+
|
|
1990
|
+
**When it runs:** This filter is applied in `TaxModule::validateEuVatNumber()` before FluentCart contacts the EU VIES SOAP service to validate a VAT number (during checkout VAT validation and admin-side validation). Returning a non-`null` value short-circuits the remote VIES call: return an `array` to report a successful validation, or a `WP_Error` to report a validation failure (its message is shown to the customer). Return `null` (the default) to let FluentCart perform its normal VIES SOAP validation.
|
|
1991
|
+
|
|
1992
|
+
**Parameters:**
|
|
1993
|
+
|
|
1994
|
+
- `$result` (null): Always `null` by default
|
|
1995
|
+
- `$data` (array): Context data
|
|
1996
|
+
|
|
1997
|
+
```
|
|
1998
|
+
$data = [
|
|
1999
|
+
'country_code' => $countryCode, // string — two-letter country code (e.g. 'DE')
|
|
2000
|
+
'vat_number' => $vatNumber, // string — the VAT number being validated
|
|
2001
|
+
];
|
|
2002
|
+
```
|
|
2003
|
+
|
|
2004
|
+
**Returns:**
|
|
2005
|
+
|
|
2006
|
+
- `null` — perform the default VIES SOAP validation
|
|
2007
|
+
- `array` — treated as a successful validation result, same shape as the VIES response: `['country' => ..., 'vat_number' => ..., 'valid' => true, 'name' => ..., 'address' => ...]`
|
|
2008
|
+
- `WP_Error` — treated as a validation error; the message is forwarded to the customer
|
|
2009
|
+
|
|
2010
|
+
**Source:** `app/Modules/Tax/TaxModule.php (line 1430)`
|
|
2011
|
+
|
|
2012
|
+
**Usage:**
|
|
2013
|
+
|
|
2014
|
+
```
|
|
2015
|
+
add_filter('fluent_cart/tax/validate_eu_vat_number', function ($result, $data) {
|
|
2016
|
+
$response = my_vat_api_check($data['country_code'], $data['vat_number']);
|
|
2017
|
+
|
|
2018
|
+
if (!$response['ok']) {
|
|
2019
|
+
return new \WP_Error('invalid_vat', __('The VAT number could not be validated.', 'my-plugin'));
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
return [
|
|
2023
|
+
'country' => $data['country_code'],
|
|
2024
|
+
'vat_number' => $data['vat_number'],
|
|
2025
|
+
'valid' => true,
|
|
2026
|
+
'name' => $response['company_name'],
|
|
2027
|
+
'address' => $response['address'],
|
|
2028
|
+
];
|
|
2029
|
+
}, 10, 2);
|
|
2030
|
+
```
|
|
2031
|
+
|
|
2032
|
+
---
|