fluentcart-developer 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +26 -26
- package/README.md +59 -59
- package/dist/cards/fluentcart/templates-native.js +1087 -1087
- package/dist/cards/fluentcart/tools.js +2309 -2309
- package/dist/skills/fluentcart-developer/SKILL.md +108 -108
- package/dist/skills/fluentcart-developer/examples/README.md +30 -30
- package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
- package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
- package/dist/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +113 -113
- package/dist/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +148 -148
- package/dist/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/README.md +22 -22
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/sample-plugin-with-licensing-sdk.php +79 -79
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/FluentLicensing.php +303 -303
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/LicenseSettings.php +566 -566
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/PluginUpdater.php +304 -304
- package/dist/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +61 -61
- package/dist/skills/fluentcart-developer/references/api/authentication.md +452 -452
- package/dist/skills/fluentcart-developer/references/api/coupons.md +786 -786
- package/dist/skills/fluentcart-developer/references/api/customers.md +889 -889
- package/dist/skills/fluentcart-developer/references/api/files.md +609 -609
- package/dist/skills/fluentcart-developer/references/api/index.md +432 -432
- package/dist/skills/fluentcart-developer/references/api/licensing.md +633 -633
- package/dist/skills/fluentcart-developer/references/api/order-bump.md +384 -384
- package/dist/skills/fluentcart-developer/references/api/orders.md +814 -814
- package/dist/skills/fluentcart-developer/references/api/products.md +866 -866
- package/dist/skills/fluentcart-developer/references/api/roles-permissions.md +536 -536
- package/dist/skills/fluentcart-developer/references/api/subscriptions.md +827 -827
- package/dist/skills/fluentcart-developer/references/database/index.md +44 -44
- package/dist/skills/fluentcart-developer/references/database/models/activity.md +178 -178
- package/dist/skills/fluentcart-developer/references/database/models/applied-coupon.md +291 -291
- package/dist/skills/fluentcart-developer/references/database/models/attribute-group.md +239 -239
- package/dist/skills/fluentcart-developer/references/database/models/attribute-relation.md +181 -181
- package/dist/skills/fluentcart-developer/references/database/models/attribute-term.md +219 -219
- package/dist/skills/fluentcart-developer/references/database/models/cart.md +645 -645
- package/dist/skills/fluentcart-developer/references/database/models/coupon.md +427 -427
- package/dist/skills/fluentcart-developer/references/database/models/customer-addresses.md +348 -348
- package/dist/skills/fluentcart-developer/references/database/models/customer-meta.md +156 -156
- package/dist/skills/fluentcart-developer/references/database/models/customer.md +584 -584
- package/dist/skills/fluentcart-developer/references/database/models/dynamic-model.md +163 -163
- package/dist/skills/fluentcart-developer/references/database/models/label-relationship.md +155 -155
- package/dist/skills/fluentcart-developer/references/database/models/label.md +153 -153
- package/dist/skills/fluentcart-developer/references/database/models/license-activation.md +182 -182
- package/dist/skills/fluentcart-developer/references/database/models/license-meta.md +163 -163
- package/dist/skills/fluentcart-developer/references/database/models/license-site.md +208 -208
- package/dist/skills/fluentcart-developer/references/database/models/license.md +640 -640
- package/dist/skills/fluentcart-developer/references/database/models/meta.md +233 -233
- package/dist/skills/fluentcart-developer/references/database/models/order-address.md +391 -391
- package/dist/skills/fluentcart-developer/references/database/models/order-download-permission.md +144 -144
- package/dist/skills/fluentcart-developer/references/database/models/order-item.md +383 -383
- package/dist/skills/fluentcart-developer/references/database/models/order-meta.md +303 -303
- package/dist/skills/fluentcart-developer/references/database/models/order-operation.md +158 -158
- package/dist/skills/fluentcart-developer/references/database/models/order-promotion-stat.md +175 -175
- package/dist/skills/fluentcart-developer/references/database/models/order-promotion.md +250 -250
- package/dist/skills/fluentcart-developer/references/database/models/order-tax-rate.md +172 -172
- package/dist/skills/fluentcart-developer/references/database/models/order-transaction.md +440 -440
- package/dist/skills/fluentcart-developer/references/database/models/order.md +727 -727
- package/dist/skills/fluentcart-developer/references/database/models/product-detail.md +397 -397
- package/dist/skills/fluentcart-developer/references/database/models/product-download.md +258 -258
- package/dist/skills/fluentcart-developer/references/database/models/product-meta.md +153 -153
- package/dist/skills/fluentcart-developer/references/database/models/product-variation.md +556 -556
- package/dist/skills/fluentcart-developer/references/database/models/product.md +580 -580
- package/dist/skills/fluentcart-developer/references/database/models/relationships.md +427 -427
- package/dist/skills/fluentcart-developer/references/database/models/scheduled-action.md +175 -175
- package/dist/skills/fluentcart-developer/references/database/models/shipping-class.md +148 -148
- package/dist/skills/fluentcart-developer/references/database/models/shipping-method.md +280 -280
- package/dist/skills/fluentcart-developer/references/database/models/shipping-zone.md +205 -205
- package/dist/skills/fluentcart-developer/references/database/models/subscription-meta.md +173 -173
- package/dist/skills/fluentcart-developer/references/database/models/subscription.md +528 -528
- package/dist/skills/fluentcart-developer/references/database/models/tax-class.md +195 -195
- package/dist/skills/fluentcart-developer/references/database/models/tax-rate.md +225 -225
- package/dist/skills/fluentcart-developer/references/database/models/user-meta.md +166 -166
- package/dist/skills/fluentcart-developer/references/database/models/user.md +220 -220
- package/dist/skills/fluentcart-developer/references/database/models.md +404 -404
- package/dist/skills/fluentcart-developer/references/database/query-builder.md +860 -860
- package/dist/skills/fluentcart-developer/references/database/readme.md +276 -276
- package/dist/skills/fluentcart-developer/references/database/schema.md +1002 -1002
- package/dist/skills/fluentcart-developer/references/engineering/adding-custom-pages-to-the-customer-dashboard.md +395 -395
- package/dist/skills/fluentcart-developer/references/engineering/index.md +4 -4
- package/dist/skills/fluentcart-developer/references/engineering.md +4 -4
- package/dist/skills/fluentcart-developer/references/getting-started.md +249 -249
- package/dist/skills/fluentcart-developer/references/guides/frontend.md +519 -519
- package/dist/skills/fluentcart-developer/references/guides/index.md +107 -107
- package/dist/skills/fluentcart-developer/references/guides/integrations.md +600 -600
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/index.md +237 -237
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/labels-and-tracking.md +481 -481
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/live-rates.md +269 -269
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/reference.md +223 -223
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/settings.md +370 -370
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier.md +237 -237
- package/dist/skills/fluentcart-developer/references/guides/subscriptions.md +217 -217
- package/dist/skills/fluentcart-developer/references/hooks/actions/admin-and-templates.md +1079 -1079
- package/dist/skills/fluentcart-developer/references/hooks/actions/cart-and-checkout.md +1795 -1795
- package/dist/skills/fluentcart-developer/references/hooks/actions/customers-and-users.md +327 -327
- package/dist/skills/fluentcart-developer/references/hooks/actions/licenses.md +829 -829
- package/dist/skills/fluentcart-developer/references/hooks/actions/modules.md +81 -81
- package/dist/skills/fluentcart-developer/references/hooks/actions/orders.md +757 -757
- package/dist/skills/fluentcart-developer/references/hooks/actions/payments-and-integrations.md +1163 -1163
- package/dist/skills/fluentcart-developer/references/hooks/actions/pro-modules.md +219 -219
- package/dist/skills/fluentcart-developer/references/hooks/actions/products-and-coupons.md +1019 -1019
- package/dist/skills/fluentcart-developer/references/hooks/actions/subscriptions.md +1290 -1290
- package/dist/skills/fluentcart-developer/references/hooks/actions.md +16 -16
- package/dist/skills/fluentcart-developer/references/hooks/deprecated.md +60 -60
- package/dist/skills/fluentcart-developer/references/hooks/filters/cart-and-checkout.md +2032 -2032
- package/dist/skills/fluentcart-developer/references/hooks/filters/customers-and-subscriptions.md +1746 -1746
- package/dist/skills/fluentcart-developer/references/hooks/filters/integrations-and-advanced.md +2439 -2439
- package/dist/skills/fluentcart-developer/references/hooks/filters/modules.md +464 -464
- package/dist/skills/fluentcart-developer/references/hooks/filters/orders-and-payments.md +2658 -2658
- package/dist/skills/fluentcart-developer/references/hooks/filters/pro-modules.md +502 -502
- package/dist/skills/fluentcart-developer/references/hooks/filters/products-and-pricing.md +1785 -1785
- package/dist/skills/fluentcart-developer/references/hooks/filters/settings-and-configuration.md +2966 -2966
- package/dist/skills/fluentcart-developer/references/hooks/filters.md +14 -14
- package/dist/skills/fluentcart-developer/references/hooks/index.md +35 -35
- package/dist/skills/fluentcart-developer/references/index.md +625 -625
- package/dist/skills/fluentcart-developer/references/modules/fee-system.md +427 -427
- package/dist/skills/fluentcart-developer/references/modules/ghost-product-selling.md +440 -440
- package/dist/skills/fluentcart-developer/references/modules/index.md +484 -484
- package/dist/skills/fluentcart-developer/references/modules/licensing.md +342 -342
- package/dist/skills/fluentcart-developer/references/modules/order-bump.md +433 -433
- package/dist/skills/fluentcart-developer/references/modules/payment-methods.md +129 -129
- package/dist/skills/fluentcart-developer/references/modules/refunds.md +170 -170
- package/dist/skills/fluentcart-developer/references/modules/shipping.md +846 -846
- package/dist/skills/fluentcart-developer/references/modules/storage.md +986 -986
- package/dist/skills/fluentcart-developer/references/modules/subscription-vendor-ids.md +186 -186
- package/dist/skills/fluentcart-developer/references/modules/subscriptions.md +678 -678
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/index.md +164 -164
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/paddle-example.md +1648 -1648
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/payment/setting/fields.md +353 -353
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/quick-implementation.md +1079 -1079
- package/dist/skills/fluentcart-developer/references/payment-methods-integration.md +164 -164
- package/dist/skills/fluentcart-developer/references/restapi/checkout.md +573 -573
- package/dist/skills/fluentcart-developer/references/restapi/coupons.md +958 -958
- package/dist/skills/fluentcart-developer/references/restapi/customer-profile.md +1423 -1423
- package/dist/skills/fluentcart-developer/references/restapi/customers.md +1103 -1103
- package/dist/skills/fluentcart-developer/references/restapi/dashboard.md +1083 -1083
- package/dist/skills/fluentcart-developer/references/restapi/data-export.md +132 -132
- package/dist/skills/fluentcart-developer/references/restapi/email-notifications.md +846 -846
- package/dist/skills/fluentcart-developer/references/restapi/files.md +313 -313
- package/dist/skills/fluentcart-developer/references/restapi/index.md +127 -127
- package/dist/skills/fluentcart-developer/references/restapi/integrations.md +1000 -1000
- package/dist/skills/fluentcart-developer/references/restapi/inventory.md +192 -192
- package/dist/skills/fluentcart-developer/references/restapi/labels-and-attributes.md +797 -797
- package/dist/skills/fluentcart-developer/references/restapi/licensing.md +1733 -1733
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-available-shipping-methods.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-checkout-summary.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-country-info.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-order-info.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-shipping-methods-list-view.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/login.md +66 -66
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/place-order.md +179 -179
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/apply-coupon.md +83 -83
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/cancel-coupon.md +87 -87
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/check-product-eligibility.md +59 -59
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/create-coupon.md +230 -230
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/delete-coupon.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupon-codes.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupons.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/re-apply-coupons.md +75 -75
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/store-coupon-settings.md +40 -40
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/update-coupon.md +133 -133
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-address-checkout.md +138 -138
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-profile-address.md +119 -119
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/dashboard-overview.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/delete-profile-address.md +46 -46
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-order-details.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-portal-sections.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-profile-details.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-transaction-billing-address.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-upgrade-paths.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-downloads.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-orders.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/make-profile-address-primary.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/pause-subscription.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/resume-subscription.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/save-transaction-billing-address.md +92 -92
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/select-address-for-checkout.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-address.md +115 -115
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-details.md +69 -69
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/attach-user.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/bulk-actions.md +65 -65
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-address.md +135 -135
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-customer.md +108 -108
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/delete-address.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/detach-user.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/find-customer-order.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-attachable-users.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-addresses.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-orders.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-stats.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/list-customers.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/recalculate-ltv.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/set-primary-address.md +72 -72
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-additional-info.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-address.md +144 -144
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-customer.md +123 -123
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/attach-note-to-order.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-all-pages.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-single-page.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/delete-activity.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-country-info.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-dashboard-stats.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-filter-options.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-data.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-print-templates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-search-options.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-widgets.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/initialize-app.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-activities.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-attachments.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-countries.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/mark-activity-read.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/run-data-backfills.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-settings.md +54 -54
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-tax-settings.md +73 -73
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-print-templates.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/upload-attachment.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-customers-batch.md +129 -129
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-licenses-batch.md +133 -133
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-orders-batch.md +129 -129
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-subscriptions-batch.md +129 -129
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-customers-export-schema.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-licenses-export-schema.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-orders-export-schema.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-subscriptions-export-schema.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/enable-notification.md +57 -57
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-digest-settings.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-notification.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-reminders.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-settings.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-shortcodes.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/list-notifications.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-default-template.md +66 -66
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-notification.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-digest-settings.md +101 -101
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-reminders.md +162 -162
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-settings.md +99 -99
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-digest-test.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-manual-reminder.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/update-notification.md +93 -93
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/delete-file.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/get-bucket-list.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/list-files.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-editor-file.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-file.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/chained-data-request.md +46 -46
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/change-feed-status.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/delete-feed.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-dynamic-options.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-lists.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-settings.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-feeds.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-settings.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/install-addon-plugin.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/list-addons.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/save-feed-settings.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/set-global-settings.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/bulk-update-stock.md +94 -94
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/export-inventory.md +81 -81
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-adjustment-history.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-inventory-stats.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/list-inventory.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/update-stock.md +75 -75
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-attribute-group.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-label.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-terms.md +90 -90
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-group.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-term.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-group.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-library.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-groups.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-terms.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-labels.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-groups.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-terms.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-group.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-term.md +39 -39
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-label-selections.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-plugin-license.md +41 -41
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-site-admin.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-plugin-license.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-admin.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-customer.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/delete-license.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/extend-license-validity.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-license-details.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-licenses-admin.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-activations.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-details.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-site.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-plugin-license-status.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-product-license-settings.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-customer-licenses.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-license-sites.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-licenses.md +38 -38
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-activate-license.md +54 -54
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-check-license.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-deactivate-license.md +46 -46
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-download-license-package.md +23 -23
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-get-license-version.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/regenerate-license-key.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/save-product-license-settings.md +193 -193
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-activation-limit.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-status.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/create-order-bump.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/delete-order-bump.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/get-order-bump.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/list-order-bumps.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/update-order-bump.md +141 -141
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/accept-dispute.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/bulk-actions.md +72 -72
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-shipping.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-tax.md +98 -98
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/change-customer.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/charge-now.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-and-change-customer.md +92 -92
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-custom-order-item.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-order.md +351 -351
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-renewal-now.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/delete-order.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/generate-missing-licenses.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order-transactions.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-renewal.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-shipping-methods.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-single-transaction.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-order-currencies.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-orders.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-renewals.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/mark-as-paid.md +61 -61
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/price-order.md +135 -135
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/refund-order.md +72 -72
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/resend-renewal-invoice.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/skip-renewal.md +48 -48
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-order-statuses.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-pending-transaction.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address-id.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address.md +98 -98
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order.md +172 -172
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-statuses.md +77 -77
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-subscription-details.md +84 -84
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-transaction-status.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/void-renewal.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/create-pdf-template.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/delete-pdf-template.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/download-pdf-preview.md +44 -44
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-factory-default-templates.md +19 -19
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-status.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-template.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-saved-templates.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-seller-details.md +19 -19
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/list-pdf-templates.md +19 -19
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-pdf-template.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-seller-details.md +97 -97
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/add-product-terms.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-edit-fetch.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-insert-products.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-products.md +59 -59
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-variants.md +83 -83
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/change-integration-status.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-dummy-products.md +45 -45
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-product.md +81 -81
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-variation.md +181 -181
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-downloadable-file.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product-integration.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-taxonomy-term.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-upgrade-path.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-variation.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/do-bulk-action.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/duplicate-product.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-products-by-ids.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-taxonomy-terms.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-terms-by-parent.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-variations-by-ids.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/find-subscription-variants.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-bundle-info.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-downloadable-url.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-max-excerpt-word-count.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-pricing-widgets.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-feeds.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-settings.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-pricing.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-related-products.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-upgrade-settings.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-variation-upgrade-paths.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/group-bulk-update-variants.md +103 -103
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-all-variants.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-product-variations.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-products.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-shipping-class.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-tax-class.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-bundle-info.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-product-integration.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-upgrade-path.md +78 -78
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-product-variant-options.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-products-by-name.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-variants-by-name.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/set-variation-media.md +74 -74
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/suggest-sku.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-downloadable-files.md +134 -134
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-taxonomy-terms.md +61 -61
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/toggle-product-tax-exemption.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-downloadable-file.md +98 -98
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-inventory.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-long-desc-editor-mode.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-manage-stock.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-detail.md +58 -58
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-pricing.md +225 -225
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-shipping-class.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-tax-class.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-upgrade-path.md +78 -78
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-option.md +79 -79
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-tax-exemption.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation-pricing-table.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation.md +105 -105
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/get-product-views.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/list-products.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/search-products.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/channel-rules.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/country-heat-map.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupon-overview.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupons.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-insights.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-overview.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-repeat.md +35 -35
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segment-customers.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segments.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-value.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/dashboard-stats.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/failed-orders.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-new-vs-returning-customer.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-by-day-and-hour.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-meta.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-top-sold-products.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/future-renewals.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/generate-retention-snapshots.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-overview.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-activities.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-orders.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-revenue.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-at-risk.md +35 -35
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-variations.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/item-count-distribution.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-chart.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-pie-chart.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-summary.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/locations.md +43 -43
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-chart.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-completion-time.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-mix.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-value-distribution.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-disputes.md +38 -38
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-methods.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison-launch.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison.md +40 -40
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-detail.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-sales.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/refunds-overview.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/retention-snapshots-step.md +45 -45
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sales-growth-chart.md +35 -35
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/save-channel-rules.md +73 -73
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/source-channels.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sources.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-cohorts.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-health.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-rebuys.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-retention.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-variations.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscriptions-overview.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/weeks-between-refund.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/assign-role.md +48 -48
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/delete-role-assignment.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/get-role.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-managers.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-roles.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/search-users.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/update-role.md +43 -43
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/create-saved-view.md +106 -106
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/delete-saved-view.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/list-saved-views.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/update-saved-view.md +83 -83
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-payment-addon.md +44 -44
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-plugin-addon.md +44 -44
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/change-storage-driver-status.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/check-paypal-webhook.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/create-storage-bucket.md +63 -63
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/disconnect-payment-method.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/exchange-paypal-seller-auth-token.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-active-storage-drivers.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-checkout-fields.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-email-shortcodes.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-config-snippets.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-status.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-module-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-connection-info.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-settings.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-permissions.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-plugin-addons.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-storage-driver-settings.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-store-settings.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-mcp-adapter.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-payment-addon.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-plugin-addon.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-payment-methods.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-storage-drivers.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-storage-buckets.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reorder-payment-methods.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reset-storage-driver-settings.md +45 -45
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-checkout-fields.md +133 -133
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-confirmation-settings.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-module-settings.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-design.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-settings.md +58 -58
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-permissions.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-storage-driver-settings.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-store-settings.md +239 -239
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/setup-paypal-webhook.md +48 -48
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/toggle-mcp.md +40 -40
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-storage-driver-connection.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-turnstile-keys.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-class.md +73 -73
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-method.md +110 -110
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-zone.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-class.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-method.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-zone.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class-profile.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-packages.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-zone.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-countries.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-states.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-classes.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-zones.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/save-shipping-packages.md +112 -112
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-class.md +79 -79
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-method.md +113 -113
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-zone.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-zone-order.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-auto-renew.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-subscription.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/confirm-subscription-switch.md +70 -70
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/fetch-subscription-remote.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/generate-early-payment-link.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-customer-subscription.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-or-create-plan.md +69 -69
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-setup-intent-attempts.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/initiate-early-payment.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-customer-subscriptions.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-subscriptions.md +39 -39
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/pause-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/reactivate-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/resume-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/switch-payment-method.md +70 -70
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-payment-method.md +69 -69
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-vendor-ids.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/verify-vendor-ids.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-class.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-rate.md +117 -117
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-product-override.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-shipping-tax-override.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-class.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-rate.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-id.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-rates.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-eu-vat-product-overrides.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-oss-country-rates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-preconfigured-tax-rates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-product-overrides.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-tax-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-all-tax-rates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-classes.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-records.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/mark-taxes-as-filed.md +58 -58
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/reset-eu-vat-rates.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-configured-countries.md +57 -57
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-country-tax-id.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-eu-vat-cross-border-settings.md +127 -127
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-oss-country-rates.md +100 -100
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-product-override.md +110 -110
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-shipping-tax-override.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-tax-settings.md +166 -166
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-country-status.md +54 -54
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-tax-rate.md +116 -116
- package/dist/skills/fluentcart-developer/references/restapi/order-bumps.md +433 -433
- package/dist/skills/fluentcart-developer/references/restapi/orders.md +1212 -1212
- package/dist/skills/fluentcart-developer/references/restapi/pdf-templates.md +212 -212
- package/dist/skills/fluentcart-developer/references/restapi/products.md +2485 -2485
- package/dist/skills/fluentcart-developer/references/restapi/public-shop.md +191 -191
- package/dist/skills/fluentcart-developer/references/restapi/reports.md +3773 -3773
- package/dist/skills/fluentcart-developer/references/restapi/roles.md +403 -403
- package/dist/skills/fluentcart-developer/references/restapi/saved-views.md +136 -136
- package/dist/skills/fluentcart-developer/references/restapi/settings.md +1423 -1423
- package/dist/skills/fluentcart-developer/references/restapi/shipping.md +905 -905
- package/dist/skills/fluentcart-developer/references/restapi/subscriptions.md +1169 -1169
- package/dist/skills/fluentcart-developer/references/restapi/tax.md +1551 -1551
- package/dist/skills/fluentcart-developer/references/restapi.md +127 -127
- package/dist/skills/fluentcart-developer/scripts/cli.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +66 -65
package/dist/skills/fluentcart-developer/references/hooks/filters/customers-and-subscriptions.md
CHANGED
|
@@ -1,1746 +1,1746 @@
|
|
|
1
|
-
# Customers & Subscriptions
|
|
2
|
-
|
|
3
|
-
All filters related to [Customer](/database/models/customer.md) management, the customer portal, [Subscription](/database/models/subscription.md) lifecycle, billing configuration, and automated reminders.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Customer Data & Portal
|
|
8
|
-
|
|
9
|
-
### ` customer/view `
|
|
10
|
-
|
|
11
|
-
`fluent_cart/customer/view` — Filter admin single customer view data
|
|
12
|
-
|
|
13
|
-
**When it runs:** This filter is applied when preparing a single customer's data for display in the admin panel.
|
|
14
|
-
|
|
15
|
-
**Parameters:**
|
|
16
|
-
|
|
17
|
-
- `$customer` ([Customer](/database/models/customer.md)): The Customer model instance with loaded relations
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
$customer = [
|
|
21
|
-
'id' => 456,
|
|
22
|
-
'email' => '[email protected]',
|
|
23
|
-
'first_name' => 'John',
|
|
24
|
-
'last_name' => 'Doe',
|
|
25
|
-
'total_orders' => 5,
|
|
26
|
-
'total_spent' => 50000,
|
|
27
|
-
'selected_labels' => [...]
|
|
28
|
-
];
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
- `$requestData` (array): The full request data from `$request->all()`
|
|
32
|
-
|
|
33
|
-
**Returns:**
|
|
34
|
-
|
|
35
|
-
- `$customer` ([Customer](/database/models/customer.md)): The modified customer data
|
|
36
|
-
|
|
37
|
-
**Source:** `app/Http/Controllers/CustomerController.php:83`
|
|
38
|
-
|
|
39
|
-
**Usage:**
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
add_filter('fluent_cart/customer/view', function($customer, $requestData) {
|
|
43
|
-
// Add loyalty points to customer view
|
|
44
|
-
$customer['loyalty_points'] = get_user_meta($customer['user_id'], 'loyalty_points', true);
|
|
45
|
-
return $customer;
|
|
46
|
-
}, 10, 2);
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### ` widgets/single_customer `
|
|
50
|
-
|
|
51
|
-
`fluent_cart/widgets/single_customer` — Filter single customer admin widgets
|
|
52
|
-
|
|
53
|
-
**When it runs:** This filter is applied when loading widget data for a single customer's admin view, allowing you to inject custom widget sections.
|
|
54
|
-
|
|
55
|
-
**Parameters:**
|
|
56
|
-
|
|
57
|
-
- `$widgets` (array): Array of widget definitions (default: `[]`)
|
|
58
|
-
- `$customer` ([Customer](/database/models/customer.md)): The Customer model instance
|
|
59
|
-
|
|
60
|
-
**Returns:**
|
|
61
|
-
|
|
62
|
-
- `$widgets` (array): The modified widgets array
|
|
63
|
-
|
|
64
|
-
**Source:** `app/Http/Controllers/CustomerController.php:426`
|
|
65
|
-
|
|
66
|
-
**Usage:**
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
add_filter('fluent_cart/widgets/single_customer', function($widgets, $customer) {
|
|
70
|
-
// Add a custom CRM widget
|
|
71
|
-
$widgets[] = [
|
|
72
|
-
'title' => 'CRM Notes',
|
|
73
|
-
'content' => get_user_meta($customer->user_id, 'crm_notes', true)
|
|
74
|
-
];
|
|
75
|
-
return $widgets;
|
|
76
|
-
}, 10, 2);
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### ` customer_dashboard_data `
|
|
80
|
-
|
|
81
|
-
`fluent_cart/customer_dashboard_data` — Filter customer dashboard data
|
|
82
|
-
|
|
83
|
-
**When it runs:** This filter is applied when preparing the customer portal dashboard data, including the recent orders list and section parts. Runs both when a customer exists and when no customer is found.
|
|
84
|
-
|
|
85
|
-
**Parameters:**
|
|
86
|
-
|
|
87
|
-
- `$data` (array): The dashboard response data
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
$data = [
|
|
91
|
-
'message' => 'Success',
|
|
92
|
-
'dashboard_data' => [
|
|
93
|
-
'orders' => [...] // Recent orders collection
|
|
94
|
-
],
|
|
95
|
-
'sections_parts' => [
|
|
96
|
-
'before_orders_table' => '',
|
|
97
|
-
'after_orders_table' => ''
|
|
98
|
-
]
|
|
99
|
-
];
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
- `$context` (array): Context data containing the customer
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
$context = [
|
|
106
|
-
'customer' => $customer // Customer model or null
|
|
107
|
-
];
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
**Returns:**
|
|
111
|
-
|
|
112
|
-
- `$data` (array): The modified dashboard data
|
|
113
|
-
|
|
114
|
-
**Source:** `app/Http/Controllers/FrontendControllers/CustomerProfileController.php:65,122`
|
|
115
|
-
|
|
116
|
-
**Usage:**
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
add_filter('fluent_cart/customer_dashboard_data', function($data, $context) {
|
|
120
|
-
$customer = $context['customer'];
|
|
121
|
-
if ($customer) {
|
|
122
|
-
// Add a welcome banner above the orders table
|
|
123
|
-
$data['sections_parts']['before_orders_table'] = '<div class="welcome-banner">Welcome back!</div>';
|
|
124
|
-
}
|
|
125
|
-
return $data;
|
|
126
|
-
}, 10, 2);
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### ` global_customer_menu_items `
|
|
130
|
-
|
|
131
|
-
`fluent_cart/global_customer_menu_items` — Filter customer portal menu items
|
|
132
|
-
|
|
133
|
-
**When it runs:** This filter is applied when building the customer portal sidebar navigation menu, after built-in items have been conditionally removed (e.g., subscriptions, licenses).
|
|
134
|
-
|
|
135
|
-
**Parameters:**
|
|
136
|
-
|
|
137
|
-
- `$menuItems` (array): Associative array of menu items keyed by slug
|
|
138
|
-
|
|
139
|
-
```
|
|
140
|
-
$menuItems = [
|
|
141
|
-
'orders' => [
|
|
142
|
-
'label' => 'Orders',
|
|
143
|
-
'css_class' => 'fct_route',
|
|
144
|
-
'link' => '/customer-portal/#/orders',
|
|
145
|
-
'icon_svg' => '<svg>...</svg>'
|
|
146
|
-
],
|
|
147
|
-
'subscriptions' => [...],
|
|
148
|
-
'licenses' => [...],
|
|
149
|
-
'downloads' => [...],
|
|
150
|
-
'profile' => [...]
|
|
151
|
-
];
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
- `$context` (array): Context data
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
$context = [
|
|
158
|
-
'base_url' => '/customer-portal/#/'
|
|
159
|
-
];
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
**Returns:**
|
|
163
|
-
|
|
164
|
-
- `$menuItems` (array): The modified menu items array
|
|
165
|
-
|
|
166
|
-
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:299`
|
|
167
|
-
|
|
168
|
-
**Usage:**
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
add_filter('fluent_cart/global_customer_menu_items', function($menuItems, $context) {
|
|
172
|
-
// Add a custom "Support" tab before "profile"
|
|
173
|
-
$baseUrl = $context['base_url'];
|
|
174
|
-
$menuItems['support'] = [
|
|
175
|
-
'label' => 'Support',
|
|
176
|
-
'css_class' => 'fct_route',
|
|
177
|
-
'link' => $baseUrl . 'support',
|
|
178
|
-
'icon_svg' => '<svg>...</svg>'
|
|
179
|
-
];
|
|
180
|
-
return $menuItems;
|
|
181
|
-
}, 10, 2);
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### ` customer_portal/routes ` (JavaScript)
|
|
185
|
-
|
|
186
|
-
`fluent_cart/customer_portal/routes` — Add pages to the customer portal app (JS filter)
|
|
187
|
-
|
|
188
|
-
**When it runs:** This is a JavaScript filter on `wp.hooks`. The customer portal applies it to its vue-router route table once, before it creates the router. Use it to add your own page to the portal app.
|
|
189
|
-
|
|
190
|
-
The portal script loads as a deferred module. Enqueue your script on the `fluent_cart/customer_dashboard/enqueue_assets` action as a classic script that depends on `wp-hooks`. It then runs before the portal script, so your filter is in place in time.
|
|
191
|
-
|
|
192
|
-
**Parameters:**
|
|
193
|
-
|
|
194
|
-
- `routes` (Array): vue-router route records
|
|
195
|
-
- `context` (Object): `{ vue }`, the portal's own Vue (read-only). Use `vue.h` and `vue.defineComponent` to build components, so they use the same Vue instance as the portal.
|
|
196
|
-
|
|
197
|
-
**Returns:**
|
|
198
|
-
|
|
199
|
-
- `routes` (Array): The route table. If the value is not an array, the portal uses its own routes.
|
|
200
|
-
|
|
201
|
-
**Source:** `resources/public/customer-profile/Start.js:147`
|
|
202
|
-
|
|
203
|
-
**Usage:**
|
|
204
|
-
|
|
205
|
-
Enqueue the script:
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
add_action('fluent_cart/customer_dashboard/enqueue_assets', function () {
|
|
209
|
-
wp_enqueue_script('my-portal-pages', plugins_url('js/portal-pages.js', __FILE__), ['wp-hooks'], '1.0.0', true);
|
|
210
|
-
});
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
Add the route (`js/portal-pages.js`):
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
wp.hooks.addFilter('fluent_cart/customer_portal/routes', 'my-plugin', function (routes, context) {
|
|
217
|
-
const { h, defineComponent } = context.vue;
|
|
218
|
-
|
|
219
|
-
return routes.concat([{
|
|
220
|
-
path: '/memberships',
|
|
221
|
-
name: 'my_memberships',
|
|
222
|
-
component: defineComponent({
|
|
223
|
-
render: () => h('div', { class: 'my-memberships' }, 'Your memberships')
|
|
224
|
-
}),
|
|
225
|
-
meta: {
|
|
226
|
-
active_menu: 'memberships', // the menu item key to highlight
|
|
227
|
-
title: 'Memberships'
|
|
228
|
-
}
|
|
229
|
-
}]);
|
|
230
|
-
});
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
Add the menu item. The `fct_route` class makes the link open the route in the app, without a page reload:
|
|
234
|
-
|
|
235
|
-
```
|
|
236
|
-
add_filter('fluent_cart/global_customer_menu_items', function ($menuItems, $context) {
|
|
237
|
-
$menuItems['memberships'] = [
|
|
238
|
-
'label' => __('Memberships', 'my-plugin'),
|
|
239
|
-
'css_class' => 'fct_route',
|
|
240
|
-
'link' => $context['base_url'] . 'memberships',
|
|
241
|
-
];
|
|
242
|
-
return $menuItems;
|
|
243
|
-
}, 10, 2);
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
A direct visit to the URL (for example `/my-account/memberships`) also opens the page, because the portal page catches every path below it.
|
|
247
|
-
|
|
248
|
-
### ` fct_allowed_svg_tags `
|
|
249
|
-
|
|
250
|
-
`fct_allowed_svg_tags` — Allow-list the SVG tags/attributes for a customer nav menu icon
|
|
251
|
-
|
|
252
|
-
**When it runs:** This filter is applied when rendering a customer-portal navigation menu item that has an inline `icon_svg` value. The returned value is passed straight to `wp_kses()` as the allowed-HTML list, so a menu item's inline SVG icon is only rendered if this filter allow-lists the SVG tags/attributes it uses — the default is an empty array, which strips all markup.
|
|
253
|
-
|
|
254
|
-
> **Note:** This hook has no `fluent_cart/` or `fluent_cart_` prefix — it predates that naming convention. Register it exactly as `fct_allowed_svg_tags`.
|
|
255
|
-
|
|
256
|
-
**Source:** `app/Views/frontend/customer_menu.php:60`
|
|
257
|
-
|
|
258
|
-
**Parameters:**
|
|
259
|
-
|
|
260
|
-
- `$allowedTags` (array): The `wp_kses()`-style allowed tags/attributes array. Empty by default.
|
|
261
|
-
|
|
262
|
-
**Returns:**
|
|
263
|
-
|
|
264
|
-
- `array` — The allowed tags/attributes array, in the format `wp_kses()` expects
|
|
265
|
-
|
|
266
|
-
**Usage:**
|
|
267
|
-
|
|
268
|
-
```
|
|
269
|
-
add_filter('fct_allowed_svg_tags', function ($allowedTags) {
|
|
270
|
-
// Allow a basic inline <svg><path> icon
|
|
271
|
-
$allowedTags['svg'] = ['class' => true, 'viewbox' => true, 'width' => true, 'height' => true, 'fill' => true];
|
|
272
|
-
$allowedTags['path'] = ['d' => true, 'fill' => true];
|
|
273
|
-
return $allowedTags;
|
|
274
|
-
});
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### ` customer_portal/active_tab `
|
|
278
|
-
|
|
279
|
-
`fluent_cart/customer_portal/active_tab` — Filter the active tab in customer portal
|
|
280
|
-
|
|
281
|
-
**When it runs:** This filter is applied when rendering the customer portal to determine which tab should be visually active by default.
|
|
282
|
-
|
|
283
|
-
**Parameters:**
|
|
284
|
-
|
|
285
|
-
- `$activeTab` (string): The active tab identifier (default: `''`)
|
|
286
|
-
|
|
287
|
-
**Returns:**
|
|
288
|
-
|
|
289
|
-
- `$activeTab` (string): The modified active tab slug
|
|
290
|
-
|
|
291
|
-
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:150`
|
|
292
|
-
|
|
293
|
-
**Usage:**
|
|
294
|
-
|
|
295
|
-
```
|
|
296
|
-
add_filter('fluent_cart/customer_portal/active_tab', function($activeTab) {
|
|
297
|
-
// Default to subscriptions tab
|
|
298
|
-
return 'subscriptions';
|
|
299
|
-
}, 10, 1);
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### ` customer_portal/custom_endpoints `
|
|
303
|
-
|
|
304
|
-
`fluent_cart/customer_portal/custom_endpoints` — Filter custom portal endpoints
|
|
305
|
-
|
|
306
|
-
**When it runs:** This filter is applied when routing customer portal requests to check for registered custom endpoint paths. Use this to add entirely new pages to the customer portal.
|
|
307
|
-
|
|
308
|
-
**Parameters:**
|
|
309
|
-
|
|
310
|
-
- `$endpoints` (array): Associative array of custom endpoints (default: `[]`)
|
|
311
|
-
|
|
312
|
-
```
|
|
313
|
-
$endpoints = [
|
|
314
|
-
'my-page' => [
|
|
315
|
-
'render_callback' => callable,
|
|
316
|
-
// or 'page_id' => 123
|
|
317
|
-
]
|
|
318
|
-
];
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
**Returns:**
|
|
322
|
-
|
|
323
|
-
- `$endpoints` (array): The modified endpoints array
|
|
324
|
-
|
|
325
|
-
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:174`
|
|
326
|
-
|
|
327
|
-
**Usage:**
|
|
328
|
-
|
|
329
|
-
```
|
|
330
|
-
add_filter('fluent_cart/customer_portal/custom_endpoints', function($endpoints) {
|
|
331
|
-
$endpoints['warranty'] = [
|
|
332
|
-
'render_callback' => function() {
|
|
333
|
-
echo '<div class="warranty-page">Warranty info here</div>';
|
|
334
|
-
}
|
|
335
|
-
];
|
|
336
|
-
return $endpoints;
|
|
337
|
-
}, 10, 1);
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
TIP
|
|
341
|
-
|
|
342
|
-
Consider using the `FluentCartGeneralApi::addCustomerPortalEndpoint()` helper method instead, which registers both the menu item and the endpoint in one call.
|
|
343
|
-
|
|
344
|
-
### ` customer_portal/{filter} `
|
|
345
|
-
|
|
346
|
-
`fluent_cart/customer_portal/{$filter}` — Provide sections for a custom customer-portal endpoint (dynamic)
|
|
347
|
-
|
|
348
|
-
**When it runs:** This **dynamic** filter is applied by the customer-portal sections REST endpoint. `{$filter}` is replaced with the requested section/tab slug from the request, so an add-on that registers a portal endpoint (see `customer_portal/custom_endpoints` above) can supply that endpoint's section content by listening on its own slug.
|
|
349
|
-
|
|
350
|
-
**Source:** `app/Http/Controllers/FrontendControllers/CustomerProfileController.php:228`
|
|
351
|
-
|
|
352
|
-
**Parameters:**
|
|
353
|
-
|
|
354
|
-
- `$sections` (array): The sections to return for this endpoint. Empty by default.
|
|
355
|
-
- `$data` (array): Context data
|
|
356
|
-
|
|
357
|
-
```
|
|
358
|
-
$data = [
|
|
359
|
-
'customer' => $customer, // Customer model instance
|
|
360
|
-
];
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
**Returns:**
|
|
364
|
-
|
|
365
|
-
- `array` — The sections for this portal endpoint, formatted for the frontend
|
|
366
|
-
|
|
367
|
-
**Usage:**
|
|
368
|
-
|
|
369
|
-
```
|
|
370
|
-
// Supply sections for a portal endpoint registered under the "warranty" slug
|
|
371
|
-
add_filter('fluent_cart/customer_portal/warranty', function ($sections, $data) {
|
|
372
|
-
$sections[] = [
|
|
373
|
-
'title' => __('Warranty', 'fluent-cart'),
|
|
374
|
-
'content' => __('Your products are covered by our standard 12-month warranty.', 'fluent-cart'),
|
|
375
|
-
];
|
|
376
|
-
return $sections;
|
|
377
|
-
}, 10, 2);
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
### ` customer_portal/subscription_data `
|
|
381
|
-
|
|
382
|
-
`fluent_cart/customer_portal/subscription_data` — Filter customer portal subscription data
|
|
383
|
-
|
|
384
|
-
**When it runs:** This filter is applied when preparing a single subscription's data for display in the customer portal, after transactions have been loaded.
|
|
385
|
-
|
|
386
|
-
**Parameters:**
|
|
387
|
-
|
|
388
|
-
- `$formattedData` (array): The formatted subscription data including transactions
|
|
389
|
-
- `$context` (array): Context data
|
|
390
|
-
|
|
391
|
-
```
|
|
392
|
-
$context = [
|
|
393
|
-
'subscription' => $subscription, // Subscription model
|
|
394
|
-
'customer' => $customer // Customer model
|
|
395
|
-
];
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
**Returns:**
|
|
399
|
-
|
|
400
|
-
- `$formattedData` (array): The modified subscription data
|
|
401
|
-
|
|
402
|
-
**Source:** `app/Http/Controllers/FrontendControllers/CustomerSubscriptionController.php:175`
|
|
403
|
-
|
|
404
|
-
**Usage:**
|
|
405
|
-
|
|
406
|
-
```
|
|
407
|
-
add_filter('fluent_cart/customer_portal/subscription_data', function($formattedData, $context) {
|
|
408
|
-
// Add next invoice preview
|
|
409
|
-
$subscription = $context['subscription'];
|
|
410
|
-
$formattedData['next_invoice_preview'] = [
|
|
411
|
-
'amount' => $subscription->recurring_amount,
|
|
412
|
-
'date' => $subscription->expiration_at
|
|
413
|
-
];
|
|
414
|
-
return $formattedData;
|
|
415
|
-
}, 10, 2);
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
### ` customer/subscription_details_section_parts `
|
|
419
|
-
|
|
420
|
-
`fluent_cart/customer/subscription_details_section_parts` — Filter subscription details section parts in customer portal
|
|
421
|
-
|
|
422
|
-
**When it runs:** This filter is applied when rendering a subscription details page in the customer portal, letting you inject custom HTML into specific sections of the view. Every returned value is passed through `wp_kses_post()` before output. This is the free-plugin counterpart to Pro's `customer/license_details_section_parts`.
|
|
423
|
-
|
|
424
|
-
**Source:** `app/Http/Controllers/FrontendControllers/CustomerSubscriptionController.php:180`
|
|
425
|
-
|
|
426
|
-
**Parameters:**
|
|
427
|
-
|
|
428
|
-
- `$sectionParts` (array): Associative array of injectable HTML sections
|
|
429
|
-
|
|
430
|
-
```
|
|
431
|
-
$sectionParts = [
|
|
432
|
-
'end_of_subscription' => '',
|
|
433
|
-
];
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
- `$context` (array): Context data
|
|
437
|
-
|
|
438
|
-
```
|
|
439
|
-
$context = [
|
|
440
|
-
'subscription' => $subscription, // Subscription model
|
|
441
|
-
'formattedData' => $formattedData, // Formatted subscription data for display
|
|
442
|
-
];
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
**Returns:**
|
|
446
|
-
|
|
447
|
-
- `array` — The modified section parts. Each value is sanitized with `wp_kses_post()`.
|
|
448
|
-
|
|
449
|
-
**Usage:**
|
|
450
|
-
|
|
451
|
-
```
|
|
452
|
-
add_filter('fluent_cart/customer/subscription_details_section_parts', function ($parts, $context) {
|
|
453
|
-
$subscription = $context['subscription'];
|
|
454
|
-
|
|
455
|
-
$parts['end_of_subscription'] = sprintf(
|
|
456
|
-
'<p>%s</p>',
|
|
457
|
-
sprintf(__('Need help? Contact us about subscription #%d.', 'fluent-cart'), $subscription->id)
|
|
458
|
-
);
|
|
459
|
-
|
|
460
|
-
return $parts;
|
|
461
|
-
}, 10, 2);
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
### ` payment_methods/stripe_pub_key `
|
|
465
|
-
|
|
466
|
-
`fluent_cart/payment_methods/stripe_pub_key` — Filter Stripe public key for customer portal
|
|
467
|
-
|
|
468
|
-
**When it runs:** This filter is applied when localizing JavaScript data for the customer portal, providing the Stripe publishable key for client-side payment operations.
|
|
469
|
-
|
|
470
|
-
**Parameters:**
|
|
471
|
-
|
|
472
|
-
- `$pubKey` (string): The Stripe publishable key (default: `''`)
|
|
473
|
-
|
|
474
|
-
**Returns:**
|
|
475
|
-
|
|
476
|
-
- `$pubKey` (string): The modified Stripe public key
|
|
477
|
-
|
|
478
|
-
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:389`
|
|
479
|
-
|
|
480
|
-
**Usage:**
|
|
481
|
-
|
|
482
|
-
```
|
|
483
|
-
add_filter('fluent_cart/payment_methods/stripe_pub_key', function($pubKey) {
|
|
484
|
-
// Override Stripe key for specific conditions
|
|
485
|
-
if (defined('STRIPE_TEST_MODE') && STRIPE_TEST_MODE) {
|
|
486
|
-
return 'pk_test_xxxxxxxxxxxx';
|
|
487
|
-
}
|
|
488
|
-
return $pubKey;
|
|
489
|
-
}, 10, 1);
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
### ` payment_methods/paypal_client_id `
|
|
493
|
-
|
|
494
|
-
`fluent_cart/payment_methods/paypal_client_id` — Filter PayPal client ID for customer portal
|
|
495
|
-
|
|
496
|
-
**When it runs:** This filter is applied when localizing JavaScript data for the customer portal, providing the PayPal client ID for client-side payment operations.
|
|
497
|
-
|
|
498
|
-
**Parameters:**
|
|
499
|
-
|
|
500
|
-
- `$clientId` (string): The PayPal client ID (default: `''`)
|
|
501
|
-
- `$context` (array): Additional context data (default: `[]`)
|
|
502
|
-
|
|
503
|
-
**Returns:**
|
|
504
|
-
|
|
505
|
-
- `$clientId` (string): The modified PayPal client ID
|
|
506
|
-
|
|
507
|
-
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:390`
|
|
508
|
-
|
|
509
|
-
**Usage:**
|
|
510
|
-
|
|
511
|
-
```
|
|
512
|
-
add_filter('fluent_cart/payment_methods/paypal_client_id', function($clientId, $context) {
|
|
513
|
-
// Provide the PayPal sandbox client ID for testing
|
|
514
|
-
return 'AYourPayPalClientId';
|
|
515
|
-
}, 10, 2);
|
|
516
|
-
```
|
|
517
|
-
|
|
518
|
-
---
|
|
519
|
-
|
|
520
|
-
## Customer Statuses & Auth
|
|
521
|
-
|
|
522
|
-
### ` editable_customer_statuses `
|
|
523
|
-
|
|
524
|
-
`fluent_cart/editable_customer_statuses` — Filter editable customer statuses
|
|
525
|
-
|
|
526
|
-
**When it runs:** Applied when building the list of customer statuses an admin can set.
|
|
527
|
-
|
|
528
|
-
**Source:** `app/Helpers/Status.php:375`
|
|
529
|
-
|
|
530
|
-
**Parameters:**
|
|
531
|
-
|
|
532
|
-
- `$statuses` (array): Associative array of status key => label
|
|
533
|
-
|
|
534
|
-
```
|
|
535
|
-
$statuses = [
|
|
536
|
-
'active' => __('Active', 'fluent-cart'),
|
|
537
|
-
'inactive' => __('Inactive', 'fluent-cart'),
|
|
538
|
-
];
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
- `$context` (array): Additional context data (empty array)
|
|
542
|
-
|
|
543
|
-
**Returns:**
|
|
544
|
-
|
|
545
|
-
- `array` — The modified statuses array
|
|
546
|
-
|
|
547
|
-
**Usage:**
|
|
548
|
-
|
|
549
|
-
```
|
|
550
|
-
add_filter('fluent_cart/editable_customer_statuses', function ($statuses, $context) {
|
|
551
|
-
$statuses['suspended'] = __('Suspended', 'my-plugin');
|
|
552
|
-
return $statuses;
|
|
553
|
-
}, 10, 2);
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
### ` user/after_register/skip_hooks `
|
|
557
|
-
|
|
558
|
-
`fluent_cart/user/after_register/skip_hooks` — Skip post-registration hooks
|
|
559
|
-
|
|
560
|
-
**When it runs:** This filter is applied after a new WordPress user has been created during checkout registration. When it returns `true`, standard WordPress post-registration hooks like `register_new_user` are skipped.
|
|
561
|
-
|
|
562
|
-
**Parameters:**
|
|
563
|
-
|
|
564
|
-
- `$skip` (bool): Whether to skip the hooks (default: `false`)
|
|
565
|
-
- `$user_id` (int): The newly created WordPress user ID
|
|
566
|
-
|
|
567
|
-
**Returns:**
|
|
568
|
-
|
|
569
|
-
- `$skip` (bool): Whether to skip the post-registration hooks
|
|
570
|
-
|
|
571
|
-
**Source:** `app/Services/AuthService.php:122`
|
|
572
|
-
|
|
573
|
-
**Usage:**
|
|
574
|
-
|
|
575
|
-
```
|
|
576
|
-
add_filter('fluent_cart/user/after_register/skip_hooks', function($skip, $userId) {
|
|
577
|
-
// Skip default WP registration hooks to prevent welcome emails
|
|
578
|
-
// when creating users during checkout
|
|
579
|
-
return true;
|
|
580
|
-
}, 10, 2);
|
|
581
|
-
```
|
|
582
|
-
|
|
583
|
-
---
|
|
584
|
-
|
|
585
|
-
## Subscription Statuses & Configuration
|
|
586
|
-
|
|
587
|
-
### ` subscription_statuses `
|
|
588
|
-
|
|
589
|
-
`fluent_cart/subscription_statuses` — Filter subscription statuses
|
|
590
|
-
|
|
591
|
-
**When it runs:** This filter is applied when retrieving the list of all available subscription statuses used throughout the system.
|
|
592
|
-
|
|
593
|
-
**Parameters:**
|
|
594
|
-
|
|
595
|
-
- `$statuses` (array): Associative array of status key => label
|
|
596
|
-
|
|
597
|
-
```
|
|
598
|
-
$statuses = [
|
|
599
|
-
'pending' => 'Pending',
|
|
600
|
-
'active' => 'Active',
|
|
601
|
-
'failing' => 'Failing',
|
|
602
|
-
'paused' => 'Paused',
|
|
603
|
-
'expired' => 'Expired',
|
|
604
|
-
'expiring' => 'Expiring',
|
|
605
|
-
'canceled' => 'Canceled',
|
|
606
|
-
'trialing' => 'Trialing',
|
|
607
|
-
'intended' => 'Intended',
|
|
608
|
-
'past_due' => 'Past Due',
|
|
609
|
-
'completed' => 'Completed'
|
|
610
|
-
];
|
|
611
|
-
```
|
|
612
|
-
|
|
613
|
-
- `$context` (array): Additional context data (default: `[]`)
|
|
614
|
-
|
|
615
|
-
**Returns:**
|
|
616
|
-
|
|
617
|
-
- `$statuses` (array): The modified subscription statuses array
|
|
618
|
-
|
|
619
|
-
**Source:** `app/Helpers/Status.php:265`
|
|
620
|
-
|
|
621
|
-
**Usage:**
|
|
622
|
-
|
|
623
|
-
```
|
|
624
|
-
add_filter('fluent_cart/subscription_statuses', function($statuses, $context) {
|
|
625
|
-
// Add a custom "on_hold" status
|
|
626
|
-
$statuses['on_hold'] = __('On Hold', 'my-plugin');
|
|
627
|
-
return $statuses;
|
|
628
|
-
}, 10, 2);
|
|
629
|
-
```
|
|
630
|
-
|
|
631
|
-
### ` validable_subscription_statuses `
|
|
632
|
-
|
|
633
|
-
`fluent_cart/validable_subscription_statuses` — Filter valid (active) subscription statuses
|
|
634
|
-
|
|
635
|
-
**When it runs:** This filter is applied when determining which subscription statuses should be considered "valid" (i.e., the subscription grants access to the product/service). Used for license validation, download access, etc.
|
|
636
|
-
|
|
637
|
-
**Parameters:**
|
|
638
|
-
|
|
639
|
-
- `$statuses` (array): Array of status keys considered valid
|
|
640
|
-
|
|
641
|
-
```
|
|
642
|
-
$statuses = ['active', 'trialing'];
|
|
643
|
-
```
|
|
644
|
-
|
|
645
|
-
- `$context` (array): Additional context data (default: `[]`)
|
|
646
|
-
|
|
647
|
-
**Returns:**
|
|
648
|
-
|
|
649
|
-
- `$statuses` (array): The modified list of valid statuses
|
|
650
|
-
|
|
651
|
-
**Source:** `app/Helpers/Status.php:283`
|
|
652
|
-
|
|
653
|
-
**Usage:**
|
|
654
|
-
|
|
655
|
-
```
|
|
656
|
-
add_filter('fluent_cart/validable_subscription_statuses', function($statuses, $context) {
|
|
657
|
-
// Also treat "expiring" subscriptions as valid until they actually expire
|
|
658
|
-
$statuses[] = 'expiring';
|
|
659
|
-
return $statuses;
|
|
660
|
-
}, 10, 2);
|
|
661
|
-
```
|
|
662
|
-
|
|
663
|
-
### ` subscription/view `
|
|
664
|
-
|
|
665
|
-
`fluent_cart/subscription/view` — Filter admin subscription view data
|
|
666
|
-
|
|
667
|
-
**When it runs:** This filter is applied when preparing a single subscription's data for display in the admin panel.
|
|
668
|
-
|
|
669
|
-
**Parameters:**
|
|
670
|
-
|
|
671
|
-
- `$subscription` ([Subscription](/database/models/subscription.md)): The Subscription model with loaded relations
|
|
672
|
-
- `$context` (array): Additional context data (default: `[]`)
|
|
673
|
-
|
|
674
|
-
**Returns:**
|
|
675
|
-
|
|
676
|
-
- `$subscription` (array): The modified subscription data
|
|
677
|
-
|
|
678
|
-
**Source:** `app/Modules/Subscriptions/Http/Controllers/SubscriptionController.php:83`
|
|
679
|
-
|
|
680
|
-
**Usage:**
|
|
681
|
-
|
|
682
|
-
```
|
|
683
|
-
add_filter('fluent_cart/subscription/view', function($subscription, $context) {
|
|
684
|
-
// Add external gateway link
|
|
685
|
-
$subscription['external_url'] = 'https://dashboard.stripe.com/subscriptions/' . $subscription['vendor_subscription_id'];
|
|
686
|
-
return $subscription;
|
|
687
|
-
}, 10, 2);
|
|
688
|
-
```
|
|
689
|
-
|
|
690
|
-
### ` widgets/single_subscription_page `
|
|
691
|
-
|
|
692
|
-
`fluent_cart/widgets/single_subscription_page` — Add widgets to the admin subscription page
|
|
693
|
-
|
|
694
|
-
**When it runs:** This filter is applied when the admin opens a single subscription. The page loads its widget area from the `widgets` REST endpoint, and the cards show in the right sidebar, under Labels. The area reloads when the admin opens another subscription.
|
|
695
|
-
|
|
696
|
-
The request needs the `subscriptions/view` permission, plus `customers/view` or `orders/view`. If the subscription does not exist, the endpoint returns an error and the filter does not run.
|
|
697
|
-
|
|
698
|
-
**Parameters:**
|
|
699
|
-
|
|
700
|
-
- `$widgets` (array): Widget definitions (default: `[]`)
|
|
701
|
-
- `$data` (array): The request data, with the resolved subscription
|
|
702
|
-
|
|
703
|
-
```
|
|
704
|
-
$data = [
|
|
705
|
-
'subscription_id' => 42,
|
|
706
|
-
'subscription' => $subscription, // \FluentCart\App\Models\Subscription
|
|
707
|
-
];
|
|
708
|
-
```
|
|
709
|
-
|
|
710
|
-
**Returns:**
|
|
711
|
-
|
|
712
|
-
- `$widgets` (array): Widget definitions. Each widget is an HTML card:
|
|
713
|
-
|
|
714
|
-
```
|
|
715
|
-
[
|
|
716
|
-
'type' => 'html',
|
|
717
|
-
'title' => 'Membership',
|
|
718
|
-
'content' => '<p>...</p>', // HTML, escape your own values
|
|
719
|
-
]
|
|
720
|
-
```
|
|
721
|
-
|
|
722
|
-
**Source:** `app/Http/Controllers/WidgetsController.php:49`
|
|
723
|
-
|
|
724
|
-
**Usage:**
|
|
725
|
-
|
|
726
|
-
```
|
|
727
|
-
add_filter('fluent_cart/widgets/single_subscription_page', function ($widgets, $data) {
|
|
728
|
-
$subscription = $data['subscription'];
|
|
729
|
-
|
|
730
|
-
$widgets[] = [
|
|
731
|
-
'type' => 'html',
|
|
732
|
-
'title' => __('Membership', 'my-plugin'),
|
|
733
|
-
'content' => '<p>' . esc_html(sprintf('Plan: %s', $subscription->item_name)) . '</p>',
|
|
734
|
-
];
|
|
735
|
-
|
|
736
|
-
return $widgets;
|
|
737
|
-
}, 10, 2);
|
|
738
|
-
```
|
|
739
|
-
|
|
740
|
-
### ` subscription/url_{$payment_method} `
|
|
741
|
-
|
|
742
|
-
`fluent_cart/subscription/url_{$payment_method}` — Filter vendor dashboard URL for a subscription (dynamic)
|
|
743
|
-
|
|
744
|
-
**When it runs:** This filter is applied when generating the external vendor dashboard URL for a subscription. The hook name is dynamic, with `{$payment_method}` replaced by the subscription's current payment method (e.g., `stripe`, `paypal`).
|
|
745
|
-
|
|
746
|
-
**Parameters:**
|
|
747
|
-
|
|
748
|
-
- `$url` (string): The vendor dashboard URL (default: `''`)
|
|
749
|
-
- `$context` (array): Context data
|
|
750
|
-
|
|
751
|
-
```
|
|
752
|
-
$context = [
|
|
753
|
-
'vendor_subscription_id' => 'sub_1234567890',
|
|
754
|
-
'payment_mode' => 'live', // or 'test'
|
|
755
|
-
'subscription' => $subscription // Subscription model
|
|
756
|
-
];
|
|
757
|
-
```
|
|
758
|
-
|
|
759
|
-
**Returns:**
|
|
760
|
-
|
|
761
|
-
- `$url` (string): The modified vendor dashboard URL
|
|
762
|
-
|
|
763
|
-
**Source:** `app/Models/Subscription.php:284`
|
|
764
|
-
|
|
765
|
-
**Usage:**
|
|
766
|
-
|
|
767
|
-
```
|
|
768
|
-
// Provide the Stripe dashboard URL for subscriptions
|
|
769
|
-
add_filter('fluent_cart/subscription/url_stripe', function($url, $context) {
|
|
770
|
-
$subId = $context['vendor_subscription_id'];
|
|
771
|
-
$mode = $context['payment_mode'];
|
|
772
|
-
$base = ($mode === 'test')
|
|
773
|
-
? 'https://dashboard.stripe.com/test'
|
|
774
|
-
: 'https://dashboard.stripe.com';
|
|
775
|
-
return $base . '/subscriptions/' . $subId;
|
|
776
|
-
}, 10, 2);
|
|
777
|
-
```
|
|
778
|
-
|
|
779
|
-
### ` subscription/can_reactivate `
|
|
780
|
-
|
|
781
|
-
`fluent_cart/subscription/can_reactivate` — Filter whether a subscription can be reactivated
|
|
782
|
-
|
|
783
|
-
**When it runs:** This filter is applied when checking if a canceled, failing, expired, paused, expiring, or past-due subscription is eligible for reactivation.
|
|
784
|
-
|
|
785
|
-
**Parameters:**
|
|
786
|
-
|
|
787
|
-
- `$canReactivate` (bool): Whether the subscription can be reactivated (based on its current status)
|
|
788
|
-
- `$context` (array): Context data
|
|
789
|
-
|
|
790
|
-
```
|
|
791
|
-
$context = [
|
|
792
|
-
'subscription' => $subscription // Subscription model
|
|
793
|
-
];
|
|
794
|
-
```
|
|
795
|
-
|
|
796
|
-
**Returns:**
|
|
797
|
-
|
|
798
|
-
- `$canReactivate` (bool): The modified reactivation eligibility
|
|
799
|
-
|
|
800
|
-
**Source:** `app/Models/Subscription.php:983`
|
|
801
|
-
|
|
802
|
-
**Usage:**
|
|
803
|
-
|
|
804
|
-
```
|
|
805
|
-
add_filter('fluent_cart/subscription/can_reactivate', function($canReactivate, $context) {
|
|
806
|
-
$subscription = $context['subscription'];
|
|
807
|
-
|
|
808
|
-
// Prevent reactivation if canceled more than 90 days ago
|
|
809
|
-
if ($subscription->status === 'canceled') {
|
|
810
|
-
$canceledAt = strtotime($subscription->updated_at);
|
|
811
|
-
if ((time() - $canceledAt) > (90 * DAY_IN_SECONDS)) {
|
|
812
|
-
return false;
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
return $canReactivate;
|
|
816
|
-
}, 10, 2);
|
|
817
|
-
```
|
|
818
|
-
|
|
819
|
-
### ` subscription/vendor_id_editing_enabled `
|
|
820
|
-
|
|
821
|
-
`fluent_cart/subscription/vendor_id_editing_enabled` — Opt in to admin editing of gateway identifiers
|
|
822
|
-
|
|
823
|
-
**When it runs:** First statement of `Subscription::canEditVendorIds()`, which is the single gate behind the admin "Edit Vendor IDs" action, the `canEditVendorIds` / `canVerifyVendorIds` permission flags, the `vendor-ids` write endpoint and the `verify-vendor-ids` lookup endpoint. Default is `false`, so the whole feature is off until a site opts in.
|
|
824
|
-
|
|
825
|
-
**Parameters:**
|
|
826
|
-
|
|
827
|
-
- `$enabled` (bool): `false` by default
|
|
828
|
-
|
|
829
|
-
**Returns:**
|
|
830
|
-
|
|
831
|
-
- `$enabled` (bool): `true` to expose the repair tool
|
|
832
|
-
|
|
833
|
-
**Source:** `app/Models/Subscription.php:900`
|
|
834
|
-
|
|
835
|
-
**Usage:**
|
|
836
|
-
|
|
837
|
-
```
|
|
838
|
-
add_filter('fluent_cart/subscription/vendor_id_editing_enabled', '__return_true');
|
|
839
|
-
```
|
|
840
|
-
|
|
841
|
-
This column is what gateway webhooks resolve on
|
|
842
|
-
|
|
843
|
-
`fct_subscriptions.vendor_subscription_id` is indexed but not unique, and every gateway IPN finds its subscription through it. Enable this only while a migration or support repair is in progress, or scope it — for example to a single administrator:
|
|
844
|
-
|
|
845
|
-
```
|
|
846
|
-
add_filter('fluent_cart/subscription/vendor_id_editing_enabled', function ($enabled) {
|
|
847
|
-
return current_user_can('manage_options') && defined('FLUENTCART_ALLOW_VENDOR_ID_EDIT');
|
|
848
|
-
});
|
|
849
|
-
```
|
|
850
|
-
|
|
851
|
-
See [Editing Vendor IDs](/modules/subscription-vendor-ids.md) for the full feature.
|
|
852
|
-
|
|
853
|
-
### ` available_subscription_interval_options `
|
|
854
|
-
|
|
855
|
-
`fluent_cart/available_subscription_interval_options` — Filter subscription interval options
|
|
856
|
-
|
|
857
|
-
**When it runs:** This filter is applied when retrieving the list of available subscription billing interval options for product configuration.
|
|
858
|
-
|
|
859
|
-
**Parameters:**
|
|
860
|
-
|
|
861
|
-
- `$intervals` (array): Array of interval option objects
|
|
862
|
-
|
|
863
|
-
```
|
|
864
|
-
$intervals = [
|
|
865
|
-
['label' => 'Yearly', 'value' => 'yearly', 'map_value' => 'year'],
|
|
866
|
-
['label' => 'Half Yearly', 'value' => 'half_yearly', 'map_value' => 'half_year'],
|
|
867
|
-
['label' => 'Quarterly', 'value' => 'quarterly', 'map_value' => 'quarter'],
|
|
868
|
-
['label' => 'Monthly', 'value' => 'monthly', 'map_value' => 'month'],
|
|
869
|
-
['label' => 'Weekly', 'value' => 'weekly', 'map_value' => 'week'],
|
|
870
|
-
['label' => 'Daily', 'value' => 'daily', 'map_value' => 'day']
|
|
871
|
-
];
|
|
872
|
-
```
|
|
873
|
-
|
|
874
|
-
**Returns:**
|
|
875
|
-
|
|
876
|
-
- `$intervals` (array): The modified intervals array
|
|
877
|
-
|
|
878
|
-
**Source:** `app/Helpers/Helper.php:1740`
|
|
879
|
-
|
|
880
|
-
**Usage:**
|
|
881
|
-
|
|
882
|
-
```
|
|
883
|
-
add_filter('fluent_cart/available_subscription_interval_options', function($intervals) {
|
|
884
|
-
// Add a custom "Every 10 days" interval
|
|
885
|
-
$intervals[] = [
|
|
886
|
-
'label' => __('Every 10th Day', 'my-plugin'),
|
|
887
|
-
'value' => 'every_tenth_day',
|
|
888
|
-
'map_value' => '10th Day'
|
|
889
|
-
];
|
|
890
|
-
return $intervals;
|
|
891
|
-
});
|
|
892
|
-
```
|
|
893
|
-
|
|
894
|
-
TIP
|
|
895
|
-
|
|
896
|
-
When adding custom intervals, you must also implement the `fluent_cart/subscription_interval_in_days` and `fluent_cart/subscription_billing_period` filters so the system knows how to calculate dates and communicate with payment gateways.
|
|
897
|
-
|
|
898
|
-
### ` subscription_interval_in_days `
|
|
899
|
-
|
|
900
|
-
`fluent_cart/subscription_interval_in_days` — Filter the number of days for a custom subscription interval
|
|
901
|
-
|
|
902
|
-
**When it runs:** This filter is applied when converting a subscription interval to its day count. For built-in intervals (yearly, half_yearly, quarterly, monthly, weekly, daily), the value is calculated automatically. This filter fires for custom/unknown intervals with a default of `0`.
|
|
903
|
-
|
|
904
|
-
**Parameters:**
|
|
905
|
-
|
|
906
|
-
- `$days` (int): Number of days for the interval (default: `0` for custom intervals)
|
|
907
|
-
- `$context` (array): Context data
|
|
908
|
-
|
|
909
|
-
```
|
|
910
|
-
$context = [
|
|
911
|
-
'interval' => 'every_tenth_day' // The interval key
|
|
912
|
-
];
|
|
913
|
-
```
|
|
914
|
-
|
|
915
|
-
**Returns:**
|
|
916
|
-
|
|
917
|
-
- `$days` (int): The number of days in this interval
|
|
918
|
-
|
|
919
|
-
**Source:** `app/Helpers/Helper.php:1801`, `app/Services/Payments/PaymentHelper.php:282`
|
|
920
|
-
|
|
921
|
-
**Usage:**
|
|
922
|
-
|
|
923
|
-
```
|
|
924
|
-
add_filter('fluent_cart/subscription_interval_in_days', function($days, $args) {
|
|
925
|
-
$interval = $args['interval'];
|
|
926
|
-
|
|
927
|
-
if ($interval === 'every_tenth_day') {
|
|
928
|
-
return 10;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
if ($interval === 'biweekly') {
|
|
932
|
-
return 14;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
return $days;
|
|
936
|
-
}, 10, 2);
|
|
937
|
-
```
|
|
938
|
-
|
|
939
|
-
### ` max_trial_days_allowed `
|
|
940
|
-
|
|
941
|
-
`fluent_cart/max_trial_days_allowed` — Filter maximum trial days allowed
|
|
942
|
-
|
|
943
|
-
**When it runs:** This filter is applied when calculating adjusted trial days for a subscription interval. The system ensures the trial period does not exceed this maximum.
|
|
944
|
-
|
|
945
|
-
**Parameters:**
|
|
946
|
-
|
|
947
|
-
- `$maxDays` (int): Maximum trial days allowed (default: `365`)
|
|
948
|
-
- `$context` (array): Context data
|
|
949
|
-
|
|
950
|
-
```
|
|
951
|
-
$context = [
|
|
952
|
-
'existing_trial_days' => 14,
|
|
953
|
-
'repeat_interval' => 'monthly',
|
|
954
|
-
'interval_in_days' => 30
|
|
955
|
-
];
|
|
956
|
-
```
|
|
957
|
-
|
|
958
|
-
**Returns:**
|
|
959
|
-
|
|
960
|
-
- `$maxDays` (int): The modified maximum trial days
|
|
961
|
-
|
|
962
|
-
**Source:** `app/Helpers/Helper.php:1775`
|
|
963
|
-
|
|
964
|
-
**Usage:**
|
|
965
|
-
|
|
966
|
-
```
|
|
967
|
-
add_filter('fluent_cart/max_trial_days_allowed', function($maxDays, $args) {
|
|
968
|
-
// Cap trials at 30 days for monthly subscriptions
|
|
969
|
-
if ($args['repeat_interval'] === 'monthly') {
|
|
970
|
-
return 30;
|
|
971
|
-
}
|
|
972
|
-
return $maxDays;
|
|
973
|
-
}, 10, 2);
|
|
974
|
-
```
|
|
975
|
-
|
|
976
|
-
### ` trial_info `
|
|
977
|
-
|
|
978
|
-
`fluent_cart/trial_info` — Filter trial info display text
|
|
979
|
-
|
|
980
|
-
**When it runs:** This filter is applied when generating the human-readable trial information text shown to customers (e.g., "Free Trial: 14 days").
|
|
981
|
-
|
|
982
|
-
**Parameters:**
|
|
983
|
-
|
|
984
|
-
- `$trialInfo` (string): The generated trial info text (e.g., `'Free Trial: 14 days'` or `''` if no trial)
|
|
985
|
-
- `$otherInfo` (array): The product/variant pricing metadata
|
|
986
|
-
|
|
987
|
-
```
|
|
988
|
-
$otherInfo = [
|
|
989
|
-
'trial_days' => 14,
|
|
990
|
-
'is_trial_days_simulated' => 'no',
|
|
991
|
-
'signup_fee' => 0,
|
|
992
|
-
'manage_setup_fee' => 'no',
|
|
993
|
-
// ... other pricing info
|
|
994
|
-
];
|
|
995
|
-
```
|
|
996
|
-
|
|
997
|
-
**Returns:**
|
|
998
|
-
|
|
999
|
-
- `$trialInfo` (string): The modified trial info text
|
|
1000
|
-
|
|
1001
|
-
**Source:** `app/Helpers/Helper.php:1339`
|
|
1002
|
-
|
|
1003
|
-
**Usage:**
|
|
1004
|
-
|
|
1005
|
-
```
|
|
1006
|
-
add_filter('fluent_cart/trial_info', function($trialInfo, $otherInfo) {
|
|
1007
|
-
$days = $otherInfo['trial_days'] ?? 0;
|
|
1008
|
-
if ($days > 0) {
|
|
1009
|
-
return sprintf('Try free for %d days - no credit card required!', $days);
|
|
1010
|
-
}
|
|
1011
|
-
return $trialInfo;
|
|
1012
|
-
}, 10, 2);
|
|
1013
|
-
```
|
|
1014
|
-
|
|
1015
|
-
---
|
|
1016
|
-
|
|
1017
|
-
## Subscription Billing
|
|
1018
|
-
|
|
1019
|
-
### ` subscription_billing_period `
|
|
1020
|
-
|
|
1021
|
-
`fluent_cart/subscription_billing_period` — Filter billing period for payment gateways
|
|
1022
|
-
|
|
1023
|
-
**When it runs:** This filter is applied when translating a FluentCart subscription interval into the payment gateway's billing period format (used by Stripe Plans and PayPal billing cycles).
|
|
1024
|
-
|
|
1025
|
-
**Parameters:**
|
|
1026
|
-
|
|
1027
|
-
- `$billingPeriod` (array): The billing period for the gateway
|
|
1028
|
-
|
|
1029
|
-
```
|
|
1030
|
-
$billingPeriod = [
|
|
1031
|
-
'interval_unit' => 'month', // day, week, month, year
|
|
1032
|
-
'interval_frequency' => 1 // e.g., 3 for quarterly
|
|
1033
|
-
];
|
|
1034
|
-
```
|
|
1035
|
-
|
|
1036
|
-
- `$context` (array): Context data
|
|
1037
|
-
|
|
1038
|
-
```
|
|
1039
|
-
$context = [
|
|
1040
|
-
'subscription_interval' => 'quarterly', // Original FluentCart interval
|
|
1041
|
-
'payment_method' => 'stripe' // or 'paypal'
|
|
1042
|
-
];
|
|
1043
|
-
```
|
|
1044
|
-
|
|
1045
|
-
**Returns:**
|
|
1046
|
-
|
|
1047
|
-
- `$billingPeriod` (array): The modified billing period
|
|
1048
|
-
|
|
1049
|
-
**Source:** `app/Modules/PaymentMethods/StripeGateway/Plan.php:58`, `app/Modules/PaymentMethods/PayPalGateway/PayPalHelper.php:243`
|
|
1050
|
-
|
|
1051
|
-
**Usage:**
|
|
1052
|
-
|
|
1053
|
-
```
|
|
1054
|
-
add_filter('fluent_cart/subscription_billing_period', function($billingPeriod, $args) {
|
|
1055
|
-
$interval = $args['subscription_interval'];
|
|
1056
|
-
$method = $args['payment_method'];
|
|
1057
|
-
|
|
1058
|
-
if ($interval === 'every_tenth_day') {
|
|
1059
|
-
if ($method === 'stripe') {
|
|
1060
|
-
return [
|
|
1061
|
-
'interval_unit' => 'day',
|
|
1062
|
-
'interval_frequency' => 10
|
|
1063
|
-
];
|
|
1064
|
-
}
|
|
1065
|
-
if ($method === 'paypal') {
|
|
1066
|
-
return [
|
|
1067
|
-
'interval_unit' => 'DAY',
|
|
1068
|
-
'interval_frequency' => 10
|
|
1069
|
-
];
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
return $billingPeriod;
|
|
1074
|
-
}, 10, 2);
|
|
1075
|
-
```
|
|
1076
|
-
|
|
1077
|
-
### ` subscription/grace_period_days `
|
|
1078
|
-
|
|
1079
|
-
`fluent_cart/subscription/grace_period_days` — Filter grace period days per billing interval
|
|
1080
|
-
|
|
1081
|
-
**When it runs:** This filter is applied when retrieving the grace period (number of extra days after a payment fails before the subscription is marked as expired) for each billing interval.
|
|
1082
|
-
|
|
1083
|
-
**Parameters:**
|
|
1084
|
-
|
|
1085
|
-
- `$gracePeriods` (array): Associative array of interval => days
|
|
1086
|
-
|
|
1087
|
-
```
|
|
1088
|
-
$gracePeriods = [
|
|
1089
|
-
'daily' => 1,
|
|
1090
|
-
'weekly' => 3,
|
|
1091
|
-
'monthly' => 7,
|
|
1092
|
-
'quarterly' => 15,
|
|
1093
|
-
'half_yearly' => 15,
|
|
1094
|
-
'yearly' => 15
|
|
1095
|
-
];
|
|
1096
|
-
```
|
|
1097
|
-
|
|
1098
|
-
**Returns:**
|
|
1099
|
-
|
|
1100
|
-
- `$gracePeriods` (array): The modified grace period days
|
|
1101
|
-
|
|
1102
|
-
**Source:** `app/Services/Payments/SubscriptionHelper.php:188`
|
|
1103
|
-
|
|
1104
|
-
**Usage:**
|
|
1105
|
-
|
|
1106
|
-
```
|
|
1107
|
-
add_filter('fluent_cart/subscription/grace_period_days', function($gracePeriods) {
|
|
1108
|
-
// Give yearly subscribers more time
|
|
1109
|
-
$gracePeriods['yearly'] = 30;
|
|
1110
|
-
|
|
1111
|
-
// Add grace period for custom interval
|
|
1112
|
-
$gracePeriods['every_tenth_day'] = 5;
|
|
1113
|
-
|
|
1114
|
-
return $gracePeriods;
|
|
1115
|
-
});
|
|
1116
|
-
```
|
|
1117
|
-
|
|
1118
|
-
---
|
|
1119
|
-
|
|
1120
|
-
## Reminders
|
|
1121
|
-
|
|
1122
|
-
### ` reminders/scan_batch_size `
|
|
1123
|
-
|
|
1124
|
-
`fluent_cart/reminders/scan_batch_size` — Filter reminder scan batch size
|
|
1125
|
-
|
|
1126
|
-
**When it runs:** This filter is applied when the automated reminder system scans for subscriptions or invoices that need reminders. Controls how many records are processed per batch.
|
|
1127
|
-
|
|
1128
|
-
**Parameters:**
|
|
1129
|
-
|
|
1130
|
-
- `$batchSize` (int): Number of records per scan batch (default: `100`, min: `10`, max: `500`)
|
|
1131
|
-
|
|
1132
|
-
**Returns:**
|
|
1133
|
-
|
|
1134
|
-
- `$batchSize` (int): The modified batch size
|
|
1135
|
-
|
|
1136
|
-
**Source:** `app/Services/Reminders/ReminderService.php:355`
|
|
1137
|
-
|
|
1138
|
-
**Usage:**
|
|
1139
|
-
|
|
1140
|
-
```
|
|
1141
|
-
add_filter('fluent_cart/reminders/scan_batch_size', function($batchSize) {
|
|
1142
|
-
// Process more records per batch on high-traffic sites
|
|
1143
|
-
return 250;
|
|
1144
|
-
});
|
|
1145
|
-
```
|
|
1146
|
-
|
|
1147
|
-
### ` reminders/renewal_due_days `
|
|
1148
|
-
|
|
1149
|
-
`fluent_cart/reminders/renewal_due_days` — Filter renewal due-reminder days
|
|
1150
|
-
|
|
1151
|
-
**When it runs:** This filter is applied when determining how many days before a renewal is due to send a reminder. The value comes from the `renewal_reminder_due_days` store setting (default `0`) but can be overridden.
|
|
1152
|
-
|
|
1153
|
-
**Parameters:**
|
|
1154
|
-
|
|
1155
|
-
- `$days` (int): Number of days before the due date to send a reminder (min: `0`)
|
|
1156
|
-
|
|
1157
|
-
**Returns:**
|
|
1158
|
-
|
|
1159
|
-
- `$days` (int): The modified number of days
|
|
1160
|
-
|
|
1161
|
-
**Source:** `app/Services/Reminders/RenewalReminderService.php:294`
|
|
1162
|
-
|
|
1163
|
-
**Usage:**
|
|
1164
|
-
|
|
1165
|
-
```
|
|
1166
|
-
add_filter('fluent_cart/reminders/renewal_due_days', function($days) {
|
|
1167
|
-
// Always remind 3 days before a renewal is due
|
|
1168
|
-
return 3;
|
|
1169
|
-
});
|
|
1170
|
-
```
|
|
1171
|
-
|
|
1172
|
-
### ` reminders/renewal_overdue_days `
|
|
1173
|
-
|
|
1174
|
-
`fluent_cart/reminders/renewal_overdue_days` — Filter overdue renewal reminder intervals
|
|
1175
|
-
|
|
1176
|
-
**When it runs:** This filter is applied when determining at which day intervals after a renewal becomes overdue to send follow-up reminders. The list is parsed from the `renewal_reminder_overdue_days` store setting (default `1,3,7`) into an array before the filter runs.
|
|
1177
|
-
|
|
1178
|
-
**Parameters:**
|
|
1179
|
-
|
|
1180
|
-
- `$days` (array): Array of day intervals for overdue reminders (default `[1, 3, 7]`)
|
|
1181
|
-
|
|
1182
|
-
**Returns:**
|
|
1183
|
-
|
|
1184
|
-
- `$days` (array): The modified array of overdue reminder day intervals
|
|
1185
|
-
|
|
1186
|
-
**Source:** `app/Services/Reminders/RenewalReminderService.php:305`
|
|
1187
|
-
|
|
1188
|
-
**Usage:**
|
|
1189
|
-
|
|
1190
|
-
```
|
|
1191
|
-
add_filter('fluent_cart/reminders/renewal_overdue_days', function($days) {
|
|
1192
|
-
// Send overdue reminders at 1, 3, 7, and 14 days past due
|
|
1193
|
-
return [1, 3, 7, 14];
|
|
1194
|
-
});
|
|
1195
|
-
```
|
|
1196
|
-
|
|
1197
|
-
### ` reminders/billing_cycle `
|
|
1198
|
-
|
|
1199
|
-
`fluent_cart/reminders/billing_cycle` — Filter billing cycle name for reminder processing
|
|
1200
|
-
|
|
1201
|
-
**When it runs:** This filter is applied when mapping a subscription's billing interval to a billing cycle identifier used by the reminder system. Returns `'unsupported'` for unknown intervals by default.
|
|
1202
|
-
|
|
1203
|
-
**Parameters:**
|
|
1204
|
-
|
|
1205
|
-
- `$cycle` (string): The billing cycle name (e.g., `'monthly'`, `'yearly'`, `'unsupported'`)
|
|
1206
|
-
- `$subscription` ([Subscription](/database/models/subscription.md)): The Subscription model instance
|
|
1207
|
-
|
|
1208
|
-
**Returns:**
|
|
1209
|
-
|
|
1210
|
-
- `$cycle` (string): The modified billing cycle name
|
|
1211
|
-
|
|
1212
|
-
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:508`
|
|
1213
|
-
|
|
1214
|
-
**Usage:**
|
|
1215
|
-
|
|
1216
|
-
```
|
|
1217
|
-
add_filter('fluent_cart/reminders/billing_cycle', function($cycle, $subscription) {
|
|
1218
|
-
// Map custom intervals to supported reminder cycles
|
|
1219
|
-
if ($subscription->billing_interval === 'every_tenth_day') {
|
|
1220
|
-
return 'daily'; // Use daily reminder logic
|
|
1221
|
-
}
|
|
1222
|
-
return $cycle;
|
|
1223
|
-
}, 10, 2);
|
|
1224
|
-
```
|
|
1225
|
-
|
|
1226
|
-
### ` reminders/yearly_before_days `
|
|
1227
|
-
|
|
1228
|
-
`fluent_cart/reminders/yearly_before_days` — Filter days before yearly renewal reminder
|
|
1229
|
-
|
|
1230
|
-
**When it runs:** This filter is applied when determining at which day intervals before a yearly subscription renewal to send reminders.
|
|
1231
|
-
|
|
1232
|
-
**Parameters:**
|
|
1233
|
-
|
|
1234
|
-
- `$days` (array): Array of day intervals before renewal (default from settings: `[30]`, range: 7-90)
|
|
1235
|
-
|
|
1236
|
-
**Returns:**
|
|
1237
|
-
|
|
1238
|
-
- `$days` (array): The modified array of reminder day intervals
|
|
1239
|
-
|
|
1240
|
-
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:540`
|
|
1241
|
-
|
|
1242
|
-
**Usage:**
|
|
1243
|
-
|
|
1244
|
-
```
|
|
1245
|
-
add_filter('fluent_cart/reminders/yearly_before_days', function($days) {
|
|
1246
|
-
// Remind at 60, 30, and 7 days before yearly renewal
|
|
1247
|
-
return [60, 30, 7];
|
|
1248
|
-
});
|
|
1249
|
-
```
|
|
1250
|
-
|
|
1251
|
-
### ` reminders/monthly_before_days `
|
|
1252
|
-
|
|
1253
|
-
`fluent_cart/reminders/monthly_before_days` — Filter days before monthly renewal reminder
|
|
1254
|
-
|
|
1255
|
-
**When it runs:** This filter is applied when determining at which day intervals before a monthly subscription renewal to send reminders.
|
|
1256
|
-
|
|
1257
|
-
**Parameters:**
|
|
1258
|
-
|
|
1259
|
-
- `$days` (array): Array of day intervals before renewal (default from settings: `[7]`, range: 3-28)
|
|
1260
|
-
|
|
1261
|
-
**Returns:**
|
|
1262
|
-
|
|
1263
|
-
- `$days` (array): The modified array of reminder day intervals
|
|
1264
|
-
|
|
1265
|
-
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:552`
|
|
1266
|
-
|
|
1267
|
-
**Usage:**
|
|
1268
|
-
|
|
1269
|
-
```
|
|
1270
|
-
add_filter('fluent_cart/reminders/monthly_before_days', function($days) {
|
|
1271
|
-
// Remind at 7 and 3 days before monthly renewal
|
|
1272
|
-
return [7, 3];
|
|
1273
|
-
});
|
|
1274
|
-
```
|
|
1275
|
-
|
|
1276
|
-
### ` reminders/quarterly_before_days `
|
|
1277
|
-
|
|
1278
|
-
`fluent_cart/reminders/quarterly_before_days` — Filter days before quarterly renewal reminder
|
|
1279
|
-
|
|
1280
|
-
**When it runs:** This filter is applied when determining at which day intervals before a quarterly subscription renewal to send reminders.
|
|
1281
|
-
|
|
1282
|
-
**Parameters:**
|
|
1283
|
-
|
|
1284
|
-
- `$days` (array): Array of day intervals before renewal (default from settings: `[14]`, range: 7-60)
|
|
1285
|
-
|
|
1286
|
-
**Returns:**
|
|
1287
|
-
|
|
1288
|
-
- `$days` (array): The modified array of reminder day intervals
|
|
1289
|
-
|
|
1290
|
-
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:564`
|
|
1291
|
-
|
|
1292
|
-
**Usage:**
|
|
1293
|
-
|
|
1294
|
-
```
|
|
1295
|
-
add_filter('fluent_cart/reminders/quarterly_before_days', function($days) {
|
|
1296
|
-
// Remind at 21 and 7 days before quarterly renewal
|
|
1297
|
-
return [21, 7];
|
|
1298
|
-
});
|
|
1299
|
-
```
|
|
1300
|
-
|
|
1301
|
-
### ` reminders/half_yearly_before_days `
|
|
1302
|
-
|
|
1303
|
-
`fluent_cart/reminders/half_yearly_before_days` — Filter days before half-yearly renewal reminder
|
|
1304
|
-
|
|
1305
|
-
**When it runs:** This filter is applied when determining at which day intervals before a half-yearly subscription renewal to send reminders.
|
|
1306
|
-
|
|
1307
|
-
**Parameters:**
|
|
1308
|
-
|
|
1309
|
-
- `$days` (array): Array of day intervals before renewal (default from settings: `[21]`, range: 7-60)
|
|
1310
|
-
|
|
1311
|
-
**Returns:**
|
|
1312
|
-
|
|
1313
|
-
- `$days` (array): The modified array of reminder day intervals
|
|
1314
|
-
|
|
1315
|
-
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:576`
|
|
1316
|
-
|
|
1317
|
-
**Usage:**
|
|
1318
|
-
|
|
1319
|
-
```
|
|
1320
|
-
add_filter('fluent_cart/reminders/half_yearly_before_days', function($days) {
|
|
1321
|
-
// Remind at 30 and 7 days before half-yearly renewal
|
|
1322
|
-
return [30, 7];
|
|
1323
|
-
});
|
|
1324
|
-
```
|
|
1325
|
-
|
|
1326
|
-
### ` reminders/trial_end_days `
|
|
1327
|
-
|
|
1328
|
-
`fluent_cart/reminders/trial_end_days` — Filter days before trial end reminder
|
|
1329
|
-
|
|
1330
|
-
**When it runs:** This filter is applied when determining at which day intervals before a trial period ends to send reminders to the customer.
|
|
1331
|
-
|
|
1332
|
-
**Parameters:**
|
|
1333
|
-
|
|
1334
|
-
- `$days` (array): Array of day intervals before trial ends (default from settings: `[3]`, range: 1-14)
|
|
1335
|
-
|
|
1336
|
-
**Returns:**
|
|
1337
|
-
|
|
1338
|
-
- `$days` (array): The modified array of reminder day intervals
|
|
1339
|
-
|
|
1340
|
-
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:588`
|
|
1341
|
-
|
|
1342
|
-
**Usage:**
|
|
1343
|
-
|
|
1344
|
-
```
|
|
1345
|
-
add_filter('fluent_cart/reminders/trial_end_days', function($days) {
|
|
1346
|
-
// Remind at 7, 3, and 1 day before trial ends
|
|
1347
|
-
return [7, 3, 1];
|
|
1348
|
-
});
|
|
1349
|
-
```
|
|
1350
|
-
|
|
1351
|
-
---
|
|
1352
|
-
|
|
1353
|
-
## Collection Method & Auto-Charge Store-managed
|
|
1354
|
-
|
|
1355
|
-
Filters for the [store-managed subscription engine](/modules/subscriptions.md) — how the collection method is chosen, how renewals are scheduled, and how the `system` auto-charge retry/notification behaviour is tuned.
|
|
1356
|
-
|
|
1357
|
-
### ` subscription/management_mode `
|
|
1358
|
-
|
|
1359
|
-
`fluent_cart/subscription/management_mode` — Filter the effective subscription management mode
|
|
1360
|
-
|
|
1361
|
-
**When it runs:** This filter is applied when resolving the store's subscription management mode — `gateway_managed` or `store_managed` — which decides whether new subscriptions are billed by the gateway or by FluentCart's renewal engine.
|
|
1362
|
-
|
|
1363
|
-
**Parameters:**
|
|
1364
|
-
|
|
1365
|
-
- `$mode` (string): The management mode (`'gateway_managed'` or `'store_managed'`)
|
|
1366
|
-
|
|
1367
|
-
**Returns:**
|
|
1368
|
-
|
|
1369
|
-
- `$mode` (string): The (possibly overridden) mode
|
|
1370
|
-
|
|
1371
|
-
**Source:** `app/Modules/Subscriptions/Services/SubscriptionManagementMode.php:36`
|
|
1372
|
-
|
|
1373
|
-
**Usage:**
|
|
1374
|
-
|
|
1375
|
-
```
|
|
1376
|
-
add_filter('fluent_cart/subscription/management_mode', function($mode) {
|
|
1377
|
-
return 'store_managed';
|
|
1378
|
-
});
|
|
1379
|
-
```
|
|
1380
|
-
|
|
1381
|
-
### ` subscription_collection_method_{gateway} `
|
|
1382
|
-
|
|
1383
|
-
`fluent_cart/subscription_collection_method_{gateway}` — Per-gateway override of the resolved collection method
|
|
1384
|
-
|
|
1385
|
-
**When it runs:** This **dynamic** filter is applied at checkout after the collection method (`automatic` / `manual` / `system`) has been resolved for the chosen gateway. The `{gateway}` suffix is the payment method slug (e.g. `stripe`, `paypal`), so you can target a single gateway. It gets the last word over the decision matrix.
|
|
1386
|
-
|
|
1387
|
-
**Parameters:**
|
|
1388
|
-
|
|
1389
|
-
- `$collectionMethod` (string): The resolved collection method
|
|
1390
|
-
|
|
1391
|
-
**Returns:**
|
|
1392
|
-
|
|
1393
|
-
- `$collectionMethod` (string): The (possibly overridden) collection method
|
|
1394
|
-
|
|
1395
|
-
**Source:** `app/Helpers/CheckoutProcessor.php:963`
|
|
1396
|
-
|
|
1397
|
-
**Usage:**
|
|
1398
|
-
|
|
1399
|
-
```
|
|
1400
|
-
// Force PayPal subscriptions onto the store-managed manual engine
|
|
1401
|
-
add_filter('fluent_cart/subscription_collection_method_paypal', function($collectionMethod) {
|
|
1402
|
-
return 'manual';
|
|
1403
|
-
});
|
|
1404
|
-
```
|
|
1405
|
-
|
|
1406
|
-
### ` subscription/allowed_intervals `
|
|
1407
|
-
|
|
1408
|
-
`fluent_cart/subscription/allowed_intervals` — Filter the intervals a subscription may be changed to
|
|
1409
|
-
|
|
1410
|
-
**When it runs:** This filter is applied when validating an edit to a store-managed subscription's billing interval, controlling which target intervals are permitted.
|
|
1411
|
-
|
|
1412
|
-
**Parameters:**
|
|
1413
|
-
|
|
1414
|
-
- `$intervals` (array): Allowed interval identifiers
|
|
1415
|
-
- `$context` (array): `['subscription' => Subscription, 'current_interval' => string, 'new_interval' => string]`
|
|
1416
|
-
|
|
1417
|
-
**Returns:**
|
|
1418
|
-
|
|
1419
|
-
- `$intervals` (array): The (possibly modified) allowed intervals
|
|
1420
|
-
|
|
1421
|
-
**Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:966`
|
|
1422
|
-
|
|
1423
|
-
**Usage:**
|
|
1424
|
-
|
|
1425
|
-
```
|
|
1426
|
-
add_filter('fluent_cart/subscription/allowed_intervals', function($intervals, $context) {
|
|
1427
|
-
return $intervals;
|
|
1428
|
-
}, 10, 2);
|
|
1429
|
-
```
|
|
1430
|
-
|
|
1431
|
-
### ` renewal/advance_creation_days `
|
|
1432
|
-
|
|
1433
|
-
`fluent_cart/renewal/advance_creation_days` — Filter how many days ahead a renewal order is generated
|
|
1434
|
-
|
|
1435
|
-
**When it runs:** This filter is applied by the renewal engine when deciding how far in advance of the due date to generate the next renewal order. The map is keyed by billing interval.
|
|
1436
|
-
|
|
1437
|
-
**Parameters:**
|
|
1438
|
-
|
|
1439
|
-
- `$map` (array): Interval => advance-days map (e.g. `['month' => 3, 'year' => 7]`)
|
|
1440
|
-
- `$interval` (string): The subscription's billing interval being resolved
|
|
1441
|
-
|
|
1442
|
-
**Returns:**
|
|
1443
|
-
|
|
1444
|
-
- `$map` (array): The (possibly modified) advance-days map
|
|
1445
|
-
|
|
1446
|
-
**Source:** `app/Modules/StoreManagedRenewal/Services/RenewalService.php:911`
|
|
1447
|
-
|
|
1448
|
-
**Usage:**
|
|
1449
|
-
|
|
1450
|
-
```
|
|
1451
|
-
add_filter('fluent_cart/renewal/advance_creation_days', function($map, $interval) {
|
|
1452
|
-
$map['month'] = 5; // generate monthly renewals 5 days early
|
|
1453
|
-
return $map;
|
|
1454
|
-
}, 10, 2);
|
|
1455
|
-
```
|
|
1456
|
-
|
|
1457
|
-
### ` subscriptions/system_charge_retry_offsets `
|
|
1458
|
-
|
|
1459
|
-
`fluent_cart/subscriptions/system_charge_retry_offsets` — Filter the off-session charge retry ladder
|
|
1460
|
-
|
|
1461
|
-
**When it runs:** This filter is applied when building the retry schedule for a failed `system` auto-charge. Offsets are day fractions from the anchor, bounded by the grace window.
|
|
1462
|
-
|
|
1463
|
-
**Parameters:**
|
|
1464
|
-
|
|
1465
|
-
- `$offsets` (array): Retry offsets in days (floats)
|
|
1466
|
-
- `$context` (array): `['subscription' => Subscription, 'grace_days' => int]`
|
|
1467
|
-
|
|
1468
|
-
**Returns:**
|
|
1469
|
-
|
|
1470
|
-
- `$offsets` (array): The (possibly modified) retry offsets
|
|
1471
|
-
|
|
1472
|
-
**Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:213`
|
|
1473
|
-
|
|
1474
|
-
**Usage:**
|
|
1475
|
-
|
|
1476
|
-
```
|
|
1477
|
-
add_filter('fluent_cart/subscriptions/system_charge_retry_offsets', function($offsets, $context) {
|
|
1478
|
-
return [0, 1, 3]; // retry immediately, after 1 day, after 3 days
|
|
1479
|
-
}, 10, 2);
|
|
1480
|
-
```
|
|
1481
|
-
|
|
1482
|
-
### ` subscriptions/system_charge_failure_notify `
|
|
1483
|
-
|
|
1484
|
-
`fluent_cart/subscriptions/system_charge_failure_notify` — Decide whether to notify the customer on a failed charge
|
|
1485
|
-
|
|
1486
|
-
**When it runs:** This filter is applied when a `system` charge attempt fails, to decide whether the customer should be emailed for this attempt. Defaults to `true` only on the first attempt.
|
|
1487
|
-
|
|
1488
|
-
**Parameters:**
|
|
1489
|
-
|
|
1490
|
-
- `$notify` (bool): Whether to send a notification (default: `$attempt === 1`)
|
|
1491
|
-
- `$context` (array): `['order' => Order, 'subscription' => Subscription, 'attempt' => int]`
|
|
1492
|
-
|
|
1493
|
-
**Returns:**
|
|
1494
|
-
|
|
1495
|
-
- `$notify` (bool): Whether to notify
|
|
1496
|
-
|
|
1497
|
-
**Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:739`
|
|
1498
|
-
|
|
1499
|
-
**Usage:**
|
|
1500
|
-
|
|
1501
|
-
```
|
|
1502
|
-
add_filter('fluent_cart/subscriptions/system_charge_failure_notify', function($notify, $context) {
|
|
1503
|
-
return true; // notify on every failed attempt
|
|
1504
|
-
}, 10, 2);
|
|
1505
|
-
```
|
|
1506
|
-
|
|
1507
|
-
### ` subscriptions/upcoming_charge_notification `
|
|
1508
|
-
|
|
1509
|
-
`fluent_cart/subscriptions/upcoming_charge_notification` — Toggle the upcoming auto-charge notice
|
|
1510
|
-
|
|
1511
|
-
**When it runs:** This filter is applied before sending the "an automatic charge is coming up" notification for a `system` renewal.
|
|
1512
|
-
|
|
1513
|
-
**Parameters:**
|
|
1514
|
-
|
|
1515
|
-
- `$send` (bool): Whether to send the upcoming-charge notice (default: `true`)
|
|
1516
|
-
- `$data` (array): The renewal notification payload
|
|
1517
|
-
|
|
1518
|
-
**Returns:**
|
|
1519
|
-
|
|
1520
|
-
- `$send` (bool): Whether to send
|
|
1521
|
-
|
|
1522
|
-
**Source:** `app/Services/Email/EmailNotificationMailer.php:95`
|
|
1523
|
-
|
|
1524
|
-
**Usage:**
|
|
1525
|
-
|
|
1526
|
-
```
|
|
1527
|
-
add_filter('fluent_cart/subscriptions/upcoming_charge_notification', function($send, $data) {
|
|
1528
|
-
return $send;
|
|
1529
|
-
}, 10, 2);
|
|
1530
|
-
```
|
|
1531
|
-
|
|
1532
|
-
### ` subscriptions/system_billing_enabled `
|
|
1533
|
-
|
|
1534
|
-
`fluent_cart/subscriptions/system_billing_enabled` — Master switch for system auto-charge billing
|
|
1535
|
-
|
|
1536
|
-
**When it runs:** This filter is checked before the `system` charge engine runs. Returning `false` disables off-session auto-charging store-wide (subscriptions bill as `manual`).
|
|
1537
|
-
|
|
1538
|
-
**Parameters:**
|
|
1539
|
-
|
|
1540
|
-
- `$enabled` (bool): Whether system billing is enabled (default: `true`)
|
|
1541
|
-
|
|
1542
|
-
**Returns:**
|
|
1543
|
-
|
|
1544
|
-
- `$enabled` (bool): Whether to allow system billing
|
|
1545
|
-
|
|
1546
|
-
**Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:57`
|
|
1547
|
-
|
|
1548
|
-
**Usage:**
|
|
1549
|
-
|
|
1550
|
-
```
|
|
1551
|
-
add_filter('fluent_cart/subscriptions/system_billing_enabled', function($enabled) {
|
|
1552
|
-
return false; // turn off all automatic renewal charges
|
|
1553
|
-
});
|
|
1554
|
-
```
|
|
1555
|
-
|
|
1556
|
-
### ` subscriptions/system_collection_enabled `
|
|
1557
|
-
|
|
1558
|
-
`fluent_cart/subscriptions/system_collection_enabled` — Whether new subscriptions may resolve to `system`
|
|
1559
|
-
|
|
1560
|
-
**When it runs:** This filter gates whether a new subscription is allowed to be created with the `system` collection method at checkout. Returning `false` keeps store-managed subscriptions on `manual` even when the gateway supports auto-charge.
|
|
1561
|
-
|
|
1562
|
-
**Parameters:**
|
|
1563
|
-
|
|
1564
|
-
- `$enabled` (bool): Whether system collection is enabled (default: `true`)
|
|
1565
|
-
|
|
1566
|
-
**Returns:**
|
|
1567
|
-
|
|
1568
|
-
- `$enabled` (bool): Whether to allow the `system` collection method
|
|
1569
|
-
|
|
1570
|
-
**Source:** `app/Modules/Subscriptions/Services/SubscriptionManagementMode.php:55`
|
|
1571
|
-
|
|
1572
|
-
**Usage:**
|
|
1573
|
-
|
|
1574
|
-
```
|
|
1575
|
-
add_filter('fluent_cart/subscriptions/system_collection_enabled', function($enabled) {
|
|
1576
|
-
return false; // customers pay each renewal by hand, no saved-card auto-charge
|
|
1577
|
-
});
|
|
1578
|
-
```
|
|
1579
|
-
|
|
1580
|
-
---
|
|
1581
|
-
|
|
1582
|
-
## Pro: Early Payments & Reactivation
|
|
1583
|
-
|
|
1584
|
-
### ` subscription/early_payment_enabled `
|
|
1585
|
-
|
|
1586
|
-
`fluent_cart/subscription/early_payment_enabled` — Filter whether early installment payments are enabled
|
|
1587
|
-
|
|
1588
|
-
**When it runs:** This filter is applied when checking if the early payment feature for installment subscriptions is globally enabled. Requires FluentCart Pro to be active.
|
|
1589
|
-
|
|
1590
|
-
**Parameters:**
|
|
1591
|
-
|
|
1592
|
-
- `$isEnabled` (bool): Whether early payments are enabled (from store settings `enable_early_payment_for_installment`)
|
|
1593
|
-
|
|
1594
|
-
**Returns:**
|
|
1595
|
-
|
|
1596
|
-
- `$isEnabled` (bool): The modified enabled state
|
|
1597
|
-
|
|
1598
|
-
**Source:** `app/Modules/Subscriptions/Services/EarlyPaymentFeature.php:14`
|
|
1599
|
-
|
|
1600
|
-
**Usage:**
|
|
1601
|
-
|
|
1602
|
-
```
|
|
1603
|
-
add_filter('fluent_cart/subscription/early_payment_enabled', function($isEnabled) {
|
|
1604
|
-
// Disable early payments during a specific promotion period
|
|
1605
|
-
if (current_time('Y-m') === '2026-12') {
|
|
1606
|
-
return false;
|
|
1607
|
-
}
|
|
1608
|
-
return $isEnabled;
|
|
1609
|
-
});
|
|
1610
|
-
```
|
|
1611
|
-
|
|
1612
|
-
### ` subscription/can_early_pay `
|
|
1613
|
-
|
|
1614
|
-
`fluent_cart/subscription/can_early_pay` — Filter whether a specific subscription can make an early payment
|
|
1615
|
-
|
|
1616
|
-
**When it runs:** This filter is applied when checking if a specific installment subscription is eligible for early payment. The default check requires that early payments are globally enabled, the subscription has a finite bill count, there are remaining installments, and the subscription status is `active` or `trialing`.
|
|
1617
|
-
|
|
1618
|
-
**Parameters:**
|
|
1619
|
-
|
|
1620
|
-
- `$canPay` (bool): Whether the subscription can make an early payment
|
|
1621
|
-
- `$context` (array): Context data
|
|
1622
|
-
|
|
1623
|
-
```
|
|
1624
|
-
$context = [
|
|
1625
|
-
'subscription' => $subscription // Subscription model
|
|
1626
|
-
];
|
|
1627
|
-
```
|
|
1628
|
-
|
|
1629
|
-
**Returns:**
|
|
1630
|
-
|
|
1631
|
-
- `$canPay` (bool): The modified eligibility
|
|
1632
|
-
|
|
1633
|
-
**Source:** `app/Modules/Subscriptions/Services/EarlyPaymentFeature.php:26`
|
|
1634
|
-
|
|
1635
|
-
**Usage:**
|
|
1636
|
-
|
|
1637
|
-
```
|
|
1638
|
-
add_filter('fluent_cart/subscription/can_early_pay', function($canPay, $context) {
|
|
1639
|
-
$subscription = $context['subscription'];
|
|
1640
|
-
|
|
1641
|
-
// Only allow early payments for subscriptions with more than 2 remaining installments
|
|
1642
|
-
$remaining = $subscription->bill_times - $subscription->bill_count;
|
|
1643
|
-
if ($remaining <= 2) {
|
|
1644
|
-
return false;
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
|
-
return $canPay;
|
|
1648
|
-
}, 10, 2);
|
|
1649
|
-
```
|
|
1650
|
-
|
|
1651
|
-
### ` subscription/reactivation_same_price_days_limit `
|
|
1652
|
-
|
|
1653
|
-
`fluent_cart/subscription/reactivation_same_price_days_limit` Pro — Filter days limit for same-price reactivation
|
|
1654
|
-
|
|
1655
|
-
**When it runs:** This filter is applied when a customer reactivates a canceled or expired subscription. If the subscription was canceled within this many days, the customer can reactivate at the original price without going through a new checkout.
|
|
1656
|
-
|
|
1657
|
-
**Parameters:**
|
|
1658
|
-
|
|
1659
|
-
- `$daysLimit` (int): Number of days within which same-price reactivation is allowed (default: `60`)
|
|
1660
|
-
- `$context` (array): Context data
|
|
1661
|
-
|
|
1662
|
-
```
|
|
1663
|
-
$context = [
|
|
1664
|
-
'subscription' => $subscription // Subscription model
|
|
1665
|
-
];
|
|
1666
|
-
```
|
|
1667
|
-
|
|
1668
|
-
**Returns:**
|
|
1669
|
-
|
|
1670
|
-
- `$daysLimit` (int): The modified days limit
|
|
1671
|
-
|
|
1672
|
-
**Source:** `fluent-cart-pro/app/Hooks/Handlers/SubscriptionRenewalHandler.php:288`
|
|
1673
|
-
|
|
1674
|
-
**Usage:**
|
|
1675
|
-
|
|
1676
|
-
```
|
|
1677
|
-
add_filter('fluent_cart/subscription/reactivation_same_price_days_limit', function($daysLimit, $context) {
|
|
1678
|
-
$subscription = $context['subscription'];
|
|
1679
|
-
|
|
1680
|
-
// Give yearly subscribers a longer reactivation window
|
|
1681
|
-
if ($subscription->billing_interval === 'yearly') {
|
|
1682
|
-
return 180; // 6 months
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
return $daysLimit;
|
|
1686
|
-
}, 10, 2);
|
|
1687
|
-
```
|
|
1688
|
-
|
|
1689
|
-
---
|
|
1690
|
-
|
|
1691
|
-
## Pro: License Customer Portal
|
|
1692
|
-
|
|
1693
|
-
### ` customer/license_details_section_parts `
|
|
1694
|
-
|
|
1695
|
-
`fluent_cart/customer/license_details_section_parts` Pro — Filter license details section parts in customer portal
|
|
1696
|
-
|
|
1697
|
-
**When it runs:** This filter is applied when rendering a license details page in the customer portal, allowing you to inject custom HTML into specific sections of the license view.
|
|
1698
|
-
|
|
1699
|
-
**Parameters:**
|
|
1700
|
-
|
|
1701
|
-
- `$sectionParts` (array): Associative array of injectable HTML sections
|
|
1702
|
-
|
|
1703
|
-
```
|
|
1704
|
-
$sectionParts = [
|
|
1705
|
-
'before_summary' => '',
|
|
1706
|
-
'after_summary' => '',
|
|
1707
|
-
'end_of_details' => '',
|
|
1708
|
-
'additional_actions' => ''
|
|
1709
|
-
];
|
|
1710
|
-
```
|
|
1711
|
-
|
|
1712
|
-
- `$context` (array): Context data
|
|
1713
|
-
|
|
1714
|
-
```
|
|
1715
|
-
$context = [
|
|
1716
|
-
'license' => $license, // License model
|
|
1717
|
-
'formattedData' => $formattedData // Formatted license data for display
|
|
1718
|
-
];
|
|
1719
|
-
```
|
|
1720
|
-
|
|
1721
|
-
**Returns:**
|
|
1722
|
-
|
|
1723
|
-
- `$sectionParts` (array): The modified section parts
|
|
1724
|
-
|
|
1725
|
-
**Source:** `fluent-cart-pro/app/Modules/Licensing/Http/Controllers/CustomerProfileController.php:97`
|
|
1726
|
-
|
|
1727
|
-
**Usage:**
|
|
1728
|
-
|
|
1729
|
-
```
|
|
1730
|
-
add_filter('fluent_cart/customer/license_details_section_parts', function($parts, $context) {
|
|
1731
|
-
$license = $context['license'];
|
|
1732
|
-
|
|
1733
|
-
// Add activation instructions after the summary
|
|
1734
|
-
$parts['after_summary'] = '<div class="activation-guide">'
|
|
1735
|
-
. '<h4>How to Activate</h4>'
|
|
1736
|
-
. '<p>Copy your license key and paste it in your plugin settings.</p>'
|
|
1737
|
-
. '</div>';
|
|
1738
|
-
|
|
1739
|
-
// Add a custom action button
|
|
1740
|
-
$parts['additional_actions'] = '<button class="btn-regenerate" onclick="regenerateLicense(\'' . $license->id . '\')">Regenerate Key</button>';
|
|
1741
|
-
|
|
1742
|
-
return $parts;
|
|
1743
|
-
}, 10, 2);
|
|
1744
|
-
```
|
|
1745
|
-
|
|
1746
|
-
---
|
|
1
|
+
# Customers & Subscriptions
|
|
2
|
+
|
|
3
|
+
All filters related to [Customer](/database/models/customer.md) management, the customer portal, [Subscription](/database/models/subscription.md) lifecycle, billing configuration, and automated reminders.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Customer Data & Portal
|
|
8
|
+
|
|
9
|
+
### ` customer/view `
|
|
10
|
+
|
|
11
|
+
`fluent_cart/customer/view` — Filter admin single customer view data
|
|
12
|
+
|
|
13
|
+
**When it runs:** This filter is applied when preparing a single customer's data for display in the admin panel.
|
|
14
|
+
|
|
15
|
+
**Parameters:**
|
|
16
|
+
|
|
17
|
+
- `$customer` ([Customer](/database/models/customer.md)): The Customer model instance with loaded relations
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
$customer = [
|
|
21
|
+
'id' => 456,
|
|
22
|
+
'email' => '[email protected]',
|
|
23
|
+
'first_name' => 'John',
|
|
24
|
+
'last_name' => 'Doe',
|
|
25
|
+
'total_orders' => 5,
|
|
26
|
+
'total_spent' => 50000,
|
|
27
|
+
'selected_labels' => [...]
|
|
28
|
+
];
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- `$requestData` (array): The full request data from `$request->all()`
|
|
32
|
+
|
|
33
|
+
**Returns:**
|
|
34
|
+
|
|
35
|
+
- `$customer` ([Customer](/database/models/customer.md)): The modified customer data
|
|
36
|
+
|
|
37
|
+
**Source:** `app/Http/Controllers/CustomerController.php:83`
|
|
38
|
+
|
|
39
|
+
**Usage:**
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
add_filter('fluent_cart/customer/view', function($customer, $requestData) {
|
|
43
|
+
// Add loyalty points to customer view
|
|
44
|
+
$customer['loyalty_points'] = get_user_meta($customer['user_id'], 'loyalty_points', true);
|
|
45
|
+
return $customer;
|
|
46
|
+
}, 10, 2);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### ` widgets/single_customer `
|
|
50
|
+
|
|
51
|
+
`fluent_cart/widgets/single_customer` — Filter single customer admin widgets
|
|
52
|
+
|
|
53
|
+
**When it runs:** This filter is applied when loading widget data for a single customer's admin view, allowing you to inject custom widget sections.
|
|
54
|
+
|
|
55
|
+
**Parameters:**
|
|
56
|
+
|
|
57
|
+
- `$widgets` (array): Array of widget definitions (default: `[]`)
|
|
58
|
+
- `$customer` ([Customer](/database/models/customer.md)): The Customer model instance
|
|
59
|
+
|
|
60
|
+
**Returns:**
|
|
61
|
+
|
|
62
|
+
- `$widgets` (array): The modified widgets array
|
|
63
|
+
|
|
64
|
+
**Source:** `app/Http/Controllers/CustomerController.php:426`
|
|
65
|
+
|
|
66
|
+
**Usage:**
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
add_filter('fluent_cart/widgets/single_customer', function($widgets, $customer) {
|
|
70
|
+
// Add a custom CRM widget
|
|
71
|
+
$widgets[] = [
|
|
72
|
+
'title' => 'CRM Notes',
|
|
73
|
+
'content' => get_user_meta($customer->user_id, 'crm_notes', true)
|
|
74
|
+
];
|
|
75
|
+
return $widgets;
|
|
76
|
+
}, 10, 2);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### ` customer_dashboard_data `
|
|
80
|
+
|
|
81
|
+
`fluent_cart/customer_dashboard_data` — Filter customer dashboard data
|
|
82
|
+
|
|
83
|
+
**When it runs:** This filter is applied when preparing the customer portal dashboard data, including the recent orders list and section parts. Runs both when a customer exists and when no customer is found.
|
|
84
|
+
|
|
85
|
+
**Parameters:**
|
|
86
|
+
|
|
87
|
+
- `$data` (array): The dashboard response data
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
$data = [
|
|
91
|
+
'message' => 'Success',
|
|
92
|
+
'dashboard_data' => [
|
|
93
|
+
'orders' => [...] // Recent orders collection
|
|
94
|
+
],
|
|
95
|
+
'sections_parts' => [
|
|
96
|
+
'before_orders_table' => '',
|
|
97
|
+
'after_orders_table' => ''
|
|
98
|
+
]
|
|
99
|
+
];
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- `$context` (array): Context data containing the customer
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
$context = [
|
|
106
|
+
'customer' => $customer // Customer model or null
|
|
107
|
+
];
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Returns:**
|
|
111
|
+
|
|
112
|
+
- `$data` (array): The modified dashboard data
|
|
113
|
+
|
|
114
|
+
**Source:** `app/Http/Controllers/FrontendControllers/CustomerProfileController.php:65,122`
|
|
115
|
+
|
|
116
|
+
**Usage:**
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
add_filter('fluent_cart/customer_dashboard_data', function($data, $context) {
|
|
120
|
+
$customer = $context['customer'];
|
|
121
|
+
if ($customer) {
|
|
122
|
+
// Add a welcome banner above the orders table
|
|
123
|
+
$data['sections_parts']['before_orders_table'] = '<div class="welcome-banner">Welcome back!</div>';
|
|
124
|
+
}
|
|
125
|
+
return $data;
|
|
126
|
+
}, 10, 2);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### ` global_customer_menu_items `
|
|
130
|
+
|
|
131
|
+
`fluent_cart/global_customer_menu_items` — Filter customer portal menu items
|
|
132
|
+
|
|
133
|
+
**When it runs:** This filter is applied when building the customer portal sidebar navigation menu, after built-in items have been conditionally removed (e.g., subscriptions, licenses).
|
|
134
|
+
|
|
135
|
+
**Parameters:**
|
|
136
|
+
|
|
137
|
+
- `$menuItems` (array): Associative array of menu items keyed by slug
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
$menuItems = [
|
|
141
|
+
'orders' => [
|
|
142
|
+
'label' => 'Orders',
|
|
143
|
+
'css_class' => 'fct_route',
|
|
144
|
+
'link' => '/customer-portal/#/orders',
|
|
145
|
+
'icon_svg' => '<svg>...</svg>'
|
|
146
|
+
],
|
|
147
|
+
'subscriptions' => [...],
|
|
148
|
+
'licenses' => [...],
|
|
149
|
+
'downloads' => [...],
|
|
150
|
+
'profile' => [...]
|
|
151
|
+
];
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
- `$context` (array): Context data
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
$context = [
|
|
158
|
+
'base_url' => '/customer-portal/#/'
|
|
159
|
+
];
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Returns:**
|
|
163
|
+
|
|
164
|
+
- `$menuItems` (array): The modified menu items array
|
|
165
|
+
|
|
166
|
+
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:299`
|
|
167
|
+
|
|
168
|
+
**Usage:**
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
add_filter('fluent_cart/global_customer_menu_items', function($menuItems, $context) {
|
|
172
|
+
// Add a custom "Support" tab before "profile"
|
|
173
|
+
$baseUrl = $context['base_url'];
|
|
174
|
+
$menuItems['support'] = [
|
|
175
|
+
'label' => 'Support',
|
|
176
|
+
'css_class' => 'fct_route',
|
|
177
|
+
'link' => $baseUrl . 'support',
|
|
178
|
+
'icon_svg' => '<svg>...</svg>'
|
|
179
|
+
];
|
|
180
|
+
return $menuItems;
|
|
181
|
+
}, 10, 2);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### ` customer_portal/routes ` (JavaScript)
|
|
185
|
+
|
|
186
|
+
`fluent_cart/customer_portal/routes` — Add pages to the customer portal app (JS filter)
|
|
187
|
+
|
|
188
|
+
**When it runs:** This is a JavaScript filter on `wp.hooks`. The customer portal applies it to its vue-router route table once, before it creates the router. Use it to add your own page to the portal app.
|
|
189
|
+
|
|
190
|
+
The portal script loads as a deferred module. Enqueue your script on the `fluent_cart/customer_dashboard/enqueue_assets` action as a classic script that depends on `wp-hooks`. It then runs before the portal script, so your filter is in place in time.
|
|
191
|
+
|
|
192
|
+
**Parameters:**
|
|
193
|
+
|
|
194
|
+
- `routes` (Array): vue-router route records
|
|
195
|
+
- `context` (Object): `{ vue }`, the portal's own Vue (read-only). Use `vue.h` and `vue.defineComponent` to build components, so they use the same Vue instance as the portal.
|
|
196
|
+
|
|
197
|
+
**Returns:**
|
|
198
|
+
|
|
199
|
+
- `routes` (Array): The route table. If the value is not an array, the portal uses its own routes.
|
|
200
|
+
|
|
201
|
+
**Source:** `resources/public/customer-profile/Start.js:147`
|
|
202
|
+
|
|
203
|
+
**Usage:**
|
|
204
|
+
|
|
205
|
+
Enqueue the script:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
add_action('fluent_cart/customer_dashboard/enqueue_assets', function () {
|
|
209
|
+
wp_enqueue_script('my-portal-pages', plugins_url('js/portal-pages.js', __FILE__), ['wp-hooks'], '1.0.0', true);
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Add the route (`js/portal-pages.js`):
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
wp.hooks.addFilter('fluent_cart/customer_portal/routes', 'my-plugin', function (routes, context) {
|
|
217
|
+
const { h, defineComponent } = context.vue;
|
|
218
|
+
|
|
219
|
+
return routes.concat([{
|
|
220
|
+
path: '/memberships',
|
|
221
|
+
name: 'my_memberships',
|
|
222
|
+
component: defineComponent({
|
|
223
|
+
render: () => h('div', { class: 'my-memberships' }, 'Your memberships')
|
|
224
|
+
}),
|
|
225
|
+
meta: {
|
|
226
|
+
active_menu: 'memberships', // the menu item key to highlight
|
|
227
|
+
title: 'Memberships'
|
|
228
|
+
}
|
|
229
|
+
}]);
|
|
230
|
+
});
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Add the menu item. The `fct_route` class makes the link open the route in the app, without a page reload:
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
add_filter('fluent_cart/global_customer_menu_items', function ($menuItems, $context) {
|
|
237
|
+
$menuItems['memberships'] = [
|
|
238
|
+
'label' => __('Memberships', 'my-plugin'),
|
|
239
|
+
'css_class' => 'fct_route',
|
|
240
|
+
'link' => $context['base_url'] . 'memberships',
|
|
241
|
+
];
|
|
242
|
+
return $menuItems;
|
|
243
|
+
}, 10, 2);
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
A direct visit to the URL (for example `/my-account/memberships`) also opens the page, because the portal page catches every path below it.
|
|
247
|
+
|
|
248
|
+
### ` fct_allowed_svg_tags `
|
|
249
|
+
|
|
250
|
+
`fct_allowed_svg_tags` — Allow-list the SVG tags/attributes for a customer nav menu icon
|
|
251
|
+
|
|
252
|
+
**When it runs:** This filter is applied when rendering a customer-portal navigation menu item that has an inline `icon_svg` value. The returned value is passed straight to `wp_kses()` as the allowed-HTML list, so a menu item's inline SVG icon is only rendered if this filter allow-lists the SVG tags/attributes it uses — the default is an empty array, which strips all markup.
|
|
253
|
+
|
|
254
|
+
> **Note:** This hook has no `fluent_cart/` or `fluent_cart_` prefix — it predates that naming convention. Register it exactly as `fct_allowed_svg_tags`.
|
|
255
|
+
|
|
256
|
+
**Source:** `app/Views/frontend/customer_menu.php:60`
|
|
257
|
+
|
|
258
|
+
**Parameters:**
|
|
259
|
+
|
|
260
|
+
- `$allowedTags` (array): The `wp_kses()`-style allowed tags/attributes array. Empty by default.
|
|
261
|
+
|
|
262
|
+
**Returns:**
|
|
263
|
+
|
|
264
|
+
- `array` — The allowed tags/attributes array, in the format `wp_kses()` expects
|
|
265
|
+
|
|
266
|
+
**Usage:**
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
add_filter('fct_allowed_svg_tags', function ($allowedTags) {
|
|
270
|
+
// Allow a basic inline <svg><path> icon
|
|
271
|
+
$allowedTags['svg'] = ['class' => true, 'viewbox' => true, 'width' => true, 'height' => true, 'fill' => true];
|
|
272
|
+
$allowedTags['path'] = ['d' => true, 'fill' => true];
|
|
273
|
+
return $allowedTags;
|
|
274
|
+
});
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### ` customer_portal/active_tab `
|
|
278
|
+
|
|
279
|
+
`fluent_cart/customer_portal/active_tab` — Filter the active tab in customer portal
|
|
280
|
+
|
|
281
|
+
**When it runs:** This filter is applied when rendering the customer portal to determine which tab should be visually active by default.
|
|
282
|
+
|
|
283
|
+
**Parameters:**
|
|
284
|
+
|
|
285
|
+
- `$activeTab` (string): The active tab identifier (default: `''`)
|
|
286
|
+
|
|
287
|
+
**Returns:**
|
|
288
|
+
|
|
289
|
+
- `$activeTab` (string): The modified active tab slug
|
|
290
|
+
|
|
291
|
+
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:150`
|
|
292
|
+
|
|
293
|
+
**Usage:**
|
|
294
|
+
|
|
295
|
+
```
|
|
296
|
+
add_filter('fluent_cart/customer_portal/active_tab', function($activeTab) {
|
|
297
|
+
// Default to subscriptions tab
|
|
298
|
+
return 'subscriptions';
|
|
299
|
+
}, 10, 1);
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### ` customer_portal/custom_endpoints `
|
|
303
|
+
|
|
304
|
+
`fluent_cart/customer_portal/custom_endpoints` — Filter custom portal endpoints
|
|
305
|
+
|
|
306
|
+
**When it runs:** This filter is applied when routing customer portal requests to check for registered custom endpoint paths. Use this to add entirely new pages to the customer portal.
|
|
307
|
+
|
|
308
|
+
**Parameters:**
|
|
309
|
+
|
|
310
|
+
- `$endpoints` (array): Associative array of custom endpoints (default: `[]`)
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
$endpoints = [
|
|
314
|
+
'my-page' => [
|
|
315
|
+
'render_callback' => callable,
|
|
316
|
+
// or 'page_id' => 123
|
|
317
|
+
]
|
|
318
|
+
];
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**Returns:**
|
|
322
|
+
|
|
323
|
+
- `$endpoints` (array): The modified endpoints array
|
|
324
|
+
|
|
325
|
+
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:174`
|
|
326
|
+
|
|
327
|
+
**Usage:**
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
add_filter('fluent_cart/customer_portal/custom_endpoints', function($endpoints) {
|
|
331
|
+
$endpoints['warranty'] = [
|
|
332
|
+
'render_callback' => function() {
|
|
333
|
+
echo '<div class="warranty-page">Warranty info here</div>';
|
|
334
|
+
}
|
|
335
|
+
];
|
|
336
|
+
return $endpoints;
|
|
337
|
+
}, 10, 1);
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
TIP
|
|
341
|
+
|
|
342
|
+
Consider using the `FluentCartGeneralApi::addCustomerPortalEndpoint()` helper method instead, which registers both the menu item and the endpoint in one call.
|
|
343
|
+
|
|
344
|
+
### ` customer_portal/{filter} `
|
|
345
|
+
|
|
346
|
+
`fluent_cart/customer_portal/{$filter}` — Provide sections for a custom customer-portal endpoint (dynamic)
|
|
347
|
+
|
|
348
|
+
**When it runs:** This **dynamic** filter is applied by the customer-portal sections REST endpoint. `{$filter}` is replaced with the requested section/tab slug from the request, so an add-on that registers a portal endpoint (see `customer_portal/custom_endpoints` above) can supply that endpoint's section content by listening on its own slug.
|
|
349
|
+
|
|
350
|
+
**Source:** `app/Http/Controllers/FrontendControllers/CustomerProfileController.php:228`
|
|
351
|
+
|
|
352
|
+
**Parameters:**
|
|
353
|
+
|
|
354
|
+
- `$sections` (array): The sections to return for this endpoint. Empty by default.
|
|
355
|
+
- `$data` (array): Context data
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
$data = [
|
|
359
|
+
'customer' => $customer, // Customer model instance
|
|
360
|
+
];
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**Returns:**
|
|
364
|
+
|
|
365
|
+
- `array` — The sections for this portal endpoint, formatted for the frontend
|
|
366
|
+
|
|
367
|
+
**Usage:**
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
// Supply sections for a portal endpoint registered under the "warranty" slug
|
|
371
|
+
add_filter('fluent_cart/customer_portal/warranty', function ($sections, $data) {
|
|
372
|
+
$sections[] = [
|
|
373
|
+
'title' => __('Warranty', 'fluent-cart'),
|
|
374
|
+
'content' => __('Your products are covered by our standard 12-month warranty.', 'fluent-cart'),
|
|
375
|
+
];
|
|
376
|
+
return $sections;
|
|
377
|
+
}, 10, 2);
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### ` customer_portal/subscription_data `
|
|
381
|
+
|
|
382
|
+
`fluent_cart/customer_portal/subscription_data` — Filter customer portal subscription data
|
|
383
|
+
|
|
384
|
+
**When it runs:** This filter is applied when preparing a single subscription's data for display in the customer portal, after transactions have been loaded.
|
|
385
|
+
|
|
386
|
+
**Parameters:**
|
|
387
|
+
|
|
388
|
+
- `$formattedData` (array): The formatted subscription data including transactions
|
|
389
|
+
- `$context` (array): Context data
|
|
390
|
+
|
|
391
|
+
```
|
|
392
|
+
$context = [
|
|
393
|
+
'subscription' => $subscription, // Subscription model
|
|
394
|
+
'customer' => $customer // Customer model
|
|
395
|
+
];
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
**Returns:**
|
|
399
|
+
|
|
400
|
+
- `$formattedData` (array): The modified subscription data
|
|
401
|
+
|
|
402
|
+
**Source:** `app/Http/Controllers/FrontendControllers/CustomerSubscriptionController.php:175`
|
|
403
|
+
|
|
404
|
+
**Usage:**
|
|
405
|
+
|
|
406
|
+
```
|
|
407
|
+
add_filter('fluent_cart/customer_portal/subscription_data', function($formattedData, $context) {
|
|
408
|
+
// Add next invoice preview
|
|
409
|
+
$subscription = $context['subscription'];
|
|
410
|
+
$formattedData['next_invoice_preview'] = [
|
|
411
|
+
'amount' => $subscription->recurring_amount,
|
|
412
|
+
'date' => $subscription->expiration_at
|
|
413
|
+
];
|
|
414
|
+
return $formattedData;
|
|
415
|
+
}, 10, 2);
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### ` customer/subscription_details_section_parts `
|
|
419
|
+
|
|
420
|
+
`fluent_cart/customer/subscription_details_section_parts` — Filter subscription details section parts in customer portal
|
|
421
|
+
|
|
422
|
+
**When it runs:** This filter is applied when rendering a subscription details page in the customer portal, letting you inject custom HTML into specific sections of the view. Every returned value is passed through `wp_kses_post()` before output. This is the free-plugin counterpart to Pro's `customer/license_details_section_parts`.
|
|
423
|
+
|
|
424
|
+
**Source:** `app/Http/Controllers/FrontendControllers/CustomerSubscriptionController.php:180`
|
|
425
|
+
|
|
426
|
+
**Parameters:**
|
|
427
|
+
|
|
428
|
+
- `$sectionParts` (array): Associative array of injectable HTML sections
|
|
429
|
+
|
|
430
|
+
```
|
|
431
|
+
$sectionParts = [
|
|
432
|
+
'end_of_subscription' => '',
|
|
433
|
+
];
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
- `$context` (array): Context data
|
|
437
|
+
|
|
438
|
+
```
|
|
439
|
+
$context = [
|
|
440
|
+
'subscription' => $subscription, // Subscription model
|
|
441
|
+
'formattedData' => $formattedData, // Formatted subscription data for display
|
|
442
|
+
];
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
**Returns:**
|
|
446
|
+
|
|
447
|
+
- `array` — The modified section parts. Each value is sanitized with `wp_kses_post()`.
|
|
448
|
+
|
|
449
|
+
**Usage:**
|
|
450
|
+
|
|
451
|
+
```
|
|
452
|
+
add_filter('fluent_cart/customer/subscription_details_section_parts', function ($parts, $context) {
|
|
453
|
+
$subscription = $context['subscription'];
|
|
454
|
+
|
|
455
|
+
$parts['end_of_subscription'] = sprintf(
|
|
456
|
+
'<p>%s</p>',
|
|
457
|
+
sprintf(__('Need help? Contact us about subscription #%d.', 'fluent-cart'), $subscription->id)
|
|
458
|
+
);
|
|
459
|
+
|
|
460
|
+
return $parts;
|
|
461
|
+
}, 10, 2);
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### ` payment_methods/stripe_pub_key `
|
|
465
|
+
|
|
466
|
+
`fluent_cart/payment_methods/stripe_pub_key` — Filter Stripe public key for customer portal
|
|
467
|
+
|
|
468
|
+
**When it runs:** This filter is applied when localizing JavaScript data for the customer portal, providing the Stripe publishable key for client-side payment operations.
|
|
469
|
+
|
|
470
|
+
**Parameters:**
|
|
471
|
+
|
|
472
|
+
- `$pubKey` (string): The Stripe publishable key (default: `''`)
|
|
473
|
+
|
|
474
|
+
**Returns:**
|
|
475
|
+
|
|
476
|
+
- `$pubKey` (string): The modified Stripe public key
|
|
477
|
+
|
|
478
|
+
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:389`
|
|
479
|
+
|
|
480
|
+
**Usage:**
|
|
481
|
+
|
|
482
|
+
```
|
|
483
|
+
add_filter('fluent_cart/payment_methods/stripe_pub_key', function($pubKey) {
|
|
484
|
+
// Override Stripe key for specific conditions
|
|
485
|
+
if (defined('STRIPE_TEST_MODE') && STRIPE_TEST_MODE) {
|
|
486
|
+
return 'pk_test_xxxxxxxxxxxx';
|
|
487
|
+
}
|
|
488
|
+
return $pubKey;
|
|
489
|
+
}, 10, 1);
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### ` payment_methods/paypal_client_id `
|
|
493
|
+
|
|
494
|
+
`fluent_cart/payment_methods/paypal_client_id` — Filter PayPal client ID for customer portal
|
|
495
|
+
|
|
496
|
+
**When it runs:** This filter is applied when localizing JavaScript data for the customer portal, providing the PayPal client ID for client-side payment operations.
|
|
497
|
+
|
|
498
|
+
**Parameters:**
|
|
499
|
+
|
|
500
|
+
- `$clientId` (string): The PayPal client ID (default: `''`)
|
|
501
|
+
- `$context` (array): Additional context data (default: `[]`)
|
|
502
|
+
|
|
503
|
+
**Returns:**
|
|
504
|
+
|
|
505
|
+
- `$clientId` (string): The modified PayPal client ID
|
|
506
|
+
|
|
507
|
+
**Source:** `app/Hooks/Handlers/ShortCodes/CustomerProfileHandler.php:390`
|
|
508
|
+
|
|
509
|
+
**Usage:**
|
|
510
|
+
|
|
511
|
+
```
|
|
512
|
+
add_filter('fluent_cart/payment_methods/paypal_client_id', function($clientId, $context) {
|
|
513
|
+
// Provide the PayPal sandbox client ID for testing
|
|
514
|
+
return 'AYourPayPalClientId';
|
|
515
|
+
}, 10, 2);
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
---
|
|
519
|
+
|
|
520
|
+
## Customer Statuses & Auth
|
|
521
|
+
|
|
522
|
+
### ` editable_customer_statuses `
|
|
523
|
+
|
|
524
|
+
`fluent_cart/editable_customer_statuses` — Filter editable customer statuses
|
|
525
|
+
|
|
526
|
+
**When it runs:** Applied when building the list of customer statuses an admin can set.
|
|
527
|
+
|
|
528
|
+
**Source:** `app/Helpers/Status.php:375`
|
|
529
|
+
|
|
530
|
+
**Parameters:**
|
|
531
|
+
|
|
532
|
+
- `$statuses` (array): Associative array of status key => label
|
|
533
|
+
|
|
534
|
+
```
|
|
535
|
+
$statuses = [
|
|
536
|
+
'active' => __('Active', 'fluent-cart'),
|
|
537
|
+
'inactive' => __('Inactive', 'fluent-cart'),
|
|
538
|
+
];
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
- `$context` (array): Additional context data (empty array)
|
|
542
|
+
|
|
543
|
+
**Returns:**
|
|
544
|
+
|
|
545
|
+
- `array` — The modified statuses array
|
|
546
|
+
|
|
547
|
+
**Usage:**
|
|
548
|
+
|
|
549
|
+
```
|
|
550
|
+
add_filter('fluent_cart/editable_customer_statuses', function ($statuses, $context) {
|
|
551
|
+
$statuses['suspended'] = __('Suspended', 'my-plugin');
|
|
552
|
+
return $statuses;
|
|
553
|
+
}, 10, 2);
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
### ` user/after_register/skip_hooks `
|
|
557
|
+
|
|
558
|
+
`fluent_cart/user/after_register/skip_hooks` — Skip post-registration hooks
|
|
559
|
+
|
|
560
|
+
**When it runs:** This filter is applied after a new WordPress user has been created during checkout registration. When it returns `true`, standard WordPress post-registration hooks like `register_new_user` are skipped.
|
|
561
|
+
|
|
562
|
+
**Parameters:**
|
|
563
|
+
|
|
564
|
+
- `$skip` (bool): Whether to skip the hooks (default: `false`)
|
|
565
|
+
- `$user_id` (int): The newly created WordPress user ID
|
|
566
|
+
|
|
567
|
+
**Returns:**
|
|
568
|
+
|
|
569
|
+
- `$skip` (bool): Whether to skip the post-registration hooks
|
|
570
|
+
|
|
571
|
+
**Source:** `app/Services/AuthService.php:122`
|
|
572
|
+
|
|
573
|
+
**Usage:**
|
|
574
|
+
|
|
575
|
+
```
|
|
576
|
+
add_filter('fluent_cart/user/after_register/skip_hooks', function($skip, $userId) {
|
|
577
|
+
// Skip default WP registration hooks to prevent welcome emails
|
|
578
|
+
// when creating users during checkout
|
|
579
|
+
return true;
|
|
580
|
+
}, 10, 2);
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
---
|
|
584
|
+
|
|
585
|
+
## Subscription Statuses & Configuration
|
|
586
|
+
|
|
587
|
+
### ` subscription_statuses `
|
|
588
|
+
|
|
589
|
+
`fluent_cart/subscription_statuses` — Filter subscription statuses
|
|
590
|
+
|
|
591
|
+
**When it runs:** This filter is applied when retrieving the list of all available subscription statuses used throughout the system.
|
|
592
|
+
|
|
593
|
+
**Parameters:**
|
|
594
|
+
|
|
595
|
+
- `$statuses` (array): Associative array of status key => label
|
|
596
|
+
|
|
597
|
+
```
|
|
598
|
+
$statuses = [
|
|
599
|
+
'pending' => 'Pending',
|
|
600
|
+
'active' => 'Active',
|
|
601
|
+
'failing' => 'Failing',
|
|
602
|
+
'paused' => 'Paused',
|
|
603
|
+
'expired' => 'Expired',
|
|
604
|
+
'expiring' => 'Expiring',
|
|
605
|
+
'canceled' => 'Canceled',
|
|
606
|
+
'trialing' => 'Trialing',
|
|
607
|
+
'intended' => 'Intended',
|
|
608
|
+
'past_due' => 'Past Due',
|
|
609
|
+
'completed' => 'Completed'
|
|
610
|
+
];
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
- `$context` (array): Additional context data (default: `[]`)
|
|
614
|
+
|
|
615
|
+
**Returns:**
|
|
616
|
+
|
|
617
|
+
- `$statuses` (array): The modified subscription statuses array
|
|
618
|
+
|
|
619
|
+
**Source:** `app/Helpers/Status.php:265`
|
|
620
|
+
|
|
621
|
+
**Usage:**
|
|
622
|
+
|
|
623
|
+
```
|
|
624
|
+
add_filter('fluent_cart/subscription_statuses', function($statuses, $context) {
|
|
625
|
+
// Add a custom "on_hold" status
|
|
626
|
+
$statuses['on_hold'] = __('On Hold', 'my-plugin');
|
|
627
|
+
return $statuses;
|
|
628
|
+
}, 10, 2);
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
### ` validable_subscription_statuses `
|
|
632
|
+
|
|
633
|
+
`fluent_cart/validable_subscription_statuses` — Filter valid (active) subscription statuses
|
|
634
|
+
|
|
635
|
+
**When it runs:** This filter is applied when determining which subscription statuses should be considered "valid" (i.e., the subscription grants access to the product/service). Used for license validation, download access, etc.
|
|
636
|
+
|
|
637
|
+
**Parameters:**
|
|
638
|
+
|
|
639
|
+
- `$statuses` (array): Array of status keys considered valid
|
|
640
|
+
|
|
641
|
+
```
|
|
642
|
+
$statuses = ['active', 'trialing'];
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
- `$context` (array): Additional context data (default: `[]`)
|
|
646
|
+
|
|
647
|
+
**Returns:**
|
|
648
|
+
|
|
649
|
+
- `$statuses` (array): The modified list of valid statuses
|
|
650
|
+
|
|
651
|
+
**Source:** `app/Helpers/Status.php:283`
|
|
652
|
+
|
|
653
|
+
**Usage:**
|
|
654
|
+
|
|
655
|
+
```
|
|
656
|
+
add_filter('fluent_cart/validable_subscription_statuses', function($statuses, $context) {
|
|
657
|
+
// Also treat "expiring" subscriptions as valid until they actually expire
|
|
658
|
+
$statuses[] = 'expiring';
|
|
659
|
+
return $statuses;
|
|
660
|
+
}, 10, 2);
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
### ` subscription/view `
|
|
664
|
+
|
|
665
|
+
`fluent_cart/subscription/view` — Filter admin subscription view data
|
|
666
|
+
|
|
667
|
+
**When it runs:** This filter is applied when preparing a single subscription's data for display in the admin panel.
|
|
668
|
+
|
|
669
|
+
**Parameters:**
|
|
670
|
+
|
|
671
|
+
- `$subscription` ([Subscription](/database/models/subscription.md)): The Subscription model with loaded relations
|
|
672
|
+
- `$context` (array): Additional context data (default: `[]`)
|
|
673
|
+
|
|
674
|
+
**Returns:**
|
|
675
|
+
|
|
676
|
+
- `$subscription` (array): The modified subscription data
|
|
677
|
+
|
|
678
|
+
**Source:** `app/Modules/Subscriptions/Http/Controllers/SubscriptionController.php:83`
|
|
679
|
+
|
|
680
|
+
**Usage:**
|
|
681
|
+
|
|
682
|
+
```
|
|
683
|
+
add_filter('fluent_cart/subscription/view', function($subscription, $context) {
|
|
684
|
+
// Add external gateway link
|
|
685
|
+
$subscription['external_url'] = 'https://dashboard.stripe.com/subscriptions/' . $subscription['vendor_subscription_id'];
|
|
686
|
+
return $subscription;
|
|
687
|
+
}, 10, 2);
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
### ` widgets/single_subscription_page `
|
|
691
|
+
|
|
692
|
+
`fluent_cart/widgets/single_subscription_page` — Add widgets to the admin subscription page
|
|
693
|
+
|
|
694
|
+
**When it runs:** This filter is applied when the admin opens a single subscription. The page loads its widget area from the `widgets` REST endpoint, and the cards show in the right sidebar, under Labels. The area reloads when the admin opens another subscription.
|
|
695
|
+
|
|
696
|
+
The request needs the `subscriptions/view` permission, plus `customers/view` or `orders/view`. If the subscription does not exist, the endpoint returns an error and the filter does not run.
|
|
697
|
+
|
|
698
|
+
**Parameters:**
|
|
699
|
+
|
|
700
|
+
- `$widgets` (array): Widget definitions (default: `[]`)
|
|
701
|
+
- `$data` (array): The request data, with the resolved subscription
|
|
702
|
+
|
|
703
|
+
```
|
|
704
|
+
$data = [
|
|
705
|
+
'subscription_id' => 42,
|
|
706
|
+
'subscription' => $subscription, // \FluentCart\App\Models\Subscription
|
|
707
|
+
];
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
**Returns:**
|
|
711
|
+
|
|
712
|
+
- `$widgets` (array): Widget definitions. Each widget is an HTML card:
|
|
713
|
+
|
|
714
|
+
```
|
|
715
|
+
[
|
|
716
|
+
'type' => 'html',
|
|
717
|
+
'title' => 'Membership',
|
|
718
|
+
'content' => '<p>...</p>', // HTML, escape your own values
|
|
719
|
+
]
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
**Source:** `app/Http/Controllers/WidgetsController.php:49`
|
|
723
|
+
|
|
724
|
+
**Usage:**
|
|
725
|
+
|
|
726
|
+
```
|
|
727
|
+
add_filter('fluent_cart/widgets/single_subscription_page', function ($widgets, $data) {
|
|
728
|
+
$subscription = $data['subscription'];
|
|
729
|
+
|
|
730
|
+
$widgets[] = [
|
|
731
|
+
'type' => 'html',
|
|
732
|
+
'title' => __('Membership', 'my-plugin'),
|
|
733
|
+
'content' => '<p>' . esc_html(sprintf('Plan: %s', $subscription->item_name)) . '</p>',
|
|
734
|
+
];
|
|
735
|
+
|
|
736
|
+
return $widgets;
|
|
737
|
+
}, 10, 2);
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
### ` subscription/url_{$payment_method} `
|
|
741
|
+
|
|
742
|
+
`fluent_cart/subscription/url_{$payment_method}` — Filter vendor dashboard URL for a subscription (dynamic)
|
|
743
|
+
|
|
744
|
+
**When it runs:** This filter is applied when generating the external vendor dashboard URL for a subscription. The hook name is dynamic, with `{$payment_method}` replaced by the subscription's current payment method (e.g., `stripe`, `paypal`).
|
|
745
|
+
|
|
746
|
+
**Parameters:**
|
|
747
|
+
|
|
748
|
+
- `$url` (string): The vendor dashboard URL (default: `''`)
|
|
749
|
+
- `$context` (array): Context data
|
|
750
|
+
|
|
751
|
+
```
|
|
752
|
+
$context = [
|
|
753
|
+
'vendor_subscription_id' => 'sub_1234567890',
|
|
754
|
+
'payment_mode' => 'live', // or 'test'
|
|
755
|
+
'subscription' => $subscription // Subscription model
|
|
756
|
+
];
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
**Returns:**
|
|
760
|
+
|
|
761
|
+
- `$url` (string): The modified vendor dashboard URL
|
|
762
|
+
|
|
763
|
+
**Source:** `app/Models/Subscription.php:284`
|
|
764
|
+
|
|
765
|
+
**Usage:**
|
|
766
|
+
|
|
767
|
+
```
|
|
768
|
+
// Provide the Stripe dashboard URL for subscriptions
|
|
769
|
+
add_filter('fluent_cart/subscription/url_stripe', function($url, $context) {
|
|
770
|
+
$subId = $context['vendor_subscription_id'];
|
|
771
|
+
$mode = $context['payment_mode'];
|
|
772
|
+
$base = ($mode === 'test')
|
|
773
|
+
? 'https://dashboard.stripe.com/test'
|
|
774
|
+
: 'https://dashboard.stripe.com';
|
|
775
|
+
return $base . '/subscriptions/' . $subId;
|
|
776
|
+
}, 10, 2);
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
### ` subscription/can_reactivate `
|
|
780
|
+
|
|
781
|
+
`fluent_cart/subscription/can_reactivate` — Filter whether a subscription can be reactivated
|
|
782
|
+
|
|
783
|
+
**When it runs:** This filter is applied when checking if a canceled, failing, expired, paused, expiring, or past-due subscription is eligible for reactivation.
|
|
784
|
+
|
|
785
|
+
**Parameters:**
|
|
786
|
+
|
|
787
|
+
- `$canReactivate` (bool): Whether the subscription can be reactivated (based on its current status)
|
|
788
|
+
- `$context` (array): Context data
|
|
789
|
+
|
|
790
|
+
```
|
|
791
|
+
$context = [
|
|
792
|
+
'subscription' => $subscription // Subscription model
|
|
793
|
+
];
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
**Returns:**
|
|
797
|
+
|
|
798
|
+
- `$canReactivate` (bool): The modified reactivation eligibility
|
|
799
|
+
|
|
800
|
+
**Source:** `app/Models/Subscription.php:983`
|
|
801
|
+
|
|
802
|
+
**Usage:**
|
|
803
|
+
|
|
804
|
+
```
|
|
805
|
+
add_filter('fluent_cart/subscription/can_reactivate', function($canReactivate, $context) {
|
|
806
|
+
$subscription = $context['subscription'];
|
|
807
|
+
|
|
808
|
+
// Prevent reactivation if canceled more than 90 days ago
|
|
809
|
+
if ($subscription->status === 'canceled') {
|
|
810
|
+
$canceledAt = strtotime($subscription->updated_at);
|
|
811
|
+
if ((time() - $canceledAt) > (90 * DAY_IN_SECONDS)) {
|
|
812
|
+
return false;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
return $canReactivate;
|
|
816
|
+
}, 10, 2);
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
### ` subscription/vendor_id_editing_enabled `
|
|
820
|
+
|
|
821
|
+
`fluent_cart/subscription/vendor_id_editing_enabled` — Opt in to admin editing of gateway identifiers
|
|
822
|
+
|
|
823
|
+
**When it runs:** First statement of `Subscription::canEditVendorIds()`, which is the single gate behind the admin "Edit Vendor IDs" action, the `canEditVendorIds` / `canVerifyVendorIds` permission flags, the `vendor-ids` write endpoint and the `verify-vendor-ids` lookup endpoint. Default is `false`, so the whole feature is off until a site opts in.
|
|
824
|
+
|
|
825
|
+
**Parameters:**
|
|
826
|
+
|
|
827
|
+
- `$enabled` (bool): `false` by default
|
|
828
|
+
|
|
829
|
+
**Returns:**
|
|
830
|
+
|
|
831
|
+
- `$enabled` (bool): `true` to expose the repair tool
|
|
832
|
+
|
|
833
|
+
**Source:** `app/Models/Subscription.php:900`
|
|
834
|
+
|
|
835
|
+
**Usage:**
|
|
836
|
+
|
|
837
|
+
```
|
|
838
|
+
add_filter('fluent_cart/subscription/vendor_id_editing_enabled', '__return_true');
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
This column is what gateway webhooks resolve on
|
|
842
|
+
|
|
843
|
+
`fct_subscriptions.vendor_subscription_id` is indexed but not unique, and every gateway IPN finds its subscription through it. Enable this only while a migration or support repair is in progress, or scope it — for example to a single administrator:
|
|
844
|
+
|
|
845
|
+
```
|
|
846
|
+
add_filter('fluent_cart/subscription/vendor_id_editing_enabled', function ($enabled) {
|
|
847
|
+
return current_user_can('manage_options') && defined('FLUENTCART_ALLOW_VENDOR_ID_EDIT');
|
|
848
|
+
});
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
See [Editing Vendor IDs](/modules/subscription-vendor-ids.md) for the full feature.
|
|
852
|
+
|
|
853
|
+
### ` available_subscription_interval_options `
|
|
854
|
+
|
|
855
|
+
`fluent_cart/available_subscription_interval_options` — Filter subscription interval options
|
|
856
|
+
|
|
857
|
+
**When it runs:** This filter is applied when retrieving the list of available subscription billing interval options for product configuration.
|
|
858
|
+
|
|
859
|
+
**Parameters:**
|
|
860
|
+
|
|
861
|
+
- `$intervals` (array): Array of interval option objects
|
|
862
|
+
|
|
863
|
+
```
|
|
864
|
+
$intervals = [
|
|
865
|
+
['label' => 'Yearly', 'value' => 'yearly', 'map_value' => 'year'],
|
|
866
|
+
['label' => 'Half Yearly', 'value' => 'half_yearly', 'map_value' => 'half_year'],
|
|
867
|
+
['label' => 'Quarterly', 'value' => 'quarterly', 'map_value' => 'quarter'],
|
|
868
|
+
['label' => 'Monthly', 'value' => 'monthly', 'map_value' => 'month'],
|
|
869
|
+
['label' => 'Weekly', 'value' => 'weekly', 'map_value' => 'week'],
|
|
870
|
+
['label' => 'Daily', 'value' => 'daily', 'map_value' => 'day']
|
|
871
|
+
];
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
**Returns:**
|
|
875
|
+
|
|
876
|
+
- `$intervals` (array): The modified intervals array
|
|
877
|
+
|
|
878
|
+
**Source:** `app/Helpers/Helper.php:1740`
|
|
879
|
+
|
|
880
|
+
**Usage:**
|
|
881
|
+
|
|
882
|
+
```
|
|
883
|
+
add_filter('fluent_cart/available_subscription_interval_options', function($intervals) {
|
|
884
|
+
// Add a custom "Every 10 days" interval
|
|
885
|
+
$intervals[] = [
|
|
886
|
+
'label' => __('Every 10th Day', 'my-plugin'),
|
|
887
|
+
'value' => 'every_tenth_day',
|
|
888
|
+
'map_value' => '10th Day'
|
|
889
|
+
];
|
|
890
|
+
return $intervals;
|
|
891
|
+
});
|
|
892
|
+
```
|
|
893
|
+
|
|
894
|
+
TIP
|
|
895
|
+
|
|
896
|
+
When adding custom intervals, you must also implement the `fluent_cart/subscription_interval_in_days` and `fluent_cart/subscription_billing_period` filters so the system knows how to calculate dates and communicate with payment gateways.
|
|
897
|
+
|
|
898
|
+
### ` subscription_interval_in_days `
|
|
899
|
+
|
|
900
|
+
`fluent_cart/subscription_interval_in_days` — Filter the number of days for a custom subscription interval
|
|
901
|
+
|
|
902
|
+
**When it runs:** This filter is applied when converting a subscription interval to its day count. For built-in intervals (yearly, half_yearly, quarterly, monthly, weekly, daily), the value is calculated automatically. This filter fires for custom/unknown intervals with a default of `0`.
|
|
903
|
+
|
|
904
|
+
**Parameters:**
|
|
905
|
+
|
|
906
|
+
- `$days` (int): Number of days for the interval (default: `0` for custom intervals)
|
|
907
|
+
- `$context` (array): Context data
|
|
908
|
+
|
|
909
|
+
```
|
|
910
|
+
$context = [
|
|
911
|
+
'interval' => 'every_tenth_day' // The interval key
|
|
912
|
+
];
|
|
913
|
+
```
|
|
914
|
+
|
|
915
|
+
**Returns:**
|
|
916
|
+
|
|
917
|
+
- `$days` (int): The number of days in this interval
|
|
918
|
+
|
|
919
|
+
**Source:** `app/Helpers/Helper.php:1801`, `app/Services/Payments/PaymentHelper.php:282`
|
|
920
|
+
|
|
921
|
+
**Usage:**
|
|
922
|
+
|
|
923
|
+
```
|
|
924
|
+
add_filter('fluent_cart/subscription_interval_in_days', function($days, $args) {
|
|
925
|
+
$interval = $args['interval'];
|
|
926
|
+
|
|
927
|
+
if ($interval === 'every_tenth_day') {
|
|
928
|
+
return 10;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
if ($interval === 'biweekly') {
|
|
932
|
+
return 14;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
return $days;
|
|
936
|
+
}, 10, 2);
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
### ` max_trial_days_allowed `
|
|
940
|
+
|
|
941
|
+
`fluent_cart/max_trial_days_allowed` — Filter maximum trial days allowed
|
|
942
|
+
|
|
943
|
+
**When it runs:** This filter is applied when calculating adjusted trial days for a subscription interval. The system ensures the trial period does not exceed this maximum.
|
|
944
|
+
|
|
945
|
+
**Parameters:**
|
|
946
|
+
|
|
947
|
+
- `$maxDays` (int): Maximum trial days allowed (default: `365`)
|
|
948
|
+
- `$context` (array): Context data
|
|
949
|
+
|
|
950
|
+
```
|
|
951
|
+
$context = [
|
|
952
|
+
'existing_trial_days' => 14,
|
|
953
|
+
'repeat_interval' => 'monthly',
|
|
954
|
+
'interval_in_days' => 30
|
|
955
|
+
];
|
|
956
|
+
```
|
|
957
|
+
|
|
958
|
+
**Returns:**
|
|
959
|
+
|
|
960
|
+
- `$maxDays` (int): The modified maximum trial days
|
|
961
|
+
|
|
962
|
+
**Source:** `app/Helpers/Helper.php:1775`
|
|
963
|
+
|
|
964
|
+
**Usage:**
|
|
965
|
+
|
|
966
|
+
```
|
|
967
|
+
add_filter('fluent_cart/max_trial_days_allowed', function($maxDays, $args) {
|
|
968
|
+
// Cap trials at 30 days for monthly subscriptions
|
|
969
|
+
if ($args['repeat_interval'] === 'monthly') {
|
|
970
|
+
return 30;
|
|
971
|
+
}
|
|
972
|
+
return $maxDays;
|
|
973
|
+
}, 10, 2);
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
### ` trial_info `
|
|
977
|
+
|
|
978
|
+
`fluent_cart/trial_info` — Filter trial info display text
|
|
979
|
+
|
|
980
|
+
**When it runs:** This filter is applied when generating the human-readable trial information text shown to customers (e.g., "Free Trial: 14 days").
|
|
981
|
+
|
|
982
|
+
**Parameters:**
|
|
983
|
+
|
|
984
|
+
- `$trialInfo` (string): The generated trial info text (e.g., `'Free Trial: 14 days'` or `''` if no trial)
|
|
985
|
+
- `$otherInfo` (array): The product/variant pricing metadata
|
|
986
|
+
|
|
987
|
+
```
|
|
988
|
+
$otherInfo = [
|
|
989
|
+
'trial_days' => 14,
|
|
990
|
+
'is_trial_days_simulated' => 'no',
|
|
991
|
+
'signup_fee' => 0,
|
|
992
|
+
'manage_setup_fee' => 'no',
|
|
993
|
+
// ... other pricing info
|
|
994
|
+
];
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
**Returns:**
|
|
998
|
+
|
|
999
|
+
- `$trialInfo` (string): The modified trial info text
|
|
1000
|
+
|
|
1001
|
+
**Source:** `app/Helpers/Helper.php:1339`
|
|
1002
|
+
|
|
1003
|
+
**Usage:**
|
|
1004
|
+
|
|
1005
|
+
```
|
|
1006
|
+
add_filter('fluent_cart/trial_info', function($trialInfo, $otherInfo) {
|
|
1007
|
+
$days = $otherInfo['trial_days'] ?? 0;
|
|
1008
|
+
if ($days > 0) {
|
|
1009
|
+
return sprintf('Try free for %d days - no credit card required!', $days);
|
|
1010
|
+
}
|
|
1011
|
+
return $trialInfo;
|
|
1012
|
+
}, 10, 2);
|
|
1013
|
+
```
|
|
1014
|
+
|
|
1015
|
+
---
|
|
1016
|
+
|
|
1017
|
+
## Subscription Billing
|
|
1018
|
+
|
|
1019
|
+
### ` subscription_billing_period `
|
|
1020
|
+
|
|
1021
|
+
`fluent_cart/subscription_billing_period` — Filter billing period for payment gateways
|
|
1022
|
+
|
|
1023
|
+
**When it runs:** This filter is applied when translating a FluentCart subscription interval into the payment gateway's billing period format (used by Stripe Plans and PayPal billing cycles).
|
|
1024
|
+
|
|
1025
|
+
**Parameters:**
|
|
1026
|
+
|
|
1027
|
+
- `$billingPeriod` (array): The billing period for the gateway
|
|
1028
|
+
|
|
1029
|
+
```
|
|
1030
|
+
$billingPeriod = [
|
|
1031
|
+
'interval_unit' => 'month', // day, week, month, year
|
|
1032
|
+
'interval_frequency' => 1 // e.g., 3 for quarterly
|
|
1033
|
+
];
|
|
1034
|
+
```
|
|
1035
|
+
|
|
1036
|
+
- `$context` (array): Context data
|
|
1037
|
+
|
|
1038
|
+
```
|
|
1039
|
+
$context = [
|
|
1040
|
+
'subscription_interval' => 'quarterly', // Original FluentCart interval
|
|
1041
|
+
'payment_method' => 'stripe' // or 'paypal'
|
|
1042
|
+
];
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
**Returns:**
|
|
1046
|
+
|
|
1047
|
+
- `$billingPeriod` (array): The modified billing period
|
|
1048
|
+
|
|
1049
|
+
**Source:** `app/Modules/PaymentMethods/StripeGateway/Plan.php:58`, `app/Modules/PaymentMethods/PayPalGateway/PayPalHelper.php:243`
|
|
1050
|
+
|
|
1051
|
+
**Usage:**
|
|
1052
|
+
|
|
1053
|
+
```
|
|
1054
|
+
add_filter('fluent_cart/subscription_billing_period', function($billingPeriod, $args) {
|
|
1055
|
+
$interval = $args['subscription_interval'];
|
|
1056
|
+
$method = $args['payment_method'];
|
|
1057
|
+
|
|
1058
|
+
if ($interval === 'every_tenth_day') {
|
|
1059
|
+
if ($method === 'stripe') {
|
|
1060
|
+
return [
|
|
1061
|
+
'interval_unit' => 'day',
|
|
1062
|
+
'interval_frequency' => 10
|
|
1063
|
+
];
|
|
1064
|
+
}
|
|
1065
|
+
if ($method === 'paypal') {
|
|
1066
|
+
return [
|
|
1067
|
+
'interval_unit' => 'DAY',
|
|
1068
|
+
'interval_frequency' => 10
|
|
1069
|
+
];
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
return $billingPeriod;
|
|
1074
|
+
}, 10, 2);
|
|
1075
|
+
```
|
|
1076
|
+
|
|
1077
|
+
### ` subscription/grace_period_days `
|
|
1078
|
+
|
|
1079
|
+
`fluent_cart/subscription/grace_period_days` — Filter grace period days per billing interval
|
|
1080
|
+
|
|
1081
|
+
**When it runs:** This filter is applied when retrieving the grace period (number of extra days after a payment fails before the subscription is marked as expired) for each billing interval.
|
|
1082
|
+
|
|
1083
|
+
**Parameters:**
|
|
1084
|
+
|
|
1085
|
+
- `$gracePeriods` (array): Associative array of interval => days
|
|
1086
|
+
|
|
1087
|
+
```
|
|
1088
|
+
$gracePeriods = [
|
|
1089
|
+
'daily' => 1,
|
|
1090
|
+
'weekly' => 3,
|
|
1091
|
+
'monthly' => 7,
|
|
1092
|
+
'quarterly' => 15,
|
|
1093
|
+
'half_yearly' => 15,
|
|
1094
|
+
'yearly' => 15
|
|
1095
|
+
];
|
|
1096
|
+
```
|
|
1097
|
+
|
|
1098
|
+
**Returns:**
|
|
1099
|
+
|
|
1100
|
+
- `$gracePeriods` (array): The modified grace period days
|
|
1101
|
+
|
|
1102
|
+
**Source:** `app/Services/Payments/SubscriptionHelper.php:188`
|
|
1103
|
+
|
|
1104
|
+
**Usage:**
|
|
1105
|
+
|
|
1106
|
+
```
|
|
1107
|
+
add_filter('fluent_cart/subscription/grace_period_days', function($gracePeriods) {
|
|
1108
|
+
// Give yearly subscribers more time
|
|
1109
|
+
$gracePeriods['yearly'] = 30;
|
|
1110
|
+
|
|
1111
|
+
// Add grace period for custom interval
|
|
1112
|
+
$gracePeriods['every_tenth_day'] = 5;
|
|
1113
|
+
|
|
1114
|
+
return $gracePeriods;
|
|
1115
|
+
});
|
|
1116
|
+
```
|
|
1117
|
+
|
|
1118
|
+
---
|
|
1119
|
+
|
|
1120
|
+
## Reminders
|
|
1121
|
+
|
|
1122
|
+
### ` reminders/scan_batch_size `
|
|
1123
|
+
|
|
1124
|
+
`fluent_cart/reminders/scan_batch_size` — Filter reminder scan batch size
|
|
1125
|
+
|
|
1126
|
+
**When it runs:** This filter is applied when the automated reminder system scans for subscriptions or invoices that need reminders. Controls how many records are processed per batch.
|
|
1127
|
+
|
|
1128
|
+
**Parameters:**
|
|
1129
|
+
|
|
1130
|
+
- `$batchSize` (int): Number of records per scan batch (default: `100`, min: `10`, max: `500`)
|
|
1131
|
+
|
|
1132
|
+
**Returns:**
|
|
1133
|
+
|
|
1134
|
+
- `$batchSize` (int): The modified batch size
|
|
1135
|
+
|
|
1136
|
+
**Source:** `app/Services/Reminders/ReminderService.php:355`
|
|
1137
|
+
|
|
1138
|
+
**Usage:**
|
|
1139
|
+
|
|
1140
|
+
```
|
|
1141
|
+
add_filter('fluent_cart/reminders/scan_batch_size', function($batchSize) {
|
|
1142
|
+
// Process more records per batch on high-traffic sites
|
|
1143
|
+
return 250;
|
|
1144
|
+
});
|
|
1145
|
+
```
|
|
1146
|
+
|
|
1147
|
+
### ` reminders/renewal_due_days `
|
|
1148
|
+
|
|
1149
|
+
`fluent_cart/reminders/renewal_due_days` — Filter renewal due-reminder days
|
|
1150
|
+
|
|
1151
|
+
**When it runs:** This filter is applied when determining how many days before a renewal is due to send a reminder. The value comes from the `renewal_reminder_due_days` store setting (default `0`) but can be overridden.
|
|
1152
|
+
|
|
1153
|
+
**Parameters:**
|
|
1154
|
+
|
|
1155
|
+
- `$days` (int): Number of days before the due date to send a reminder (min: `0`)
|
|
1156
|
+
|
|
1157
|
+
**Returns:**
|
|
1158
|
+
|
|
1159
|
+
- `$days` (int): The modified number of days
|
|
1160
|
+
|
|
1161
|
+
**Source:** `app/Services/Reminders/RenewalReminderService.php:294`
|
|
1162
|
+
|
|
1163
|
+
**Usage:**
|
|
1164
|
+
|
|
1165
|
+
```
|
|
1166
|
+
add_filter('fluent_cart/reminders/renewal_due_days', function($days) {
|
|
1167
|
+
// Always remind 3 days before a renewal is due
|
|
1168
|
+
return 3;
|
|
1169
|
+
});
|
|
1170
|
+
```
|
|
1171
|
+
|
|
1172
|
+
### ` reminders/renewal_overdue_days `
|
|
1173
|
+
|
|
1174
|
+
`fluent_cart/reminders/renewal_overdue_days` — Filter overdue renewal reminder intervals
|
|
1175
|
+
|
|
1176
|
+
**When it runs:** This filter is applied when determining at which day intervals after a renewal becomes overdue to send follow-up reminders. The list is parsed from the `renewal_reminder_overdue_days` store setting (default `1,3,7`) into an array before the filter runs.
|
|
1177
|
+
|
|
1178
|
+
**Parameters:**
|
|
1179
|
+
|
|
1180
|
+
- `$days` (array): Array of day intervals for overdue reminders (default `[1, 3, 7]`)
|
|
1181
|
+
|
|
1182
|
+
**Returns:**
|
|
1183
|
+
|
|
1184
|
+
- `$days` (array): The modified array of overdue reminder day intervals
|
|
1185
|
+
|
|
1186
|
+
**Source:** `app/Services/Reminders/RenewalReminderService.php:305`
|
|
1187
|
+
|
|
1188
|
+
**Usage:**
|
|
1189
|
+
|
|
1190
|
+
```
|
|
1191
|
+
add_filter('fluent_cart/reminders/renewal_overdue_days', function($days) {
|
|
1192
|
+
// Send overdue reminders at 1, 3, 7, and 14 days past due
|
|
1193
|
+
return [1, 3, 7, 14];
|
|
1194
|
+
});
|
|
1195
|
+
```
|
|
1196
|
+
|
|
1197
|
+
### ` reminders/billing_cycle `
|
|
1198
|
+
|
|
1199
|
+
`fluent_cart/reminders/billing_cycle` — Filter billing cycle name for reminder processing
|
|
1200
|
+
|
|
1201
|
+
**When it runs:** This filter is applied when mapping a subscription's billing interval to a billing cycle identifier used by the reminder system. Returns `'unsupported'` for unknown intervals by default.
|
|
1202
|
+
|
|
1203
|
+
**Parameters:**
|
|
1204
|
+
|
|
1205
|
+
- `$cycle` (string): The billing cycle name (e.g., `'monthly'`, `'yearly'`, `'unsupported'`)
|
|
1206
|
+
- `$subscription` ([Subscription](/database/models/subscription.md)): The Subscription model instance
|
|
1207
|
+
|
|
1208
|
+
**Returns:**
|
|
1209
|
+
|
|
1210
|
+
- `$cycle` (string): The modified billing cycle name
|
|
1211
|
+
|
|
1212
|
+
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:508`
|
|
1213
|
+
|
|
1214
|
+
**Usage:**
|
|
1215
|
+
|
|
1216
|
+
```
|
|
1217
|
+
add_filter('fluent_cart/reminders/billing_cycle', function($cycle, $subscription) {
|
|
1218
|
+
// Map custom intervals to supported reminder cycles
|
|
1219
|
+
if ($subscription->billing_interval === 'every_tenth_day') {
|
|
1220
|
+
return 'daily'; // Use daily reminder logic
|
|
1221
|
+
}
|
|
1222
|
+
return $cycle;
|
|
1223
|
+
}, 10, 2);
|
|
1224
|
+
```
|
|
1225
|
+
|
|
1226
|
+
### ` reminders/yearly_before_days `
|
|
1227
|
+
|
|
1228
|
+
`fluent_cart/reminders/yearly_before_days` — Filter days before yearly renewal reminder
|
|
1229
|
+
|
|
1230
|
+
**When it runs:** This filter is applied when determining at which day intervals before a yearly subscription renewal to send reminders.
|
|
1231
|
+
|
|
1232
|
+
**Parameters:**
|
|
1233
|
+
|
|
1234
|
+
- `$days` (array): Array of day intervals before renewal (default from settings: `[30]`, range: 7-90)
|
|
1235
|
+
|
|
1236
|
+
**Returns:**
|
|
1237
|
+
|
|
1238
|
+
- `$days` (array): The modified array of reminder day intervals
|
|
1239
|
+
|
|
1240
|
+
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:540`
|
|
1241
|
+
|
|
1242
|
+
**Usage:**
|
|
1243
|
+
|
|
1244
|
+
```
|
|
1245
|
+
add_filter('fluent_cart/reminders/yearly_before_days', function($days) {
|
|
1246
|
+
// Remind at 60, 30, and 7 days before yearly renewal
|
|
1247
|
+
return [60, 30, 7];
|
|
1248
|
+
});
|
|
1249
|
+
```
|
|
1250
|
+
|
|
1251
|
+
### ` reminders/monthly_before_days `
|
|
1252
|
+
|
|
1253
|
+
`fluent_cart/reminders/monthly_before_days` — Filter days before monthly renewal reminder
|
|
1254
|
+
|
|
1255
|
+
**When it runs:** This filter is applied when determining at which day intervals before a monthly subscription renewal to send reminders.
|
|
1256
|
+
|
|
1257
|
+
**Parameters:**
|
|
1258
|
+
|
|
1259
|
+
- `$days` (array): Array of day intervals before renewal (default from settings: `[7]`, range: 3-28)
|
|
1260
|
+
|
|
1261
|
+
**Returns:**
|
|
1262
|
+
|
|
1263
|
+
- `$days` (array): The modified array of reminder day intervals
|
|
1264
|
+
|
|
1265
|
+
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:552`
|
|
1266
|
+
|
|
1267
|
+
**Usage:**
|
|
1268
|
+
|
|
1269
|
+
```
|
|
1270
|
+
add_filter('fluent_cart/reminders/monthly_before_days', function($days) {
|
|
1271
|
+
// Remind at 7 and 3 days before monthly renewal
|
|
1272
|
+
return [7, 3];
|
|
1273
|
+
});
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
### ` reminders/quarterly_before_days `
|
|
1277
|
+
|
|
1278
|
+
`fluent_cart/reminders/quarterly_before_days` — Filter days before quarterly renewal reminder
|
|
1279
|
+
|
|
1280
|
+
**When it runs:** This filter is applied when determining at which day intervals before a quarterly subscription renewal to send reminders.
|
|
1281
|
+
|
|
1282
|
+
**Parameters:**
|
|
1283
|
+
|
|
1284
|
+
- `$days` (array): Array of day intervals before renewal (default from settings: `[14]`, range: 7-60)
|
|
1285
|
+
|
|
1286
|
+
**Returns:**
|
|
1287
|
+
|
|
1288
|
+
- `$days` (array): The modified array of reminder day intervals
|
|
1289
|
+
|
|
1290
|
+
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:564`
|
|
1291
|
+
|
|
1292
|
+
**Usage:**
|
|
1293
|
+
|
|
1294
|
+
```
|
|
1295
|
+
add_filter('fluent_cart/reminders/quarterly_before_days', function($days) {
|
|
1296
|
+
// Remind at 21 and 7 days before quarterly renewal
|
|
1297
|
+
return [21, 7];
|
|
1298
|
+
});
|
|
1299
|
+
```
|
|
1300
|
+
|
|
1301
|
+
### ` reminders/half_yearly_before_days `
|
|
1302
|
+
|
|
1303
|
+
`fluent_cart/reminders/half_yearly_before_days` — Filter days before half-yearly renewal reminder
|
|
1304
|
+
|
|
1305
|
+
**When it runs:** This filter is applied when determining at which day intervals before a half-yearly subscription renewal to send reminders.
|
|
1306
|
+
|
|
1307
|
+
**Parameters:**
|
|
1308
|
+
|
|
1309
|
+
- `$days` (array): Array of day intervals before renewal (default from settings: `[21]`, range: 7-60)
|
|
1310
|
+
|
|
1311
|
+
**Returns:**
|
|
1312
|
+
|
|
1313
|
+
- `$days` (array): The modified array of reminder day intervals
|
|
1314
|
+
|
|
1315
|
+
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:576`
|
|
1316
|
+
|
|
1317
|
+
**Usage:**
|
|
1318
|
+
|
|
1319
|
+
```
|
|
1320
|
+
add_filter('fluent_cart/reminders/half_yearly_before_days', function($days) {
|
|
1321
|
+
// Remind at 30 and 7 days before half-yearly renewal
|
|
1322
|
+
return [30, 7];
|
|
1323
|
+
});
|
|
1324
|
+
```
|
|
1325
|
+
|
|
1326
|
+
### ` reminders/trial_end_days `
|
|
1327
|
+
|
|
1328
|
+
`fluent_cart/reminders/trial_end_days` — Filter days before trial end reminder
|
|
1329
|
+
|
|
1330
|
+
**When it runs:** This filter is applied when determining at which day intervals before a trial period ends to send reminders to the customer.
|
|
1331
|
+
|
|
1332
|
+
**Parameters:**
|
|
1333
|
+
|
|
1334
|
+
- `$days` (array): Array of day intervals before trial ends (default from settings: `[3]`, range: 1-14)
|
|
1335
|
+
|
|
1336
|
+
**Returns:**
|
|
1337
|
+
|
|
1338
|
+
- `$days` (array): The modified array of reminder day intervals
|
|
1339
|
+
|
|
1340
|
+
**Source:** `app/Services/Reminders/SubscriptionReminderService.php:588`
|
|
1341
|
+
|
|
1342
|
+
**Usage:**
|
|
1343
|
+
|
|
1344
|
+
```
|
|
1345
|
+
add_filter('fluent_cart/reminders/trial_end_days', function($days) {
|
|
1346
|
+
// Remind at 7, 3, and 1 day before trial ends
|
|
1347
|
+
return [7, 3, 1];
|
|
1348
|
+
});
|
|
1349
|
+
```
|
|
1350
|
+
|
|
1351
|
+
---
|
|
1352
|
+
|
|
1353
|
+
## Collection Method & Auto-Charge Store-managed
|
|
1354
|
+
|
|
1355
|
+
Filters for the [store-managed subscription engine](/modules/subscriptions.md) — how the collection method is chosen, how renewals are scheduled, and how the `system` auto-charge retry/notification behaviour is tuned.
|
|
1356
|
+
|
|
1357
|
+
### ` subscription/management_mode `
|
|
1358
|
+
|
|
1359
|
+
`fluent_cart/subscription/management_mode` — Filter the effective subscription management mode
|
|
1360
|
+
|
|
1361
|
+
**When it runs:** This filter is applied when resolving the store's subscription management mode — `gateway_managed` or `store_managed` — which decides whether new subscriptions are billed by the gateway or by FluentCart's renewal engine.
|
|
1362
|
+
|
|
1363
|
+
**Parameters:**
|
|
1364
|
+
|
|
1365
|
+
- `$mode` (string): The management mode (`'gateway_managed'` or `'store_managed'`)
|
|
1366
|
+
|
|
1367
|
+
**Returns:**
|
|
1368
|
+
|
|
1369
|
+
- `$mode` (string): The (possibly overridden) mode
|
|
1370
|
+
|
|
1371
|
+
**Source:** `app/Modules/Subscriptions/Services/SubscriptionManagementMode.php:36`
|
|
1372
|
+
|
|
1373
|
+
**Usage:**
|
|
1374
|
+
|
|
1375
|
+
```
|
|
1376
|
+
add_filter('fluent_cart/subscription/management_mode', function($mode) {
|
|
1377
|
+
return 'store_managed';
|
|
1378
|
+
});
|
|
1379
|
+
```
|
|
1380
|
+
|
|
1381
|
+
### ` subscription_collection_method_{gateway} `
|
|
1382
|
+
|
|
1383
|
+
`fluent_cart/subscription_collection_method_{gateway}` — Per-gateway override of the resolved collection method
|
|
1384
|
+
|
|
1385
|
+
**When it runs:** This **dynamic** filter is applied at checkout after the collection method (`automatic` / `manual` / `system`) has been resolved for the chosen gateway. The `{gateway}` suffix is the payment method slug (e.g. `stripe`, `paypal`), so you can target a single gateway. It gets the last word over the decision matrix.
|
|
1386
|
+
|
|
1387
|
+
**Parameters:**
|
|
1388
|
+
|
|
1389
|
+
- `$collectionMethod` (string): The resolved collection method
|
|
1390
|
+
|
|
1391
|
+
**Returns:**
|
|
1392
|
+
|
|
1393
|
+
- `$collectionMethod` (string): The (possibly overridden) collection method
|
|
1394
|
+
|
|
1395
|
+
**Source:** `app/Helpers/CheckoutProcessor.php:963`
|
|
1396
|
+
|
|
1397
|
+
**Usage:**
|
|
1398
|
+
|
|
1399
|
+
```
|
|
1400
|
+
// Force PayPal subscriptions onto the store-managed manual engine
|
|
1401
|
+
add_filter('fluent_cart/subscription_collection_method_paypal', function($collectionMethod) {
|
|
1402
|
+
return 'manual';
|
|
1403
|
+
});
|
|
1404
|
+
```
|
|
1405
|
+
|
|
1406
|
+
### ` subscription/allowed_intervals `
|
|
1407
|
+
|
|
1408
|
+
`fluent_cart/subscription/allowed_intervals` — Filter the intervals a subscription may be changed to
|
|
1409
|
+
|
|
1410
|
+
**When it runs:** This filter is applied when validating an edit to a store-managed subscription's billing interval, controlling which target intervals are permitted.
|
|
1411
|
+
|
|
1412
|
+
**Parameters:**
|
|
1413
|
+
|
|
1414
|
+
- `$intervals` (array): Allowed interval identifiers
|
|
1415
|
+
- `$context` (array): `['subscription' => Subscription, 'current_interval' => string, 'new_interval' => string]`
|
|
1416
|
+
|
|
1417
|
+
**Returns:**
|
|
1418
|
+
|
|
1419
|
+
- `$intervals` (array): The (possibly modified) allowed intervals
|
|
1420
|
+
|
|
1421
|
+
**Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:966`
|
|
1422
|
+
|
|
1423
|
+
**Usage:**
|
|
1424
|
+
|
|
1425
|
+
```
|
|
1426
|
+
add_filter('fluent_cart/subscription/allowed_intervals', function($intervals, $context) {
|
|
1427
|
+
return $intervals;
|
|
1428
|
+
}, 10, 2);
|
|
1429
|
+
```
|
|
1430
|
+
|
|
1431
|
+
### ` renewal/advance_creation_days `
|
|
1432
|
+
|
|
1433
|
+
`fluent_cart/renewal/advance_creation_days` — Filter how many days ahead a renewal order is generated
|
|
1434
|
+
|
|
1435
|
+
**When it runs:** This filter is applied by the renewal engine when deciding how far in advance of the due date to generate the next renewal order. The map is keyed by billing interval.
|
|
1436
|
+
|
|
1437
|
+
**Parameters:**
|
|
1438
|
+
|
|
1439
|
+
- `$map` (array): Interval => advance-days map (e.g. `['month' => 3, 'year' => 7]`)
|
|
1440
|
+
- `$interval` (string): The subscription's billing interval being resolved
|
|
1441
|
+
|
|
1442
|
+
**Returns:**
|
|
1443
|
+
|
|
1444
|
+
- `$map` (array): The (possibly modified) advance-days map
|
|
1445
|
+
|
|
1446
|
+
**Source:** `app/Modules/StoreManagedRenewal/Services/RenewalService.php:911`
|
|
1447
|
+
|
|
1448
|
+
**Usage:**
|
|
1449
|
+
|
|
1450
|
+
```
|
|
1451
|
+
add_filter('fluent_cart/renewal/advance_creation_days', function($map, $interval) {
|
|
1452
|
+
$map['month'] = 5; // generate monthly renewals 5 days early
|
|
1453
|
+
return $map;
|
|
1454
|
+
}, 10, 2);
|
|
1455
|
+
```
|
|
1456
|
+
|
|
1457
|
+
### ` subscriptions/system_charge_retry_offsets `
|
|
1458
|
+
|
|
1459
|
+
`fluent_cart/subscriptions/system_charge_retry_offsets` — Filter the off-session charge retry ladder
|
|
1460
|
+
|
|
1461
|
+
**When it runs:** This filter is applied when building the retry schedule for a failed `system` auto-charge. Offsets are day fractions from the anchor, bounded by the grace window.
|
|
1462
|
+
|
|
1463
|
+
**Parameters:**
|
|
1464
|
+
|
|
1465
|
+
- `$offsets` (array): Retry offsets in days (floats)
|
|
1466
|
+
- `$context` (array): `['subscription' => Subscription, 'grace_days' => int]`
|
|
1467
|
+
|
|
1468
|
+
**Returns:**
|
|
1469
|
+
|
|
1470
|
+
- `$offsets` (array): The (possibly modified) retry offsets
|
|
1471
|
+
|
|
1472
|
+
**Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:213`
|
|
1473
|
+
|
|
1474
|
+
**Usage:**
|
|
1475
|
+
|
|
1476
|
+
```
|
|
1477
|
+
add_filter('fluent_cart/subscriptions/system_charge_retry_offsets', function($offsets, $context) {
|
|
1478
|
+
return [0, 1, 3]; // retry immediately, after 1 day, after 3 days
|
|
1479
|
+
}, 10, 2);
|
|
1480
|
+
```
|
|
1481
|
+
|
|
1482
|
+
### ` subscriptions/system_charge_failure_notify `
|
|
1483
|
+
|
|
1484
|
+
`fluent_cart/subscriptions/system_charge_failure_notify` — Decide whether to notify the customer on a failed charge
|
|
1485
|
+
|
|
1486
|
+
**When it runs:** This filter is applied when a `system` charge attempt fails, to decide whether the customer should be emailed for this attempt. Defaults to `true` only on the first attempt.
|
|
1487
|
+
|
|
1488
|
+
**Parameters:**
|
|
1489
|
+
|
|
1490
|
+
- `$notify` (bool): Whether to send a notification (default: `$attempt === 1`)
|
|
1491
|
+
- `$context` (array): `['order' => Order, 'subscription' => Subscription, 'attempt' => int]`
|
|
1492
|
+
|
|
1493
|
+
**Returns:**
|
|
1494
|
+
|
|
1495
|
+
- `$notify` (bool): Whether to notify
|
|
1496
|
+
|
|
1497
|
+
**Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:739`
|
|
1498
|
+
|
|
1499
|
+
**Usage:**
|
|
1500
|
+
|
|
1501
|
+
```
|
|
1502
|
+
add_filter('fluent_cart/subscriptions/system_charge_failure_notify', function($notify, $context) {
|
|
1503
|
+
return true; // notify on every failed attempt
|
|
1504
|
+
}, 10, 2);
|
|
1505
|
+
```
|
|
1506
|
+
|
|
1507
|
+
### ` subscriptions/upcoming_charge_notification `
|
|
1508
|
+
|
|
1509
|
+
`fluent_cart/subscriptions/upcoming_charge_notification` — Toggle the upcoming auto-charge notice
|
|
1510
|
+
|
|
1511
|
+
**When it runs:** This filter is applied before sending the "an automatic charge is coming up" notification for a `system` renewal.
|
|
1512
|
+
|
|
1513
|
+
**Parameters:**
|
|
1514
|
+
|
|
1515
|
+
- `$send` (bool): Whether to send the upcoming-charge notice (default: `true`)
|
|
1516
|
+
- `$data` (array): The renewal notification payload
|
|
1517
|
+
|
|
1518
|
+
**Returns:**
|
|
1519
|
+
|
|
1520
|
+
- `$send` (bool): Whether to send
|
|
1521
|
+
|
|
1522
|
+
**Source:** `app/Services/Email/EmailNotificationMailer.php:95`
|
|
1523
|
+
|
|
1524
|
+
**Usage:**
|
|
1525
|
+
|
|
1526
|
+
```
|
|
1527
|
+
add_filter('fluent_cart/subscriptions/upcoming_charge_notification', function($send, $data) {
|
|
1528
|
+
return $send;
|
|
1529
|
+
}, 10, 2);
|
|
1530
|
+
```
|
|
1531
|
+
|
|
1532
|
+
### ` subscriptions/system_billing_enabled `
|
|
1533
|
+
|
|
1534
|
+
`fluent_cart/subscriptions/system_billing_enabled` — Master switch for system auto-charge billing
|
|
1535
|
+
|
|
1536
|
+
**When it runs:** This filter is checked before the `system` charge engine runs. Returning `false` disables off-session auto-charging store-wide (subscriptions bill as `manual`).
|
|
1537
|
+
|
|
1538
|
+
**Parameters:**
|
|
1539
|
+
|
|
1540
|
+
- `$enabled` (bool): Whether system billing is enabled (default: `true`)
|
|
1541
|
+
|
|
1542
|
+
**Returns:**
|
|
1543
|
+
|
|
1544
|
+
- `$enabled` (bool): Whether to allow system billing
|
|
1545
|
+
|
|
1546
|
+
**Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:57`
|
|
1547
|
+
|
|
1548
|
+
**Usage:**
|
|
1549
|
+
|
|
1550
|
+
```
|
|
1551
|
+
add_filter('fluent_cart/subscriptions/system_billing_enabled', function($enabled) {
|
|
1552
|
+
return false; // turn off all automatic renewal charges
|
|
1553
|
+
});
|
|
1554
|
+
```
|
|
1555
|
+
|
|
1556
|
+
### ` subscriptions/system_collection_enabled `
|
|
1557
|
+
|
|
1558
|
+
`fluent_cart/subscriptions/system_collection_enabled` — Whether new subscriptions may resolve to `system`
|
|
1559
|
+
|
|
1560
|
+
**When it runs:** This filter gates whether a new subscription is allowed to be created with the `system` collection method at checkout. Returning `false` keeps store-managed subscriptions on `manual` even when the gateway supports auto-charge.
|
|
1561
|
+
|
|
1562
|
+
**Parameters:**
|
|
1563
|
+
|
|
1564
|
+
- `$enabled` (bool): Whether system collection is enabled (default: `true`)
|
|
1565
|
+
|
|
1566
|
+
**Returns:**
|
|
1567
|
+
|
|
1568
|
+
- `$enabled` (bool): Whether to allow the `system` collection method
|
|
1569
|
+
|
|
1570
|
+
**Source:** `app/Modules/Subscriptions/Services/SubscriptionManagementMode.php:55`
|
|
1571
|
+
|
|
1572
|
+
**Usage:**
|
|
1573
|
+
|
|
1574
|
+
```
|
|
1575
|
+
add_filter('fluent_cart/subscriptions/system_collection_enabled', function($enabled) {
|
|
1576
|
+
return false; // customers pay each renewal by hand, no saved-card auto-charge
|
|
1577
|
+
});
|
|
1578
|
+
```
|
|
1579
|
+
|
|
1580
|
+
---
|
|
1581
|
+
|
|
1582
|
+
## Pro: Early Payments & Reactivation
|
|
1583
|
+
|
|
1584
|
+
### ` subscription/early_payment_enabled `
|
|
1585
|
+
|
|
1586
|
+
`fluent_cart/subscription/early_payment_enabled` — Filter whether early installment payments are enabled
|
|
1587
|
+
|
|
1588
|
+
**When it runs:** This filter is applied when checking if the early payment feature for installment subscriptions is globally enabled. Requires FluentCart Pro to be active.
|
|
1589
|
+
|
|
1590
|
+
**Parameters:**
|
|
1591
|
+
|
|
1592
|
+
- `$isEnabled` (bool): Whether early payments are enabled (from store settings `enable_early_payment_for_installment`)
|
|
1593
|
+
|
|
1594
|
+
**Returns:**
|
|
1595
|
+
|
|
1596
|
+
- `$isEnabled` (bool): The modified enabled state
|
|
1597
|
+
|
|
1598
|
+
**Source:** `app/Modules/Subscriptions/Services/EarlyPaymentFeature.php:14`
|
|
1599
|
+
|
|
1600
|
+
**Usage:**
|
|
1601
|
+
|
|
1602
|
+
```
|
|
1603
|
+
add_filter('fluent_cart/subscription/early_payment_enabled', function($isEnabled) {
|
|
1604
|
+
// Disable early payments during a specific promotion period
|
|
1605
|
+
if (current_time('Y-m') === '2026-12') {
|
|
1606
|
+
return false;
|
|
1607
|
+
}
|
|
1608
|
+
return $isEnabled;
|
|
1609
|
+
});
|
|
1610
|
+
```
|
|
1611
|
+
|
|
1612
|
+
### ` subscription/can_early_pay `
|
|
1613
|
+
|
|
1614
|
+
`fluent_cart/subscription/can_early_pay` — Filter whether a specific subscription can make an early payment
|
|
1615
|
+
|
|
1616
|
+
**When it runs:** This filter is applied when checking if a specific installment subscription is eligible for early payment. The default check requires that early payments are globally enabled, the subscription has a finite bill count, there are remaining installments, and the subscription status is `active` or `trialing`.
|
|
1617
|
+
|
|
1618
|
+
**Parameters:**
|
|
1619
|
+
|
|
1620
|
+
- `$canPay` (bool): Whether the subscription can make an early payment
|
|
1621
|
+
- `$context` (array): Context data
|
|
1622
|
+
|
|
1623
|
+
```
|
|
1624
|
+
$context = [
|
|
1625
|
+
'subscription' => $subscription // Subscription model
|
|
1626
|
+
];
|
|
1627
|
+
```
|
|
1628
|
+
|
|
1629
|
+
**Returns:**
|
|
1630
|
+
|
|
1631
|
+
- `$canPay` (bool): The modified eligibility
|
|
1632
|
+
|
|
1633
|
+
**Source:** `app/Modules/Subscriptions/Services/EarlyPaymentFeature.php:26`
|
|
1634
|
+
|
|
1635
|
+
**Usage:**
|
|
1636
|
+
|
|
1637
|
+
```
|
|
1638
|
+
add_filter('fluent_cart/subscription/can_early_pay', function($canPay, $context) {
|
|
1639
|
+
$subscription = $context['subscription'];
|
|
1640
|
+
|
|
1641
|
+
// Only allow early payments for subscriptions with more than 2 remaining installments
|
|
1642
|
+
$remaining = $subscription->bill_times - $subscription->bill_count;
|
|
1643
|
+
if ($remaining <= 2) {
|
|
1644
|
+
return false;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
return $canPay;
|
|
1648
|
+
}, 10, 2);
|
|
1649
|
+
```
|
|
1650
|
+
|
|
1651
|
+
### ` subscription/reactivation_same_price_days_limit `
|
|
1652
|
+
|
|
1653
|
+
`fluent_cart/subscription/reactivation_same_price_days_limit` Pro — Filter days limit for same-price reactivation
|
|
1654
|
+
|
|
1655
|
+
**When it runs:** This filter is applied when a customer reactivates a canceled or expired subscription. If the subscription was canceled within this many days, the customer can reactivate at the original price without going through a new checkout.
|
|
1656
|
+
|
|
1657
|
+
**Parameters:**
|
|
1658
|
+
|
|
1659
|
+
- `$daysLimit` (int): Number of days within which same-price reactivation is allowed (default: `60`)
|
|
1660
|
+
- `$context` (array): Context data
|
|
1661
|
+
|
|
1662
|
+
```
|
|
1663
|
+
$context = [
|
|
1664
|
+
'subscription' => $subscription // Subscription model
|
|
1665
|
+
];
|
|
1666
|
+
```
|
|
1667
|
+
|
|
1668
|
+
**Returns:**
|
|
1669
|
+
|
|
1670
|
+
- `$daysLimit` (int): The modified days limit
|
|
1671
|
+
|
|
1672
|
+
**Source:** `fluent-cart-pro/app/Hooks/Handlers/SubscriptionRenewalHandler.php:288`
|
|
1673
|
+
|
|
1674
|
+
**Usage:**
|
|
1675
|
+
|
|
1676
|
+
```
|
|
1677
|
+
add_filter('fluent_cart/subscription/reactivation_same_price_days_limit', function($daysLimit, $context) {
|
|
1678
|
+
$subscription = $context['subscription'];
|
|
1679
|
+
|
|
1680
|
+
// Give yearly subscribers a longer reactivation window
|
|
1681
|
+
if ($subscription->billing_interval === 'yearly') {
|
|
1682
|
+
return 180; // 6 months
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
return $daysLimit;
|
|
1686
|
+
}, 10, 2);
|
|
1687
|
+
```
|
|
1688
|
+
|
|
1689
|
+
---
|
|
1690
|
+
|
|
1691
|
+
## Pro: License Customer Portal
|
|
1692
|
+
|
|
1693
|
+
### ` customer/license_details_section_parts `
|
|
1694
|
+
|
|
1695
|
+
`fluent_cart/customer/license_details_section_parts` Pro — Filter license details section parts in customer portal
|
|
1696
|
+
|
|
1697
|
+
**When it runs:** This filter is applied when rendering a license details page in the customer portal, allowing you to inject custom HTML into specific sections of the license view.
|
|
1698
|
+
|
|
1699
|
+
**Parameters:**
|
|
1700
|
+
|
|
1701
|
+
- `$sectionParts` (array): Associative array of injectable HTML sections
|
|
1702
|
+
|
|
1703
|
+
```
|
|
1704
|
+
$sectionParts = [
|
|
1705
|
+
'before_summary' => '',
|
|
1706
|
+
'after_summary' => '',
|
|
1707
|
+
'end_of_details' => '',
|
|
1708
|
+
'additional_actions' => ''
|
|
1709
|
+
];
|
|
1710
|
+
```
|
|
1711
|
+
|
|
1712
|
+
- `$context` (array): Context data
|
|
1713
|
+
|
|
1714
|
+
```
|
|
1715
|
+
$context = [
|
|
1716
|
+
'license' => $license, // License model
|
|
1717
|
+
'formattedData' => $formattedData // Formatted license data for display
|
|
1718
|
+
];
|
|
1719
|
+
```
|
|
1720
|
+
|
|
1721
|
+
**Returns:**
|
|
1722
|
+
|
|
1723
|
+
- `$sectionParts` (array): The modified section parts
|
|
1724
|
+
|
|
1725
|
+
**Source:** `fluent-cart-pro/app/Modules/Licensing/Http/Controllers/CustomerProfileController.php:97`
|
|
1726
|
+
|
|
1727
|
+
**Usage:**
|
|
1728
|
+
|
|
1729
|
+
```
|
|
1730
|
+
add_filter('fluent_cart/customer/license_details_section_parts', function($parts, $context) {
|
|
1731
|
+
$license = $context['license'];
|
|
1732
|
+
|
|
1733
|
+
// Add activation instructions after the summary
|
|
1734
|
+
$parts['after_summary'] = '<div class="activation-guide">'
|
|
1735
|
+
. '<h4>How to Activate</h4>'
|
|
1736
|
+
. '<p>Copy your license key and paste it in your plugin settings.</p>'
|
|
1737
|
+
. '</div>';
|
|
1738
|
+
|
|
1739
|
+
// Add a custom action button
|
|
1740
|
+
$parts['additional_actions'] = '<button class="btn-regenerate" onclick="regenerateLicense(\'' . $license->id . '\')">Regenerate Key</button>';
|
|
1741
|
+
|
|
1742
|
+
return $parts;
|
|
1743
|
+
}, 10, 2);
|
|
1744
|
+
```
|
|
1745
|
+
|
|
1746
|
+
---
|