Upload File on WooCommerce Checkout Page

Поділитися
Вставка
  • Опубліковано 1 лис 2024

КОМЕНТАРІ • 21

  • @YTK-1234
    @YTK-1234 Рік тому +2

    You are a master , thank you very much. that is very useful

  • @bikramchettri9405
    @bikramchettri9405 2 роки тому +1

    After a long time!

  • @iilyaselmaliki
    @iilyaselmaliki 2 роки тому +1

    i like ur content, u are so creative.

  • @emanuelgomes5707
    @emanuelgomes5707 11 місяців тому +2

    is possible to upload multiples files at once?

  • @chafikamraoui3489
    @chafikamraoui3489 2 роки тому +1

    Great channel !

  • @darl550
    @darl550 Рік тому

    thank you so much!!!

  • @channelbunjy8653
    @channelbunjy8653 Рік тому

    How to Add the Two Upload Fields Like this.please help me

  • @pauljohnlabesores7845
    @pauljohnlabesores7845 Рік тому +1

    Hello i would like to ask if theres a shortcode or tags for this to be added on email notification

    • @VicodeMedia
      @VicodeMedia  Рік тому

      Hi! Do you mean to send the file as an attachment via email?

    • @darkdickito
      @darkdickito Рік тому

      @@VicodeMedia i'd like to know how send it by email please, tnks bro 😀

  • @Bestofthebestent
    @Bestofthebestent Рік тому

    how much you charge to do on my site?

  • @SoumyaRanjan-xp7mv
    @SoumyaRanjan-xp7mv 7 місяців тому

    But what about the multiple image upload and display the same at admin end ?

    • @VicodeMedia
      @VicodeMedia  7 місяців тому

      Can you be more specific please?

    • @SoumyaRanjan-xp7mv
      @SoumyaRanjan-xp7mv 7 місяців тому

      @@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.

  • @myrainys
    @myrainys 11 місяців тому

    Does not work anymore? sad. Great content though

    • @VicodeMedia
      @VicodeMedia  11 місяців тому

      Have you tried the source code from the GitHub repository?

  • @wadewells1742
    @wadewells1742 2 роки тому +1

    🄿🅁🄾🄼🄾🅂🄼 🙏

  • @jeanchen5654
    @jeanchen5654 2 роки тому +1

    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
      @VicodeMedia  2 роки тому

      Hi Jean!
      Have you tried this:
      if ($_FILES['fileToUpload']['size']

    • @jeanchen5654
      @jeanchen5654 2 роки тому

      @@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

    • @jeanchen5654
      @jeanchen5654 2 роки тому

      Hi Victor. I finally to get things done with adding the validation to the jQuery code. Thanks!