MultivendorX
-
AuthorPosts
-
-
July 8, 2023 at 4:16 PM #194206l.ganParticipant
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);}
-
July 8, 2023 at 7:38 PM #194223Sangita Support SquadKeymaster
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.-
July 8, 2023 at 8:11 PM #194225l.ganParticipant
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
-
-
July 10, 2023 at 6:14 PM #194253Sangita Support SquadKeymaster
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/. -
July 10, 2023 at 10:18 PM #194263l.ganParticipant
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?
-
July 11, 2023 at 3:49 PM #194281Sangita Support SquadKeymaster
@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.
-
July 11, 2023 at 6:56 PM #194289l.ganParticipant
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.
-
-
July 12, 2023 at 6:54 PM #194303Sangita Support SquadKeymaster
Our team will provide you with the code. But it will take some time.
-
July 26, 2023 at 2:33 PM #194717l.ganParticipant
Thanks guys, I’ll wait for your reply
-
July 26, 2023 at 4:00 PM #194719Sangita Support SquadKeymaster
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. -
August 16, 2023 at 5:32 PM #195204NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
August 16, 2023 at 5:41 PM #195206l.ganParticipantThis reply has been marked as private.
-
August 17, 2023 at 4:59 PM #195228Sangita Support SquadKeymaster
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 -
August 19, 2023 at 11:06 PM #195304l.ganParticipant
Thanks guys, my issue is resolved
-
August 21, 2023 at 9:24 AM #195315Sangita Support SquadKeymaster
Happy to hear that. We are closing this thread. If you face any issue or need help in future please open a new thread.
-
-
AuthorPosts
The topic ‘how can I upload files’ is closed to new replies.