1. Home
  2. Knowledge Base
  3. WooCommerce Review and Approve
  4. Advanced Topics for Review and Approve
  5. Require user to upload file initially from Account page
  1. Home
  2. Knowledge Base
  3. WooCommerce Review and Approve
  4. Require user to upload file initially from Account page

Require user to upload file initially from Account page

By default, the WooCommerce Review and Approve workflow expects the user to upload a file to a product page which then requires the admin to respond.

If you prefer, you can create a workflow which doesn’t expect a file from the user initially and which also bypasses the admin’s initial interaction with the placed order. This means that after checking out, the next stage in the process is for the user to upload a file from their Account page.

To enable this, you’ll need to add this snippet:

<?php
/**
* Automatically set order status to waiting for customer review when new order is placed
*/
function prefix_after_maybe_prevent_status_transition( $order, $from_status, $to_status, $order_has_workflow, $status_is_workflow, $waiting ) {
if( ! $status_is_workflow && $waiting !== "wc-$from_status" && $waiting !== "wc-$to_status" ) {
// Not already in a workflow, so a new order
$order->set_status( $waiting );
}
}
add_action( 'rawc_after_maybe_prevent_status_transition', 'prefix_after_maybe_prevent_status_transition', 10, 6 );
add_filter( 'rawc_allow_zero_files', '__return_true' );

This will allow a workflow to be initiated even when there are no files uploaded to the order and it will set the status of the order to ‘Waiting’ – meaning the customer is required to then upload their file to the Account page.

Was this article helpful?

Related Articles