Bank Transfer Confirmation Form

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 11 reply threads
  • Author
    Posts
    • #37022
      Mustafa
      Participant

      Hi,

      Can you add Bank Transfer Confirmation Form? (An Upload field with transaction id or something)
      The intent is to let customer upload their receipt once payment completed and then vendors can be notified to start process customer’s order.

      Thank you

    • #37188
      WCFM Forum
      Member

      Hi,

      PFA, code snippet for allowing customer to add not and attachment for their orders.

      Hope this will helpful for you.

      Thank You

    • #37189
      WCFM Forum
      Member

      Here is your code –

      /********my account order details page custom field*********/
      add_action( 'woocommerce_view_order', 'customer_view_order_and_thankyou_page', 20 );
      function customer_view_order_and_thankyou_page( $order_id ) {
      ?>
          <h2>Add your note</h2>
          <form action="" method="POST" enctype="multipart/form-data">
      	    <table class="woocommerce-table">
      	        <tbody>
      	            <tr>
      	                <th>Add Note</th>
      	                <td><textarea name="cus_add_note" id="cus_add_note"></textarea></td>
      	            </tr>
      	            <tr>
      	                <th>Upload File</th>
      	                <td><input type="file" name="cus_add_note_file" id="cus_add_note_file"></td>
      	            </tr>
      	            <tr>
      	                <td colspan="2"><input type="submit" name="cus_note_submit" id="cus_note_submit" value="Submit"></td>
      	            </tr>
      	        </tbody>
      	    </table>
      	</form>
      <?php
      	//note and attachment submit code
      	if ( isset( $_POST['cus_note_submit'] ) ) {
      		if ( $_FILES ) {
      			if ( ! function_exists( 'wp_handle_upload' ) ) {
      			    require_once( ABSPATH . 'wp-admin/includes/file.php' );
      			}
      			$uploadedfile = $_FILES['cus_add_note_file'];
      			$upload_overrides = array( 'test_form' => false );
      			$movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
      			$final_note = '';
      			$order = wc_get_order(  $order_id );
      			if ( !empty( $_POST['cus_add_note'] ) ) {
      				$final_note .= $_POST['cus_add_note'];
      			}
      			if ( $movefile && ! isset( $movefile['error'] ) ) {
      			    echo "File is valid, and was successfully uploaded.\n";
      					if ( !empty( $movefile['url'] ) ) {
      					$final_note .= '<p><a target="_blank" href ="' . $movefile['url'] . '">See Attachment</a></p>';
      				}
      			}
      			// Add the note
      			$order->add_order_note( $final_note );
      			// Save the data
      			$order->save();
      		}
      	}
      }
      

      Thank You

    • #37223
      Mustafa
      Participant

      You guys are awesome!

      I have two comments:
      1) How can I restrict this note/file to only orders with payment method “bank transfer”?
      2) How to show the note/file in the order page after it is submitted by the customer? So customer can see that their note was sent and they can review it. (This is very important)
      3) How to restrict file upload to only (Images+PDF)?

      If all above is done, then that will be great 🙂

    • #37270

      Hi,
      Please remove the previous code and add the code in the file shared below.

      File Link: https://drive.google.com/open?id=1yewOjE7MgK2D-kVnEyPafa1BcKmSanaq

      Thanks,

    • #37324
      Mustafa
      Participant

      Hi,

      Thanks Sayan! It works fine except there is two things:

      1) Even private notes by vendors are displayed to customers.
      2) Vendors don’t get notification once customer added their note

    • #37325
      Mustafa
      Participant

      One more thing, does the file upload counts agains vendors storage quota?

    • #37326
      WCFM Forum
      Member

      HI,

      1) Even private notes by vendors are displayed to customers.
      2) Vendors don’t get notification once customer added their note

      – I am checking this.

      One more thing, does the file upload counts agains vendors storage quota?

      – Off course not.

      Thank You

    • #37492

      Hi,
      1) Even private notes by vendors are displayed to customers.
      2) Vendors don’t get notification once customer added their note

      Both the above points have been integrated. Remove all the previous codes and add the code from the new file link given below.

      File Link: https://drive.google.com/open?id=1OXWCh6sxc1cPccPDJhSBiBQR0FtBUsge

      Thanks

    • #37958
      Mustafa
      Participant

      Hi,

      1) It works only if I submit text with attachment. Why I cannot just add text notes without attachment?
      2) Vendors still don’t get notified for customer note additions.
      3) Notes displaying is not visually appealing in both location (Vendor Dashboard & Order Details). Please, put them is cells like design or in a table.
      4) Please, add one column for who submitted this note (In both location Vendor Dashboard & Order Details).

      Thank you

    • #38101

      Hi,
      Sorry for the delay, I’ve fixed all the issue you mentioned.

      1) It works only if I submit text with attachment. Why I cannot just add text notes without attachment? (Fixed, the text field is mandatory now)
      2) Vendors still don’t get notified for customer note additions. (Fixed)
      3) Notes displaying is not visually appealing in both location (Vendor Dashboard & Order Details). Please, put them is cells like design or in a table. (Done, an extra column is added for displaying the date and user name who added the note.)
      4) Please, add one column for who submitted this note (In both location Vendor Dashboard & Order Details). (If the user is vendor or admin then the user name will be shown but if the customer adds a note then his/her name will not be shown as woocommerce doesn’t save customers name for order notes)

      The new code link is shared below, please add this code instead of the previous one.
      Code Link: https://drive.google.com/open?id=1KhO5j37hkVYh0Tc1I0nMbaEnyQiPbmeY

      Thanks

    • #38338
      Mustafa
      Participant

      Thank you Naskar!

Viewing 11 reply threads
  • The topic ‘Bank Transfer Confirmation Form’ is closed to new replies.