fluentcart-developer 1.1.0 → 1.1.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.
Files changed (65) hide show
  1. package/CLAUDE.md +22 -22
  2. package/LICENSE +21 -21
  3. package/README.md +169 -127
  4. package/SKILL.md +127 -127
  5. package/bin/index.js +281 -281
  6. package/package.json +48 -37
  7. package/skills/fluentcart-developer/SKILL.md +172 -172
  8. package/skills/fluentcart-developer/examples/README.md +25 -25
  9. package/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
  10. package/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
  11. package/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +114 -114
  12. package/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +149 -149
  13. package/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
  14. package/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +62 -62
  15. package/skills/fluentcart-developer/references/action-hooks-admin-templates.md +787 -787
  16. package/skills/fluentcart-developer/references/action-hooks-cart-checkout.md +1355 -1355
  17. package/skills/fluentcart-developer/references/action-hooks-customers-users.md +266 -266
  18. package/skills/fluentcart-developer/references/action-hooks-licenses.md +855 -855
  19. package/skills/fluentcart-developer/references/action-hooks-orders.md +631 -631
  20. package/skills/fluentcart-developer/references/action-hooks-payments-integrations.md +963 -963
  21. package/skills/fluentcart-developer/references/action-hooks-products-coupons.md +585 -585
  22. package/skills/fluentcart-developer/references/action-hooks-subscriptions.md +661 -661
  23. package/skills/fluentcart-developer/references/database-models-query-builder.md +194 -194
  24. package/skills/fluentcart-developer/references/database-models-reference.md +604 -604
  25. package/skills/fluentcart-developer/references/database-schema-reference.md +940 -940
  26. package/skills/fluentcart-developer/references/engineering-notes.md +154 -154
  27. package/skills/fluentcart-developer/references/fee-system-guide.md +449 -449
  28. package/skills/fluentcart-developer/references/filter-hooks-cart-checkout.md +1202 -1202
  29. package/skills/fluentcart-developer/references/filter-hooks-customers-subscriptions.md +902 -902
  30. package/skills/fluentcart-developer/references/filter-hooks-integrations-advanced.md +1598 -1598
  31. package/skills/fluentcart-developer/references/filter-hooks-orders-payments.md +1319 -1319
  32. package/skills/fluentcart-developer/references/filter-hooks-products-pricing.md +628 -628
  33. package/skills/fluentcart-developer/references/filter-hooks-settings-configuration.md +1177 -1177
  34. package/skills/fluentcart-developer/references/fluentcart-developer-guide.md +154 -154
  35. package/skills/fluentcart-developer/references/ghost-product-selling.md +458 -458
  36. package/skills/fluentcart-developer/references/modules-and-extensions-reference.md +224 -224
  37. package/skills/fluentcart-developer/references/payment-gateway-integration.md +761 -761
  38. package/skills/fluentcart-developer/references/rest-api-checkout.md +286 -286
  39. package/skills/fluentcart-developer/references/rest-api-coupons.md +794 -794
  40. package/skills/fluentcart-developer/references/rest-api-customer-profile.md +190 -190
  41. package/skills/fluentcart-developer/references/rest-api-customers.md +1121 -1121
  42. package/skills/fluentcart-developer/references/rest-api-dashboard-utilities.md +219 -219
  43. package/skills/fluentcart-developer/references/rest-api-email-notifications.md +619 -619
  44. package/skills/fluentcart-developer/references/rest-api-files.md +290 -290
  45. package/skills/fluentcart-developer/references/rest-api-integrations.md +324 -324
  46. package/skills/fluentcart-developer/references/rest-api-labels-attributes.md +321 -321
  47. package/skills/fluentcart-developer/references/rest-api-licensing.md +171 -171
  48. package/skills/fluentcart-developer/references/rest-api-order-bumps.md +200 -200
  49. package/skills/fluentcart-developer/references/rest-api-orders.md +1241 -1241
  50. package/skills/fluentcart-developer/references/rest-api-overview.md +131 -131
  51. package/skills/fluentcart-developer/references/rest-api-products.md +2563 -2563
  52. package/skills/fluentcart-developer/references/rest-api-public-shop.md +172 -172
  53. package/skills/fluentcart-developer/references/rest-api-reference.md +552 -552
  54. package/skills/fluentcart-developer/references/rest-api-reports.md +377 -377
  55. package/skills/fluentcart-developer/references/rest-api-roles-permissions.md +147 -147
  56. package/skills/fluentcart-developer/references/rest-api-settings.md +528 -528
  57. package/skills/fluentcart-developer/references/rest-api-shipping.md +799 -799
  58. package/skills/fluentcart-developer/references/rest-api-subscriptions.md +606 -606
  59. package/skills/fluentcart-developer/references/rest-api-tax.md +356 -356
  60. package/skills/fluentcart-developer/references/subscription-customization.md +197 -197
  61. package/skills/fluentcart-developer/scripts/cli.js +1 -1
  62. package/.gitattributes +0 -2
  63. package/CONTRIBUTING.md +0 -73
  64. package/copy-skills.js +0 -43
  65. package/skills.sh.json +0 -13
@@ -1,172 +1,172 @@
1
- ---
2
- name: FluentCart Developer
3
- description: Comprehensive developer knowledge base for FluentCart e-commerce plugin development. Covers theme compatibility, template system, classic & block themes, action & filter hooks, Facebook Meta Pixel & GA4 tracking, Elementor, Gutenberg & Bricks integration, custom payment gateways, dynamic shipping carriers, database models, REST API, fee surcharges, ghost products, subscriptions, and WP-CLI.
4
- ---
5
-
6
- # FluentCart Developer Skill
7
-
8
- Complete technical reference, architectural manual, and AI guidance system for developing extensions, themes, custom payment gateways, shipping carriers, fee surcharges, REST API integrations, and hook listeners for **FluentCart**.
9
-
10
- ---
11
-
12
- ## 🤖 AI Agent Execution Protocol & Routing Guidelines
13
-
14
- When assisting a developer with FluentCart tasks, follow this step-by-step workflow:
15
-
16
- ### Step 1: Identify Task Scope & Domain
17
- Determine which area of FluentCart the user's request touches:
18
- - **Order Lifecycle & Payments:** Creating orders, handling refunds, checkout hooks, payment gateway integration.
19
- - **Subscriptions & Recurring Revenue:** Subscription status transitions, renewals, grace periods, billing cycles.
20
- - **Software Licensing (Pro):** License key generation, site activations/deactivations, update API.
21
- - **Cart & Checkout:** Cart items, validation, custom items, custom fee surcharges, checkout form schema.
22
- - **Database & Architecture:** Querying FluentCart tables (`wp_fct_*`), Eloquent models, relationships.
23
- - **REST API:** Administrative endpoints, customer portal endpoints, external API consumption.
24
-
25
- ### Step 2: Read Target Reference File(s)
26
- Do not guess hook names, parameter signatures, or schema columns. Open and inspect the dedicated reference file under `references/`:
27
-
28
- #### Action Hooks (8 Modular Files)
29
- - [action-hooks-orders.md](references/action-hooks-orders.md) — Order creation, paid/completion events, refunds, status transitions, shipping fulfillment.
30
- - [action-hooks-subscriptions.md](references/action-hooks-subscriptions.md) — Subscription lifecycle, status changes, renewal processing, reminder notifications.
31
- - [action-hooks-licenses.md](references/action-hooks-licenses.md) — Software license updates, site activations/deactivations, license keys (Pro).
32
- - [action-hooks-cart-checkout.md](references/action-hooks-cart-checkout.md) — Shopping flow from cart item additions to checkout page and thank-you receipt rendering.
33
- - [action-hooks-customers-users.md](references/action-hooks-customers-users.md) — Customer lifecycle, user registration, customer portal tab/section rendering.
34
- - [action-hooks-products-coupons.md](references/action-hooks-products-coupons.md) — Product creation, duplication, single product and archive page hooks, coupon creation.
35
- - [action-hooks-payments-integrations.md](references/action-hooks-payments-integrations.md) — Payment gateway webhooks (Stripe, PayPal, Mollie, Paddle), integration feeds, dev logging.
36
- - [action-hooks-admin-templates.md](references/action-hooks-admin-templates.md) — Application boot (`fluentcart_loaded`), admin UI menus, block/email editor, shortcode views, REST policy checks.
37
-
38
- #### Filter Hooks (6 Modular Files)
39
- - [filter-hooks-settings-configuration.md](references/filter-hooks-settings-configuration.md) — Store settings defaults, currency options, translations, email notifications, admin menu items.
40
- - [filter-hooks-orders-payments.md](references/filter-hooks-orders-payments.md) — Order/payment/shipping statuses, Stripe/PayPal/Mollie/Paddle gateway parameters, tax titles, invoice numbers.
41
- - [filter-hooks-products-pricing.md](references/filter-hooks-products-pricing.md) — Product query builder (`shop_query`), variation display, button texts, stock availability, coupon validation.
42
- - [filter-hooks-cart-checkout.md](references/filter-hooks-cart-checkout.md) — Cart item validation, fee items, estimated totals, checkout address fields, EU VAT/business rules.
43
- - [filter-hooks-customers-subscriptions.md](references/filter-hooks-customers-subscriptions.md) — Customer portal tabs/endpoints, subscription statuses, grace periods, billing cycles, reminder schedules.
44
- - [filter-hooks-integrations-advanced.md](references/filter-hooks-integrations-advanced.md) — Integration feeds, S3/local file storage, template paths, dashboard widgets, list filter queries, e-invoicing.
45
-
46
- #### Core Architecture & System References
47
- - [fluentcart-developer-guide.md](references/fluentcart-developer-guide.md) — Comprehensive developer guide, core concepts, codebase directory layout, and version comparison.
48
- - [database-schema-reference.md](references/database-schema-reference.md) — Complete database schema for all `wp_fct_*` tables.
49
- - [database-models-reference.md](references/database-models-reference.md) — FluentCart Eloquent Models, relationships, and scopes across Core and Pro modules.
50
- - [database-models-query-builder.md](references/database-models-query-builder.md) — FluentCart ORM Query Builder usage, aggregates, CRUD operations, and comprehensive model map.
51
- - [rest-api-reference.md](references/rest-api-reference.md) — Full REST API endpoints index, authentication, request/response formats.
52
- - [rest-api-overview.md](references/rest-api-overview.md) — REST API getting started, authentication standards, module catalog, permission system (32 permissions across 4 roles), and error handling.
53
- - [rest-api-orders.md](references/rest-api-orders.md) — Orders REST API (22 endpoints): CRUD, calculate shipping, bulk actions, refunds, customer reassignment, dispute handling, transactions.
54
- - [rest-api-products.md](references/rest-api-products.md) — Products REST API (59 endpoints): CRUD, pricing, search/lookup, bulk operations, duplicate, bundle info, upgrade paths, inventory, downloadables, variations, integrations.
55
- - [rest-api-customers.md](references/rest-api-customers.md) — Customers REST API (18 endpoints): CRUD, additional info (labels), bulk actions, order history, LTV recalculation, address management, WP user association.
56
- - [rest-api-coupons.md](references/rest-api-coupons.md) — Coupons REST API (12 endpoints): CRUD, paginated listing, apply/cancel/reapply, product eligibility, checkout settings, Coupon model & DB table reference.
57
- - [rest-api-subscriptions.md](references/rest-api-subscriptions.md) — Subscriptions REST API (17 endpoints): Admin lifecycle (cancel, remote fetch, early payment links), Customer Portal self-service (payment updates, gateway switching, auto-renew cancellation), status constants, and hooks.
58
- - [rest-api-tax.md](references/rest-api-tax.md) — Tax REST API (26 endpoints): Tax filing, tax classes, country rates, shipping/product category overrides, global tax settings, and EU VAT / OSS cross-border compliance.
59
- - [rest-api-shipping.md](references/rest-api-shipping.md) — Shipping REST API (15 endpoints, `store/sensitive` permission): Shipping zones (region reset side effects, reordering), shipping methods (`flat_rate`, `free_shipping`, `local_pickup`, state scoping), shipping classes (`fixed` & `percentage` costs, `per_item` flags), and data models.
60
- - [rest-api-settings.md](references/rest-api-settings.md) — Settings REST API (30 endpoints, `StoreSettingsPolicy` & `is_super_admin`): Gateway setup (Stripe, PayPal connect, reordering, designs, addons), PayPal OAuth & webhooks, store configuration (`FluentMetaRequest`), module toggles, permissions, confirmation shortcodes, storage drivers (S3, Bunny, Local), and checkout fields.
61
- - [rest-api-email-notifications.md](references/rest-api-email-notifications.md) — Email Notifications REST API (11 endpoints, `store/sensitive` permission): Email templates catalog (order, subscription, scheduler), single template editor shortcodes, template HTML previews (custom & default PHP), global email sender configuration, and automated scheduling reminders.
62
- - [rest-api-reports.md](references/rest-api-reports.md) — Reports API (45 endpoints, `ReportPolicy` & `reports/view` permission): Standard report parameters, YoY revenue overview, sales growth, quick stats, revenue/orders by grouping dimensions, day/hour heatmap, top products/variants, refund analytics, software license metrics, subscription MRR & cohort retention matrices, Action Scheduler snapshot generation, and UTM source attribution.
63
- - [rest-api-integrations.md](references/rest-api-integrations.md) — Integrations API (17 endpoints, `IntegrationPolicy` & `ProductPolicy`): Addon listings & WP.org auto-installer, global provider credentials, global integration feeds, list merge field mapping, dynamic options & chained inputs, product-level integration feeds (`conditional_variation_ids`), and status toggles.
64
- - [rest-api-files.md](references/rest-api-files.md) — Files API (5 endpoints, `StoreSensitivePolicy` & `AdminPolicy`): Downloadable file CRUD across storage drivers (Local, S3, Bunny, R2), timestamp collision prevention (`name__fluent-cart__.timestamp.ext`), blocked extension filters (`fluent_cart/local_file_blocked_extensions`), storage bucket lists, and WP Media Library editor image uploads (`media_handle_upload`).
65
- - [rest-api-labels-attributes.md](references/rest-api-labels-attributes.md) — Labels & Attributes API (13 endpoints, `LabelPolicy` & `ProductPolicy`): Polymorphic order/customer labels (`LabelRequest`, `update-label-selections`), variation attribute groups (`AttrGroupRequest`, deletion guards), and attribute terms (`AttrTermRequest`, serial ordering).
66
- - [rest-api-dashboard-utilities.md](references/rest-api-dashboard-utilities.md) — Dashboard & Utilities API (20 endpoints): Onboarding checklist wizard, 30-day dashboard stats widgets, page generator (`CreatePageRequest`), admin SPA init (`/app/init`), activity log (`/activity`), order notes, print HTML templates (invoices & slips), dynamic widgets, country address locales, and advanced filter options.
67
- - [rest-api-public-shop.md](references/rest-api-public-shop.md) — Public Shop API (3 endpoints, `PublicPolicy` unauthenticated): Public catalog product browsing with taxonomy/price filters (cents pricing in `detail`), server-rendered HTML grid views for Gutenberg blocks & shortcodes (`ProductListRenderer`, transient block caching), and live search autocomplete (`SearchBarRenderer`).
68
- - [rest-api-checkout.md](references/rest-api-checkout.md) — Checkout API (7 endpoints, `PublicPolicy`): Order placement (`place-order`, rate limit 5 req/60s), gateway UI configuration (`get-order-info`), cart summary calculation with shipping (`get-checkout-summary-view`), shipping availability (`get-available-shipping-methods` & list view), country locale rules (`get-country-info`), and customer login (`/user/login` with `X-WP-Nonce`).
69
- - [rest-api-customer-profile.md](references/rest-api-customer-profile.md) — Customer Profile API (18 endpoints, `CustomerFrontendPolicy` authenticated): Portal dashboard overview, profile details & password updates, checkout address selector (`fct_cart_hash`), portal address management (guards against deleting primary/last address), order history & UUID details, plan upgrade paths & prorations, transaction invoice billing address editing (`vat_tax_id`), and signed digital file downloads.
70
- - [rest-api-licensing.md](references/rest-api-licensing.md) — Licensing API (22 endpoints, `LicensePolicy` & Pro required): Admin software license CRUD, key regeneration, validity extensions (`lifetime` or `YYYY-MM-DD`), per-product variation validity rules (disabled for bundles), customer portal self-service activations, site Pro plugin licensing, and non-REST public software update API (`/?fluent-cart={action}`) with 48-hour signed package download tokens & staging auto-detection.
71
- - [rest-api-roles-permissions.md](references/rest-api-roles-permissions.md) — Roles & Permissions API (7 endpoints, `AdminPolicy` & Pro required): List managers, user search (excluding WP admins), role definitions (`super_admin`, `manager`, `worker`, `accountant`), role assignment sync (`fluent_cart_admin`), role deletion, and capability matrix filters (`fluent_cart/permission/all_roles`).
72
- - [rest-api-order-bumps.md](references/rest-api-order-bumps.md) — Order Bumps API (5 endpoints, `OrderBumpPolicy` & `store/sensitive` & Pro required): Checkout order bump promotion CRUD (`fct_order_promotions` table), `product_variant` eager loading, discount configuration (`percentage` vs `fixed` in cents), priority ordering, and cart condition rules.
73
- - [modules-and-extensions-reference.md](references/modules-and-extensions-reference.md) — Building payment gateways, shipping carriers, fee surcharges, ghost products.
74
- - [engineering-notes.md](references/engineering-notes.md) — Architecture decisions, performance work, and production lessons from FluentCart's core engineering team.
75
-
76
- #### Tutorials & Implementation Guides
77
- - [fee-system-guide.md](references/fee-system-guide.md) — Fee system (surcharges & additional charges), dynamic fees via filter, persistent fees via Cart methods, complete tiered fee addon example.
78
- - [ghost-product-selling.md](references/ghost-product-selling.md) — Ghost product selling, custom cart items, validation hooks, quantity changes, checkout validation, admin order updates, sample datasets.
79
- - [payment-gateway-integration.md](references/payment-gateway-integration.md) — Payment Methods module architecture, custom gateway development (gateway class, settings, API, webhooks), registration, processing flow, testing.
80
- - [paddle-gateway-case-study.md](references/paddle-gateway-case-study.md) — Paddle payment gateway case study, settings field schema, real-world gateway implementation example.
81
- #### Runnable Code Examples & Project Boilerplates (`examples/`)
82
- - [examples/README.md](examples/README.md) — Inventory and developer guide for ready-to-use sample plugins and templates.
83
- - [sample-custom-addon/fluentcart-custom-addon.php](examples/sample-custom-addon/fluentcart-custom-addon.php) — Complete starter plugin with hook handlers, custom order meta, system logging, fee filters, and custom REST API endpoint.
84
- - [sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php](examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php) — Dynamic conditional fee surcharges (cents calculations, percentage payment surcharges).
85
- - [sample-custom-payment-gateway/fluentcart-custom-gateway-example.php](examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php) — Complete custom payment gateway implementation extending `AbstractPaymentGateway` and `BaseGatewaySettings`.
86
- - [sample-shipping-carrier/fluentcart-custom-shipping-carrier.php](examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php) — Dynamic shipping carrier calculation filter callback example.
87
- - [fluentcart-starter-child-theme/](examples/fluentcart-starter-child-theme/) — Starter child theme with `add_theme_support('fluent_cart')` and template override structure.
88
-
89
- ---
90
-
91
- ## 📜 Core Technical Rules & Conventions
92
-
93
- ### 1. Monetary Values & Currency Storage
94
- - **ALWAYS store and calculate monetary values as integers in CENTS** (e.g. `$10.00` = `1000`, `$19.99` = `1999`).
95
- - Convert decimal inputs to cents before saving: `\FluentCart\App\Helpers\Helper::toCent($decimalAmount)`.
96
- - Format cents into decimal string for display: `\FluentCart\App\Helpers\Helper::toDecimal($amountInCents)`.
97
-
98
- ### 2. Code Commenting Standards
99
- - **ALWAYS add meaningful single-line explanatory comments to PHP code snippets** (above/inside hook callbacks and helper calls) so developers can easily understand the logic.
100
-
101
- ### 3. Asynchronous Post-Payment Tasks
102
- - **NEVER** perform blocking API calls (CRMs, webhooks, external emails) synchronously inside payment execution loops.
103
- - Use `fluent_cart/order_paid_done` or Action Scheduler for asynchronous background processing.
104
-
105
- ### 4. Database Access
106
- - Use FluentCart Eloquent Models (`\FluentCart\App\Models\*`) rather than raw `$wpdb` queries whenever possible.
107
-
108
- ### 5. IoC Container & Global Helpers
109
- - Access container services: `\FluentCart\App\App::make('cart')` or `\FluentCart\App\App::getInstance()`.
110
- - Store configuration: `\FluentCart\App\Helpers\Helper::getStoreSettings()`.
111
- - Default store currency: `\FluentCart\App\Helpers\Helper::getCurrency()`.
112
- - System logging: `fluent_cart_add_log($title, $content, $type)` (`'info'`, `'error'`, `'warning'`).
113
-
114
- ---
115
-
116
- ## 🛠 Extension Code Templates
117
-
118
- ### 1. Extension Plugin Boilerplate
119
- ```php
120
- <?php
121
- /**
122
- * Plugin Name: Custom FluentCart Addon
123
- * Description: Custom extension for FluentCart.
124
- * Version: 1.0.0
125
- * Author: Developer
126
- */
127
-
128
- if (!defined('ABSPATH')) {
129
- exit;
130
- }
131
-
132
- // Guard execution until WordPress plugins are loaded and FluentCart is active
133
- add_action('plugins_loaded', function () {
134
- if (!defined('FLUENT_CART')) {
135
- return; // FluentCart is not active
136
- }
137
-
138
- // Initialize custom hook listeners and extension logic
139
- });
140
- ```
141
-
142
- ### 2. Surcharge / Extra Fee Filter Pattern
143
- ```php
144
- // Add custom handling fee to cart estimated total
145
- add_filter('fluent_cart/fee_items', function ($fees, $cart) {
146
- // Append $5.00 handling fee (500 cents)
147
- $fees[] = [
148
- 'id' => 'handling_fee',
149
- 'title' => __('Special Handling Fee', 'my-extension'),
150
- 'amount' => 500, // Amount in cents
151
- 'taxable' => false,
152
- ];
153
- return $fees;
154
- }, 10, 2);
155
- ```
156
-
157
- ### 3. Order Paid Event Listener Pattern
158
- ```php
159
- // Listen for completed order payments to trigger post-payment processing
160
- add_action('fluent_cart/order_paid_done', function ($data) {
161
- // Extract order model and customer model instances from payload
162
- $order = $data['order'];
163
- $customer = $data['customer'];
164
-
165
- // Log order completion event to FluentCart logs
166
- fluent_cart_add_log(
167
- 'Order Completed',
168
- 'Processed order #' . $order->id . ' for customer ' . $customer->email,
169
- 'info'
170
- );
171
- }, 10, 1);
172
- ```
1
+ ---
2
+ name: fluentcart-developer
3
+ description: Comprehensive developer knowledge base for FluentCart e-commerce plugin development. Covers theme compatibility, template system, classic & block themes, action & filter hooks, Facebook Meta Pixel & GA4 tracking, Elementor, Gutenberg & Bricks integration, custom payment gateways, dynamic shipping carriers, database models, REST API, fee surcharges, ghost products, subscriptions, and WP-CLI.
4
+ ---
5
+
6
+ # FluentCart Developer Skill
7
+
8
+ Complete technical reference, architectural manual, and AI guidance system for developing extensions, themes, custom payment gateways, shipping carriers, fee surcharges, REST API integrations, and hook listeners for **FluentCart**.
9
+
10
+ ---
11
+
12
+ ## 🤖 AI Agent Execution Protocol & Routing Guidelines
13
+
14
+ When assisting a developer with FluentCart tasks, follow this step-by-step workflow:
15
+
16
+ ### Step 1: Identify Task Scope & Domain
17
+ Determine which area of FluentCart the user's request touches:
18
+ - **Order Lifecycle & Payments:** Creating orders, handling refunds, checkout hooks, payment gateway integration.
19
+ - **Subscriptions & Recurring Revenue:** Subscription status transitions, renewals, grace periods, billing cycles.
20
+ - **Software Licensing (Pro):** License key generation, site activations/deactivations, update API.
21
+ - **Cart & Checkout:** Cart items, validation, custom items, custom fee surcharges, checkout form schema.
22
+ - **Database & Architecture:** Querying FluentCart tables (`wp_fct_*`), Eloquent models, relationships.
23
+ - **REST API:** Administrative endpoints, customer portal endpoints, external API consumption.
24
+
25
+ ### Step 2: Read Target Reference File(s)
26
+ Do not guess hook names, parameter signatures, or schema columns. Open and inspect the dedicated reference file under `references/`:
27
+
28
+ #### Action Hooks (8 Modular Files)
29
+ - [action-hooks-orders.md](references/action-hooks-orders.md) — Order creation, paid/completion events, refunds, status transitions, shipping fulfillment.
30
+ - [action-hooks-subscriptions.md](references/action-hooks-subscriptions.md) — Subscription lifecycle, status changes, renewal processing, reminder notifications.
31
+ - [action-hooks-licenses.md](references/action-hooks-licenses.md) — Software license updates, site activations/deactivations, license keys (Pro).
32
+ - [action-hooks-cart-checkout.md](references/action-hooks-cart-checkout.md) — Shopping flow from cart item additions to checkout page and thank-you receipt rendering.
33
+ - [action-hooks-customers-users.md](references/action-hooks-customers-users.md) — Customer lifecycle, user registration, customer portal tab/section rendering.
34
+ - [action-hooks-products-coupons.md](references/action-hooks-products-coupons.md) — Product creation, duplication, single product and archive page hooks, coupon creation.
35
+ - [action-hooks-payments-integrations.md](references/action-hooks-payments-integrations.md) — Payment gateway webhooks (Stripe, PayPal, Mollie, Paddle), integration feeds, dev logging.
36
+ - [action-hooks-admin-templates.md](references/action-hooks-admin-templates.md) — Application boot (`fluentcart_loaded`), admin UI menus, block/email editor, shortcode views, REST policy checks.
37
+
38
+ #### Filter Hooks (6 Modular Files)
39
+ - [filter-hooks-settings-configuration.md](references/filter-hooks-settings-configuration.md) — Store settings defaults, currency options, translations, email notifications, admin menu items.
40
+ - [filter-hooks-orders-payments.md](references/filter-hooks-orders-payments.md) — Order/payment/shipping statuses, Stripe/PayPal/Mollie/Paddle gateway parameters, tax titles, invoice numbers.
41
+ - [filter-hooks-products-pricing.md](references/filter-hooks-products-pricing.md) — Product query builder (`shop_query`), variation display, button texts, stock availability, coupon validation.
42
+ - [filter-hooks-cart-checkout.md](references/filter-hooks-cart-checkout.md) — Cart item validation, fee items, estimated totals, checkout address fields, EU VAT/business rules.
43
+ - [filter-hooks-customers-subscriptions.md](references/filter-hooks-customers-subscriptions.md) — Customer portal tabs/endpoints, subscription statuses, grace periods, billing cycles, reminder schedules.
44
+ - [filter-hooks-integrations-advanced.md](references/filter-hooks-integrations-advanced.md) — Integration feeds, S3/local file storage, template paths, dashboard widgets, list filter queries, e-invoicing.
45
+
46
+ #### Core Architecture & System References
47
+ - [fluentcart-developer-guide.md](references/fluentcart-developer-guide.md) — Comprehensive developer guide, core concepts, codebase directory layout, and version comparison.
48
+ - [database-schema-reference.md](references/database-schema-reference.md) — Complete database schema for all `wp_fct_*` tables.
49
+ - [database-models-reference.md](references/database-models-reference.md) — FluentCart Eloquent Models, relationships, and scopes across Core and Pro modules.
50
+ - [database-models-query-builder.md](references/database-models-query-builder.md) — FluentCart ORM Query Builder usage, aggregates, CRUD operations, and comprehensive model map.
51
+ - [rest-api-reference.md](references/rest-api-reference.md) — Full REST API endpoints index, authentication, request/response formats.
52
+ - [rest-api-overview.md](references/rest-api-overview.md) — REST API getting started, authentication standards, module catalog, permission system (32 permissions across 4 roles), and error handling.
53
+ - [rest-api-orders.md](references/rest-api-orders.md) — Orders REST API (22 endpoints): CRUD, calculate shipping, bulk actions, refunds, customer reassignment, dispute handling, transactions.
54
+ - [rest-api-products.md](references/rest-api-products.md) — Products REST API (59 endpoints): CRUD, pricing, search/lookup, bulk operations, duplicate, bundle info, upgrade paths, inventory, downloadables, variations, integrations.
55
+ - [rest-api-customers.md](references/rest-api-customers.md) — Customers REST API (18 endpoints): CRUD, additional info (labels), bulk actions, order history, LTV recalculation, address management, WP user association.
56
+ - [rest-api-coupons.md](references/rest-api-coupons.md) — Coupons REST API (12 endpoints): CRUD, paginated listing, apply/cancel/reapply, product eligibility, checkout settings, Coupon model & DB table reference.
57
+ - [rest-api-subscriptions.md](references/rest-api-subscriptions.md) — Subscriptions REST API (17 endpoints): Admin lifecycle (cancel, remote fetch, early payment links), Customer Portal self-service (payment updates, gateway switching, auto-renew cancellation), status constants, and hooks.
58
+ - [rest-api-tax.md](references/rest-api-tax.md) — Tax REST API (26 endpoints): Tax filing, tax classes, country rates, shipping/product category overrides, global tax settings, and EU VAT / OSS cross-border compliance.
59
+ - [rest-api-shipping.md](references/rest-api-shipping.md) — Shipping REST API (15 endpoints, `store/sensitive` permission): Shipping zones (region reset side effects, reordering), shipping methods (`flat_rate`, `free_shipping`, `local_pickup`, state scoping), shipping classes (`fixed` & `percentage` costs, `per_item` flags), and data models.
60
+ - [rest-api-settings.md](references/rest-api-settings.md) — Settings REST API (30 endpoints, `StoreSettingsPolicy` & `is_super_admin`): Gateway setup (Stripe, PayPal connect, reordering, designs, addons), PayPal OAuth & webhooks, store configuration (`FluentMetaRequest`), module toggles, permissions, confirmation shortcodes, storage drivers (S3, Bunny, Local), and checkout fields.
61
+ - [rest-api-email-notifications.md](references/rest-api-email-notifications.md) — Email Notifications REST API (11 endpoints, `store/sensitive` permission): Email templates catalog (order, subscription, scheduler), single template editor shortcodes, template HTML previews (custom & default PHP), global email sender configuration, and automated scheduling reminders.
62
+ - [rest-api-reports.md](references/rest-api-reports.md) — Reports API (45 endpoints, `ReportPolicy` & `reports/view` permission): Standard report parameters, YoY revenue overview, sales growth, quick stats, revenue/orders by grouping dimensions, day/hour heatmap, top products/variants, refund analytics, software license metrics, subscription MRR & cohort retention matrices, Action Scheduler snapshot generation, and UTM source attribution.
63
+ - [rest-api-integrations.md](references/rest-api-integrations.md) — Integrations API (17 endpoints, `IntegrationPolicy` & `ProductPolicy`): Addon listings & WP.org auto-installer, global provider credentials, global integration feeds, list merge field mapping, dynamic options & chained inputs, product-level integration feeds (`conditional_variation_ids`), and status toggles.
64
+ - [rest-api-files.md](references/rest-api-files.md) — Files API (5 endpoints, `StoreSensitivePolicy` & `AdminPolicy`): Downloadable file CRUD across storage drivers (Local, S3, Bunny, R2), timestamp collision prevention (`name__fluent-cart__.timestamp.ext`), blocked extension filters (`fluent_cart/local_file_blocked_extensions`), storage bucket lists, and WP Media Library editor image uploads (`media_handle_upload`).
65
+ - [rest-api-labels-attributes.md](references/rest-api-labels-attributes.md) — Labels & Attributes API (13 endpoints, `LabelPolicy` & `ProductPolicy`): Polymorphic order/customer labels (`LabelRequest`, `update-label-selections`), variation attribute groups (`AttrGroupRequest`, deletion guards), and attribute terms (`AttrTermRequest`, serial ordering).
66
+ - [rest-api-dashboard-utilities.md](references/rest-api-dashboard-utilities.md) — Dashboard & Utilities API (20 endpoints): Onboarding checklist wizard, 30-day dashboard stats widgets, page generator (`CreatePageRequest`), admin SPA init (`/app/init`), activity log (`/activity`), order notes, print HTML templates (invoices & slips), dynamic widgets, country address locales, and advanced filter options.
67
+ - [rest-api-public-shop.md](references/rest-api-public-shop.md) — Public Shop API (3 endpoints, `PublicPolicy` unauthenticated): Public catalog product browsing with taxonomy/price filters (cents pricing in `detail`), server-rendered HTML grid views for Gutenberg blocks & shortcodes (`ProductListRenderer`, transient block caching), and live search autocomplete (`SearchBarRenderer`).
68
+ - [rest-api-checkout.md](references/rest-api-checkout.md) — Checkout API (7 endpoints, `PublicPolicy`): Order placement (`place-order`, rate limit 5 req/60s), gateway UI configuration (`get-order-info`), cart summary calculation with shipping (`get-checkout-summary-view`), shipping availability (`get-available-shipping-methods` & list view), country locale rules (`get-country-info`), and customer login (`/user/login` with `X-WP-Nonce`).
69
+ - [rest-api-customer-profile.md](references/rest-api-customer-profile.md) — Customer Profile API (18 endpoints, `CustomerFrontendPolicy` authenticated): Portal dashboard overview, profile details & password updates, checkout address selector (`fct_cart_hash`), portal address management (guards against deleting primary/last address), order history & UUID details, plan upgrade paths & prorations, transaction invoice billing address editing (`vat_tax_id`), and signed digital file downloads.
70
+ - [rest-api-licensing.md](references/rest-api-licensing.md) — Licensing API (22 endpoints, `LicensePolicy` & Pro required): Admin software license CRUD, key regeneration, validity extensions (`lifetime` or `YYYY-MM-DD`), per-product variation validity rules (disabled for bundles), customer portal self-service activations, site Pro plugin licensing, and non-REST public software update API (`/?fluent-cart={action}`) with 48-hour signed package download tokens & staging auto-detection.
71
+ - [rest-api-roles-permissions.md](references/rest-api-roles-permissions.md) — Roles & Permissions API (7 endpoints, `AdminPolicy` & Pro required): List managers, user search (excluding WP admins), role definitions (`super_admin`, `manager`, `worker`, `accountant`), role assignment sync (`fluent_cart_admin`), role deletion, and capability matrix filters (`fluent_cart/permission/all_roles`).
72
+ - [rest-api-order-bumps.md](references/rest-api-order-bumps.md) — Order Bumps API (5 endpoints, `OrderBumpPolicy` & `store/sensitive` & Pro required): Checkout order bump promotion CRUD (`fct_order_promotions` table), `product_variant` eager loading, discount configuration (`percentage` vs `fixed` in cents), priority ordering, and cart condition rules.
73
+ - [modules-and-extensions-reference.md](references/modules-and-extensions-reference.md) — Building payment gateways, shipping carriers, fee surcharges, ghost products.
74
+ - [engineering-notes.md](references/engineering-notes.md) — Architecture decisions, performance work, and production lessons from FluentCart's core engineering team.
75
+
76
+ #### Tutorials & Implementation Guides
77
+ - [fee-system-guide.md](references/fee-system-guide.md) — Fee system (surcharges & additional charges), dynamic fees via filter, persistent fees via Cart methods, complete tiered fee addon example.
78
+ - [ghost-product-selling.md](references/ghost-product-selling.md) — Ghost product selling, custom cart items, validation hooks, quantity changes, checkout validation, admin order updates, sample datasets.
79
+ - [payment-gateway-integration.md](references/payment-gateway-integration.md) — Payment Methods module architecture, custom gateway development (gateway class, settings, API, webhooks), registration, processing flow, testing.
80
+ - [paddle-gateway-case-study.md](references/paddle-gateway-case-study.md) — Paddle payment gateway case study, settings field schema, real-world gateway implementation example.
81
+ #### Runnable Code Examples & Project Boilerplates (`examples/`)
82
+ - [examples/README.md](examples/README.md) — Inventory and developer guide for ready-to-use sample plugins and templates.
83
+ - [sample-custom-addon/fluentcart-custom-addon.php](examples/sample-custom-addon/fluentcart-custom-addon.php) — Complete starter plugin with hook handlers, custom order meta, system logging, fee filters, and custom REST API endpoint.
84
+ - [sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php](examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php) — Dynamic conditional fee surcharges (cents calculations, percentage payment surcharges).
85
+ - [sample-custom-payment-gateway/fluentcart-custom-gateway-example.php](examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php) — Complete custom payment gateway implementation extending `AbstractPaymentGateway` and `BaseGatewaySettings`.
86
+ - [sample-shipping-carrier/fluentcart-custom-shipping-carrier.php](examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php) — Dynamic shipping carrier calculation filter callback example.
87
+ - [fluentcart-starter-child-theme/](examples/fluentcart-starter-child-theme/) — Starter child theme with `add_theme_support('fluent_cart')` and template override structure.
88
+
89
+ ---
90
+
91
+ ## 📜 Core Technical Rules & Conventions
92
+
93
+ ### 1. Monetary Values & Currency Storage
94
+ - **ALWAYS store and calculate monetary values as integers in CENTS** (e.g. `$10.00` = `1000`, `$19.99` = `1999`).
95
+ - Convert decimal inputs to cents before saving: `\FluentCart\App\Helpers\Helper::toCent($decimalAmount)`.
96
+ - Format cents into decimal string for display: `\FluentCart\App\Helpers\Helper::toDecimal($amountInCents)`.
97
+
98
+ ### 2. Code Commenting Standards
99
+ - **ALWAYS add meaningful single-line explanatory comments to PHP code snippets** (above/inside hook callbacks and helper calls) so developers can easily understand the logic.
100
+
101
+ ### 3. Asynchronous Post-Payment Tasks
102
+ - **NEVER** perform blocking API calls (CRMs, webhooks, external emails) synchronously inside payment execution loops.
103
+ - Use `fluent_cart/order_paid_done` or Action Scheduler for asynchronous background processing.
104
+
105
+ ### 4. Database Access
106
+ - Use FluentCart Eloquent Models (`\FluentCart\App\Models\*`) rather than raw `$wpdb` queries whenever possible.
107
+
108
+ ### 5. IoC Container & Global Helpers
109
+ - Access container services: `\FluentCart\App\App::make('cart')` or `\FluentCart\App\App::getInstance()`.
110
+ - Store configuration: `\FluentCart\App\Helpers\Helper::getStoreSettings()`.
111
+ - Default store currency: `\FluentCart\App\Helpers\Helper::getCurrency()`.
112
+ - System logging: `fluent_cart_add_log($title, $content, $type)` (`'info'`, `'error'`, `'warning'`).
113
+
114
+ ---
115
+
116
+ ## 🛠 Extension Code Templates
117
+
118
+ ### 1. Extension Plugin Boilerplate
119
+ ```php
120
+ <?php
121
+ /**
122
+ * Plugin Name: Custom FluentCart Addon
123
+ * Description: Custom extension for FluentCart.
124
+ * Version: 1.0.0
125
+ * Author: Developer
126
+ */
127
+
128
+ if (!defined('ABSPATH')) {
129
+ exit;
130
+ }
131
+
132
+ // Guard execution until WordPress plugins are loaded and FluentCart is active
133
+ add_action('plugins_loaded', function () {
134
+ if (!defined('FLUENT_CART')) {
135
+ return; // FluentCart is not active
136
+ }
137
+
138
+ // Initialize custom hook listeners and extension logic
139
+ });
140
+ ```
141
+
142
+ ### 2. Surcharge / Extra Fee Filter Pattern
143
+ ```php
144
+ // Add custom handling fee to cart estimated total
145
+ add_filter('fluent_cart/fee_items', function ($fees, $cart) {
146
+ // Append $5.00 handling fee (500 cents)
147
+ $fees[] = [
148
+ 'id' => 'handling_fee',
149
+ 'title' => __('Special Handling Fee', 'my-extension'),
150
+ 'amount' => 500, // Amount in cents
151
+ 'taxable' => false,
152
+ ];
153
+ return $fees;
154
+ }, 10, 2);
155
+ ```
156
+
157
+ ### 3. Order Paid Event Listener Pattern
158
+ ```php
159
+ // Listen for completed order payments to trigger post-payment processing
160
+ add_action('fluent_cart/order_paid_done', function ($data) {
161
+ // Extract order model and customer model instances from payload
162
+ $order = $data['order'];
163
+ $customer = $data['customer'];
164
+
165
+ // Log order completion event to FluentCart logs
166
+ fluent_cart_add_log(
167
+ 'Order Completed',
168
+ 'Processed order #' . $order->id . ' for customer ' . $customer->email,
169
+ 'info'
170
+ );
171
+ }, 10, 1);
172
+ ```
@@ -1,25 +1,25 @@
1
- # FluentCart Developer Examples & Boilerplates
2
-
3
- This directory contains production-ready code examples, runnable plugins, and project templates for extending FluentCart.
4
-
5
- ## Available Examples
6
-
7
- ### 1. Custom Starter Addon Plugin (`sample-custom-addon/fluentcart-custom-addon.php`)
8
- - Standalone WordPress plugin boilerplate for FluentCart.
9
- - Features: Plugin initialization guards, `order_paid_done` event listener, system logging, dynamic fee surcharges, and a custom REST API endpoint (`/wp-json/fc-custom/v1/order-status/{id}`).
10
-
11
- ### 2. Fee & Surcharge Plugin (`sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php`)
12
- - Dynamic cart fee calculations using the `fluent_cart/fee_items` filter.
13
- - Features: Conditional fixed fees (cents), percentage-based payment surcharges, and taxable flag settings.
14
-
15
- ### 3. Custom Payment Gateway Plugin (`sample-custom-payment-gateway/fluentcart-custom-gateway-example.php`)
16
- - Demonstrates custom payment gateway development extending `AbstractPaymentGateway` and `BaseGatewaySettings`.
17
- - Features: Gateway registration, settings schema, payment execution, error responses, and refund handling.
18
-
19
- ### 4. Custom Shipping Carrier (`sample-shipping-carrier/fluentcart-custom-shipping-carrier.php`)
20
- - Dynamic shipping calculation via the `fluent_cart/shipping/methods` filter hook.
21
- - Features: Rate calculation, free shipping thresholds, and real-time carrier response arrays.
22
-
23
- ### 5. Starter Child Theme (`fluentcart-starter-child-theme/`)
24
- - Declarative `add_theme_support('fluent_cart')` child theme template.
25
- - Features: Overriding checkout templates in `fluent-cart/checkout.php` and custom checkout hooks in `functions.php`.
1
+ # FluentCart Developer Examples & Boilerplates
2
+
3
+ This directory contains production-ready code examples, runnable plugins, and project templates for extending FluentCart.
4
+
5
+ ## Available Examples
6
+
7
+ ### 1. Custom Starter Addon Plugin (`sample-custom-addon/fluentcart-custom-addon.php`)
8
+ - Standalone WordPress plugin boilerplate for FluentCart.
9
+ - Features: Plugin initialization guards, `order_paid_done` event listener, system logging, dynamic fee surcharges, and a custom REST API endpoint (`/wp-json/fc-custom/v1/order-status/{id}`).
10
+
11
+ ### 2. Fee & Surcharge Plugin (`sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php`)
12
+ - Dynamic cart fee calculations using the `fluent_cart/fee_items` filter.
13
+ - Features: Conditional fixed fees (cents), percentage-based payment surcharges, and taxable flag settings.
14
+
15
+ ### 3. Custom Payment Gateway Plugin (`sample-custom-payment-gateway/fluentcart-custom-gateway-example.php`)
16
+ - Demonstrates custom payment gateway development extending `AbstractPaymentGateway` and `BaseGatewaySettings`.
17
+ - Features: Gateway registration, settings schema, payment execution, error responses, and refund handling.
18
+
19
+ ### 4. Custom Shipping Carrier (`sample-shipping-carrier/fluentcart-custom-shipping-carrier.php`)
20
+ - Dynamic shipping calculation via the `fluent_cart/shipping/methods` filter hook.
21
+ - Features: Rate calculation, free shipping thresholds, and real-time carrier response arrays.
22
+
23
+ ### 5. Starter Child Theme (`fluentcart-starter-child-theme/`)
24
+ - Declarative `add_theme_support('fluent_cart')` child theme template.
25
+ - Features: Overriding checkout templates in `fluent-cart/checkout.php` and custom checkout hooks in `functions.php`.
@@ -1,32 +1,32 @@
1
- <?php
2
- /**
3
- * FluentCart Custom Checkout Template Override Example
4
- *
5
- * Place this file inside your theme directory at:
6
- * [your-theme]/fluent-cart/checkout.php
7
- */
8
-
9
- if (!defined('ABSPATH')) {
10
- exit; // Prevent direct execution
11
- }
12
-
13
- // Trigger pre-checkout wrapper action hook
14
- do_action('fluent_cart/checkout/before_container');
15
- ?>
16
-
17
- <!-- Custom Theme Wrapper Container -->
18
- <div class="fc-theme-checkout-container fc-custom-checkout-wrapper">
19
- <div class="fc-checkout-header">
20
- <h1><?php esc_html_e('Complete Your Order', 'fluentcart'); ?></h1>
21
- <p><?php esc_html_e('Please enter your billing and shipping details below.', 'fluentcart'); ?></p>
22
- </div>
23
-
24
- <!-- Render Core FluentCart Checkout Shortcode App Instance -->
25
- <div class="fc-checkout-app-box">
26
- <?php echo do_shortcode('[fluent_cart_checkout]'); ?>
27
- </div>
28
- </div>
29
-
30
- <?php
31
- // Trigger post-checkout wrapper action hook
32
- do_action('fluent_cart/checkout/after_container');
1
+ <?php
2
+ /**
3
+ * FluentCart Custom Checkout Template Override Example
4
+ *
5
+ * Place this file inside your theme directory at:
6
+ * [your-theme]/fluent-cart/checkout.php
7
+ */
8
+
9
+ if (!defined('ABSPATH')) {
10
+ exit; // Prevent direct execution
11
+ }
12
+
13
+ // Trigger pre-checkout wrapper action hook
14
+ do_action('fluent_cart/checkout/before_container');
15
+ ?>
16
+
17
+ <!-- Custom Theme Wrapper Container -->
18
+ <div class="fc-theme-checkout-container fc-custom-checkout-wrapper">
19
+ <div class="fc-checkout-header">
20
+ <h1><?php esc_html_e('Complete Your Order', 'fluentcart'); ?></h1>
21
+ <p><?php esc_html_e('Please enter your billing and shipping details below.', 'fluentcart'); ?></p>
22
+ </div>
23
+
24
+ <!-- Render Core FluentCart Checkout Shortcode App Instance -->
25
+ <div class="fc-checkout-app-box">
26
+ <?php echo do_shortcode('[fluent_cart_checkout]'); ?>
27
+ </div>
28
+ </div>
29
+
30
+ <?php
31
+ // Trigger post-checkout wrapper action hook
32
+ do_action('fluent_cart/checkout/after_container');
@@ -1,40 +1,40 @@
1
- <?php
2
- /**
3
- * Child Theme Functions for FluentCart Compatibility
4
- *
5
- * Theme Name: FluentCart Starter Child Theme
6
- * Author: Fastrsoft
7
- * License: MIT
8
- */
9
-
10
- if (!defined('ABSPATH')) {
11
- exit; // Exit if accessed directly
12
- }
13
-
14
- // 1. Declare FluentCart Theme Support in Child Theme
15
- add_action('after_setup_theme', function() {
16
- // Enables template overriding and page detection in FluentCart
17
- add_theme_support('fluent_cart');
18
- });
19
-
20
- // 2. Enqueue Custom Child Theme & FluentCart Styling Assets
21
- add_action('wp_enqueue_scripts', function() {
22
- // Enqueue parent theme stylesheet
23
- wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
24
-
25
- // Enqueue custom FluentCart store overrides stylesheet
26
- wp_enqueue_style(
27
- 'fluentcart-child-custom',
28
- get_stylesheet_directory_uri() . '/fluent-cart-custom.css',
29
- ['parent-style'],
30
- '1.0.0'
31
- );
32
- });
33
-
34
- // 3. Example Hook: Inject Custom Notice above Checkout Form
35
- add_action('fluent_cart/checkout/before_form', function() {
36
- // Output custom customer guarantee banner on checkout page
37
- echo '<div class="fluentcart-custom-notice" style="background:#eef6ff; border:1px solid #b6d4fe; padding:12px; margin-bottom:20px; border-radius:6px;">';
38
- echo '🔒 <strong>100% Secure Checkout Guarantee:</strong> Your data is protected by 256-bit SSL encryption.';
39
- echo '</div>';
40
- });
1
+ <?php
2
+ /**
3
+ * Child Theme Functions for FluentCart Compatibility
4
+ *
5
+ * Theme Name: FluentCart Starter Child Theme
6
+ * Author: Fastrsoft
7
+ * License: MIT
8
+ */
9
+
10
+ if (!defined('ABSPATH')) {
11
+ exit; // Exit if accessed directly
12
+ }
13
+
14
+ // 1. Declare FluentCart Theme Support in Child Theme
15
+ add_action('after_setup_theme', function() {
16
+ // Enables template overriding and page detection in FluentCart
17
+ add_theme_support('fluent_cart');
18
+ });
19
+
20
+ // 2. Enqueue Custom Child Theme & FluentCart Styling Assets
21
+ add_action('wp_enqueue_scripts', function() {
22
+ // Enqueue parent theme stylesheet
23
+ wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
24
+
25
+ // Enqueue custom FluentCart store overrides stylesheet
26
+ wp_enqueue_style(
27
+ 'fluentcart-child-custom',
28
+ get_stylesheet_directory_uri() . '/fluent-cart-custom.css',
29
+ ['parent-style'],
30
+ '1.0.0'
31
+ );
32
+ });
33
+
34
+ // 3. Example Hook: Inject Custom Notice above Checkout Form
35
+ add_action('fluent_cart/checkout/before_form', function() {
36
+ // Output custom customer guarantee banner on checkout page
37
+ echo '<div class="fluentcart-custom-notice" style="background:#eef6ff; border:1px solid #b6d4fe; padding:12px; margin-bottom:20px; border-radius:6px;">';
38
+ echo '🔒 <strong>100% Secure Checkout Guarantee:</strong> Your data is protected by 256-bit SSL encryption.';
39
+ echo '</div>';
40
+ });