Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards

how can I upload files

MultivendorX

Resolved
Viewing 12 reply threads
  • Author
    Posts
    • #194206
      l.gan
      Participant

      Hello
      Sorry to worry.
      Please tell me how can I upload files (PDF, image or excel) + display a thumbnail of what is uploaded.

      I have the code, but it doesn’t work. Could you help me please?

      add_action( ‘mvx_after_shop_front’, ‘extra_setting_fields’ );
      /*form for vendor dashboard set field*/
      function extra_setting_fields() {
      global $MVX;
      $vendor_id = get_current_vendor_id();

      $sertifikat_sootv = ”;
      $sertifikat_sootv = get_user_meta($vendor_id, ‘_sertifikat_sootv’, true) ? get_user_meta($vendor_id, ‘_sertifikat_sootv’, true) : $sertifikat_sootv;
      $otkaz_pismo = ”;
      $otkaz_pismo = get_user_meta($vendor_id, ‘_otkaz_pismo’, true) ? get_user_meta($vendor_id, ‘_otkaz_pismo’, true) : $otkaz_pismo;
      ?>

      <div class=”panel panel-default pannel-outer-heading”>
      <div class=”panel-heading d-flex”>
      <h3><?php _e(”, ‘multivendorx’); ?></h3>
      </div>
      <div class=”panel-body panel-content-padding form-horizontal”>
      <div class=”mvx_media_block”>

      <div class=”panel panel-default pannel-outer-heading”>
      <div class=”panel-heading d-flex”>
      <h3><?php _e(‘Quality certificates’, ‘multivendorx’); ?></h3>
      </div>
      <div class=”panel-body panel-content-padding form-horizontal”>
      <div class=”mvx_media_block”>
      <div class=”form-group”>
      <label class=”control-label col-sm-3 col-md-3″><?php _e(”, ‘multivendorx’); ?></label>
      <div class=”col-md-6 col-sm-9″>
      <input type=”file” name=”_sertifikat_sootv” multiple />
      </div>
      </div>
      <div class=”form-group”>
      <label class=”control-label col-sm-3 col-md-3″><?php _e(”, ‘multivendorx’); ?></label>
      <div class=”col-md-6 col-sm-9″>

      <label>Upload file</label>
      <input type=”file” name=”otkaz_pismo” multiple=”true”>
      <input type=”hidden” name=”otkaz_pismo[label]” value=”Upload file”>
      <input type=”hidden” name=”otkaz_pismo[type]” value=”file”>
      </div>
      </div>
      </div>
      </div>
      </div>
      <?php
      }
      //save the field in database
      add_action(‘mvx_save_custom_store’, ‘save_field’, 10, 1);
      function save_field($user_id){

      $sertifikat_sootv = $_POST[‘sertifikat_sootv’];
      update_user_meta($user_id, ‘_sertifikat_sootv’, $sertifikat_sootv);
      $otkaz_pismo = $_POST[‘otkaz_pismo’];
      update_user_meta($user_id, ‘_otkaz_pismo’, $otkaz_pismo);

      }

    • #194223

      Hello @l.gan. Going through code line by line is really hard.
      It will be better if you kindly explain the flow you are looking for so that we can help you accordingly. Therefore where do you want to upload, so we can share the corresponding filters.

      • #194225
        l.gan
        Participant

        Sangita thanks for your answer and help

        One of the requirements of the law of my country is that the supplier has certificates for products + permits for sale.

        I would like the vendor to be able to upload a file in their Dashboard to their products. And I, as the owner, could quickly get any of his certificates (document, pdf, photo).

        According to the law – Vendor must present:
        1. “Rights to sell products of this brand” (the number of documents depending on the number of brands that sells)
        2. “Certificates of conformity of goods to state samples”.

        When a vendor registers, it can add attachments. But where do they go? They are nowhere to be found except for the letter. It would be great

        a) show these attachments in the vendor dashboard + the ability to add new documents (Photo1)
        b) add the validity period of these documents. For example, when loading, the Vendor reports that the document in this field is valid from January 1, 22 to January 1, 25.
        c) super admin ability: delete uploaded documents and view them from the admin panel. for example on the tab (Photo2)

        I understand that this is most likely a large flow of code, but I would be grateful for any help from you

    • #194253

      Hello @l.gan
      Thanks for explaining your queries. Our replies are inline with your queries –
      1. “Rights to sell products of this brand” (the number of documents depending on the number of brands that sells)
      2. “Certificates of conformity of goods to state samples”.
      When a vendor registers, it can add attachments. But where do they go? They are nowhere to be found except for the letter.
      >> When a vendor uploads a document on the registration form and submits the registration form, then the admin can see all the uploaded details of the vendor from the vendor application tab under vendor details from the vendors submenu of MultiVendorX https://prnt.sc/G_zBjReedCj_.
      a) show these attachments in the vendor dashboard + the ability to add new documents (Photo1)
      b) add the validity period of these documents. For example, when loading, the Vendor reports that the document in this field is valid from January 1, 22 to January 1, 25.
      c) super admin ability: delete uploaded documents and view them from the admin panel. for example on the tab (Photo2)
      >> The flow you are looking for needs a good amount of custom code and it is not possible for us to provide you with that code.
      But not to worry. You can contact and hire our service team for this https://multivendorx.com/custom-development/.

    • #194263
      l.gan
      Participant

      ok, I understand, thanks for the answer, please tell me, is there a way to display the Vendor Application tab on the vendor dashboard page?

    • #194281

      @l.gan as there is no field to display vendor applications in the dashboard, hence you have to do custom code and add this support.

      • #194289
        l.gan
        Participant

        Okay, I understand you. Can you help me to display only the contents of 1 field in the hook:

        I need to display previously uploaded certificates (which were uploaded at enrollment) in

        add_action( ‘mvx_after_shop_front’, ‘extra_setting_fields’ );
        function extra_setting_fields() {
        global $MVX;

        <div class=”panel panel-default panel-outer-heading”>
        <div class=”panel-heading d-flex”>
        <h3><?php _e(‘Quality certificates’, ‘multivendorx’); ?></h3>
        </div>
        <div class=”panel-body panel-content-padding form-horizontal”>
        <div class=”mvx_media_block”>
        /*how can I display previously uploaded certificates here?*/

        </div>
        </div>
        </div>

        <?php
        }

        I need the vendor to see what it has already downloaded before and what has already been verified.
        As far as I understand the data is stored in mvx_vendor_fields[4][], but I’m not sure…

        Because, at the beginning of the sale of a new product, it is his responsibility to send certificates for the new product and he must know exactly what he has already downloaded before.

        Please help me.

    • #194303

      Our team will provide you with the code. But it will take some time.

    • #194717
      l.gan
      Participant

      Thanks guys, I’ll wait for your reply

    • #194719

      Extremely sorry for the delay. Our team is quite busy with some work. Once they are done with the allocated work, they will surely look into your issue and help you accordingly.
      Kindly provide them some time.

    • #195204
      This reply has been marked as private.
    • #195206
      l.gan
      Participant
      This reply has been marked as private.
    • #195228

      You can add the below code in the functions.php file of your current active theme –

      
      add_action( 'mvx_after_shop_front', 'extra_setting_fields' );
      function extra_setting_fields() {
          global $MVX;
          $current_userid = wp_get_current_user()->ID;
          $mvx_vendor_fields = get_user_meta($current_userid,'mvx_vendor_fields');
          ?>
          <div class="panel panel-default panel-outer-heading">
          <div class="panel-heading d-flex">
          <h3><?php _e('Quality certificates', 'multivendorx'); ?></h3>
          </div>
          <div class="panel-body panel-content-padding form-horizontal">
          <div class="mvx_media_block">
          /*here is your url of the 1st attachment*/
              <?php print_r(wp_get_attachment_url($mvx_vendor_fields[0][1]['value'][0]));?>
           /*here is your url of the 2st attachment*/
           <?php print_r(wp_get_attachment_url($mvx_vendor_fields[0][2]['value'][0]));?>
          </div>
          </div>
          </div>
          
          <?php
          }
      
      Copy
    • #195304
      l.gan
      Participant

      Thanks guys, my issue is resolved

    • #195315

      Happy to hear that. We are closing this thread. If you face any issue or need help in future please open a new thread.

Viewing 12 reply threads

The topic ‘how can I upload files’ is closed to new replies.