Is there a way to upload an image before checkout completion without a plugin? Is there a way to upload an image before checkout completion without a plugin? ajax ajax

Is there a way to upload an image before checkout completion without a plugin?


You need to call below function in your child theme.

function add_image($order_id){  // Do your code of upload image.} add_action( 'woocommerce_checkout_order_processed', 'add_image',  1, 1  );


Woocommerce checkout will always happens via Ajax ( I am not sure from what version it's been like this )

PLUGIN-DIR/woocommerce/assets/frontend/checkout.js this is the file which is responsible for the checkout action.

So uploading files from checkout page is not possible unless you intended to modify the checkout.js file by yourself.

If you still prefer uploading file from checkout page, you may refer this answer.


Have you given a look at Advanced Custom Field? https://www.advancedcustomfields.com/

You can easily achieve what you are trying to do.

Have a look at this https://www.advancedcustomfields.com/resources/acfupload_prefilter/