Skip to content

Commit 8875495

Browse files
committed
Add documentation for woo_dynamic_coupon_created hook
Introduced a new markdown file detailing the 'fluent_crm/woo_dynamic_coupon_created' action hook, including its parameters and usage example. Updated the actions index to include a reference to this new documentation under 'Other Important Actions'.
1 parent 42b343c commit 8875495

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
</explain-block>
2+
3+
<explain-block title="fluent_crm/woo_dynamic_coupon_created">
4+
This action runs when a dynamically created coupon has been applied. This hook
5+
provides access to the created coupon object and related data, allowing for the
6+
programmatic addition of required metadata fields.
7+
8+
9+
10+
**Parameters**
11+
- `$createdCoupon` - WC_Coupon object
12+
- `$funnelMetric` - Funnel Metric Model
13+
- `$subscriber` - Subscriber Model
14+
- `$couponData` - Array of coupon data
15+
16+
**Usage:**
17+
```php
18+
add_action('fluent_crm/woo_dynamic_coupon_created', function($createdCoupon, $funnelMetric, $subscriber, $couponData) {
19+
// Do you staffs here
20+
});
21+
```
22+
</explain-block>

src/hooks/actions/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,7 @@ add_action('fluent_crm/contact_updated_by_fluentform', function($subscriber, $en
184184
}, 10, 4);
185185
```
186186
:::
187+
188+
### Other Important Actions
189+
<hr />
190+
!!!include(./src/hooks/actions/_others_important_hooks.md)!!!

0 commit comments

Comments
 (0)