Goal
Add per-order action buttons to the customer’s My Orders screen:
- Cancel Order — sends a cancellation request (message + order) into the suite’s cancel pipeline.
- Feedback — saves the customer’s comments on a completed order and notifies the site administrators.
- Request Refund — opens a refund-request form on eligible orders, showing the amount the policy allows.
Each action is backed by a Gravity Form you create and then map in Mobile App Manager → Forms Manager.
Before you start
mam-woocommerce, MAM Main, and Gravity Forms are active.- You know how to build a basic Gravity Form (see the Gravity Forms Manager recipes).
Step 1 — Build the three Gravity Forms
Each form needs fields the plugin can map. Use simple field types (text/textarea/hidden):
| Form | Fields to create |
|---|---|
| Cancel Order Form | Message (the customer’s reason), postid (hidden — the order id) |
| Feedback Form | Comments, Post ID (hidden) |
| Refund Form | Refund Reason, Order ID (hidden), optionally an HTML field — the plugin overwrites its label with the calculated refund amount (“Refund amount: $…”) |
Step 2 — Map the forms in Forms Manager
- Go to Mobile App Manager → Forms Manager and open the Field Settings tab.
- Find the Cancel Order Form, Refund Form, and Feedback Form rows (registered there by mam-woocommerce).
- Pick your Gravity Form in each dropdown and save; field-mapping dropdowns then appear under each — map each declared field (Message/postid etc.) to the matching GF field and save again.
Step 3 — Set the refund policy (Refund tab)
On Mobile App Manager → WooCommerce → Refund:
| Setting | Choices | What it controls |
|---|---|---|
| Allow Refunds | Yes / No | Master switch for the refund button. |
| Refund Type | After Order Placed / Before Order Delivery Date | With Before Order Delivery Date, the button only shows until the order’s completion date. |
| Refund with no cancellation fee (Number of days) | number | Window after completion in which the full amount is offered. |
| Refund with cancellation fee (Number of days) | number | Window in which a reduced amount is offered. |
| Refund with cancellation fee (Amount of refund – % refunded) | number | The percentage refunded inside the fee window. |
These are stored per user role (currently saved for the customer role — keys like tsl-setting-allow_refunds_customer).
Step 4 — Test in the app
Place a test order, then check the order in My Orders:
- Cancel Order appears while WooCommerce itself considers the order cancellable (same rule as the website’s My Account page). The button also requires the order row to carry a vendor — i.e. MAM WooCommerce Product Vendors is active — as cancellation processing is handled there.
- Feedback appears on Completed orders.
- Request Refund appears on Processing orders that pass the refund policy above.
What happens on submission
- Cancel: the plugin verifies the submitting user owns the order, then fires the
mam_wc_cancel_orderaction withorder_id,message, andpartial_amount. The actual status change/refund is performed by the listener — MAM WooCommerce Product Vendors handles it on vendor stores (including the card refund viamam_pmt_refund_card). Without a listener, the request is recorded but nothing changes. - Feedback: comments are sanitized and appended to the order’s
order_feedbackmeta, and anorder-feedbacknotification (with the comments, order id, and customer name) is sent to every administrator. Customize that message under the suite’s notification settings. - Refund request: the button and the amount preview are driven by the policy settings. Note: as of 26.19.3 the refund form’s submission is not routed to a handler in this plugin (a long-unused legacy path was removed); actual refunds run through the cancel-order flow or store-side processing. If you rely on the refund form, treat it as a request-collection form and process refunds from wp-admin.
All three actions are authorization-checked server-side: the submitting app user must own the order (store managers always pass). See Hook: the `mam_wc_usercan` authorization filters* for the escape hatches.
Related articles
- Plugin: mam-woocommerce
- Hook:
mam_wc_is_refund_allowed - Hook: the `mam_wc_usercan` authorization filters*
- Recipe: Add a Gravity Form to your app (mam-gravity-forms-manager)
Metadata
| Field | Value |
|---|---|
| Article type | Recipe (Admin) |
| Plugin slug | mam-woocommerce |
| Applies to plugin version | 26.19.3+ |
| Category | Building Your App |
| Audience | WordPress admin |
| Estimated time | 20 minutes |
| Last verified | 2026-06-10 |
