Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › Bank Transfer Confirmation Form
- This topic has 11 replies, 3 voices, and was last updated 5 years, 11 months ago by Mustafa.
- AuthorPosts
- November 18, 2018 at 7:09 pm #37022MustafaParticipant
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
- November 20, 2018 at 7:48 am #37188WCFM ForumMember
Hi,
PFA, code snippet for allowing customer to add not and attachment for their orders.
Hope this will helpful for you.
Thank You
- November 20, 2018 at 7:49 am #37189WCFM ForumMember
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
- November 20, 2018 at 11:25 am #37223MustafaParticipant
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 🙂
- November 20, 2018 at 2:05 pm #37270Sayan NaskarMember
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,
- November 20, 2018 at 7:16 pm #37324MustafaParticipant
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 - November 20, 2018 at 7:29 pm #37325MustafaParticipant
One more thing, does the file upload counts agains vendors storage quota?
- November 20, 2018 at 7:33 pm #37326WCFM ForumMember
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
- November 22, 2018 at 10:39 am #37492Sayan NaskarMember
Hi,
1) Even private notes by vendors are displayed to customers.
2) Vendors don’t get notification once customer added their noteBoth 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
- November 25, 2018 at 9:47 am #37958MustafaParticipant
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
- November 26, 2018 at 1:33 pm #38101Sayan NaskarMember
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=1KhO5j37hkVYh0Tc1I0nMbaEnyQiPbmeYThanks
- November 27, 2018 at 10:46 am #38338MustafaParticipant
Thank you Naskar!
- AuthorPosts
- The topic ‘Bank Transfer Confirmation Form’ is closed to new replies.