Action
rpress_update_edited_purchase
On this page
Fires after cart items have been updated on the edit order screen, before the rest of the order is saved.
Runs while the order details form is being processed, after menu items have been added, modified or removed and before the customer, totals, date and status are written. Use it to apply your own changes from the submitted form.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$payment_id | int | The order (payment) ID. |
Example#
function my_before_order_saved( $payment_id ) {
if ( isset( $_POST['my_kitchen_note'] ) ) {
update_post_meta( $payment_id, 'my_kitchen_note', sanitize_textarea_field( wp_unslash( $_POST['my_kitchen_note'] ) ) );
}
}
add_action( 'rpress_update_edited_purchase', 'my_before_order_saved' );
Notes#
The nonce and capability checks have already passed when this runs. Fires on every save of the form, whether or not items changed.
Source#
Fired from:
includes/admin/payments/actions.php(line 188), inrpress_update_payment_details()
See also#
Was this page helpful?
