@@VicodeMedia Like I want to upload multiple images at checkout page and also it can display all the images in order details in woocommerce order section.
Great tuturioal. Everything is clear. I try to limit the file size to 3MB without setting ini. I add validation function to hook: 'woocommerce_after_checkout_validation'. But I can't get the file size in other funcitons. I can only get file size in function vicode_file_upload(). Here is my code. Would you please kindly give me some idea? add_action( 'woocommerce_after_checkout_validation', 'my_checkout_validation'); function my_checkout_validation() { $extChecked = false; $sizeChecked = false; $allowedExts = array("gif", "jpeg", "jpg", "png"); if(!empty($_POST[ 'my_file_field'])){ $size = getimagesize(["my_file"]); //can't get size $extension = end(explode(".", $_POST[ 'my_file_field'])); $extChecked = in_array($extension, $allowedExts); if($size < 3000000){ $sizeChecked = true; } } if(!$extChecked || !$sizeChecked ){ wc_add_notice( 'Please select a picture(gif/jpeg/jpg/png)
@@VicodeMedia Hi Victor, I added some validation codes in the following function. But still can't get the size. /** * Validation **/ add_action('woocommerce_checkout_process', 'customised_checkout_field_process'); function customised_checkout_field_process(){
You are a master , thank you very much. that is very useful
After a long time!
i like ur content, u are so creative.
is possible to upload multiples files at once?
Great channel !
thank you so much!!!
How to Add the Two Upload Fields Like this.please help me
Hello i would like to ask if theres a shortcode or tags for this to be added on email notification
Hi! Do you mean to send the file as an attachment via email?
@@VicodeMedia i'd like to know how send it by email please, tnks bro 😀
how much you charge to do on my site?
But what about the multiple image upload and display the same at admin end ?
Can you be more specific please?
@@VicodeMedia Like I want to upload multiple images at checkout page and also it can display all the images in order details in woocommerce order section.
Does not work anymore? sad. Great content though
Have you tried the source code from the GitHub repository?
🄿🅁🄾🄼🄾🅂🄼 🙏
Great tuturioal. Everything is clear.
I try to limit the file size to 3MB without setting ini. I add validation function to hook: 'woocommerce_after_checkout_validation'.
But I can't get the file size in other funcitons. I can only get file size in function vicode_file_upload().
Here is my code. Would you please kindly give me some idea?
add_action( 'woocommerce_after_checkout_validation', 'my_checkout_validation');
function my_checkout_validation() {
$extChecked = false;
$sizeChecked = false;
$allowedExts = array("gif", "jpeg", "jpg", "png");
if(!empty($_POST[ 'my_file_field'])){
$size = getimagesize(["my_file"]); //can't get size
$extension = end(explode(".", $_POST[ 'my_file_field']));
$extChecked = in_array($extension, $allowedExts);
if($size < 3000000){
$sizeChecked = true;
}
}
if(!$extChecked || !$sizeChecked ){
wc_add_notice( 'Please select a picture(gif/jpeg/jpg/png)
Hi Jean!
Have you tried this:
if ($_FILES['fileToUpload']['size']
@@VicodeMedia Hi Victor, I added some validation codes in the following function. But still can't get the size.
/**
* Validation
**/
add_action('woocommerce_checkout_process', 'customised_checkout_field_process');
function customised_checkout_field_process(){
$extChecked = false;
if($_POST['vicode_file_field']){
$size1 = $_FILES[ 'vicode_file' ]['size']; //can't get size
$size2 = getimagesize(['vicode_file' ]); //can't get size
$allowedExts = array("gif", "jpeg", "jpg", "png");
$extension = end(explode(".", $_POST[ 'vicode_file_field']));
$extChecked = in_array($extension, $allowedExts);
}
if(1){
// if(!$extChecked || $size >2000000){
// wc_add_notice('Please select a picture(gif/jpeg/jpg/png) size
Hi Victor. I finally to get things done with adding the validation to the jQuery code. Thanks!