Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › Product Vendors › Store Gallery
- This topic has 13 replies, 2 voices, and was last updated 3 years, 10 months ago by Sarmistha Chakraborty.
- AuthorPosts
- May 8, 2020 at 12:54 pm #128299Eden BrownleeParticipant
Hello Good day! Is there anyway I could let my store vendors upload images of the store. I would like to add the images then on the about store page. Thanks
- May 9, 2020 at 12:55 pm #128747Sarmistha ChakrabortyKeymaster
Hello,
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets///Add Store Gallery option vendor settings page add_filter('wcfm_marketplace_settings_fields_general', 'wcfm_marketplace_settings_fields_general_custom0905', 50, 2 ); function wcfm_marketplace_settings_fields_general_custom0905($general_fields,$vendor_id) { $vendor_data = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true ); $store_gallery = isset( $vendor_data['store_gallery'] ) ? $vendor_data['store_gallery'] : array(); if(isset($general_fields['shop_description'])) { $general_fields['store_gallery']= array( 'label' => __('Store Gallery', 'wc-frontend-manager'), 'type' => 'multiinput', 'class' => 'wcfm-text wcfm_ele gallery_type_upload gallery_type_field gallery_type_slider wcfm_non_sortable', 'label_class' => 'wcfm_title gallery_type_field gallery_type_slider', 'value' => $store_gallery, 'options' => array( "image" => array( 'type' => 'upload', 'class' => 'wcfm_gallery_upload gallery_type_upload wcfm-banner-uploads', 'prwidth' => 75), "link" => array( 'type' => 'text', 'class' => 'wcfm-text gallery_type_slilder_link', 'placeholder' => __( 'Gallery Hyperlink', 'wc-frontend-manager' ) ), ) ); } return $general_fields; } add_action( 'wcfm_wcfmmp_settings_update','fn_wcfm_vendor_settings_storetype_update0905', 50, 2); add_action( 'wcfm_vendor_settings_update','fn_wcfm_vendor_settings_storetype_update0905', 50, 2); function fn_wcfm_vendor_settings_storetype_update0905($user_id, $wcfm_settings_form ){ $wcfm_settings_form_data_new = array(); parse_str($_POST['wcfm_settings_form'], $wcfm_settings_form_data_new); $wcfm_settings_form_data_storetype = array(); if(isset($wcfm_settings_form_data_new['store_gallery']) && !empty($wcfm_settings_form_data_new['store_gallery'])) { $wcfm_settings_form_data_storetype['store_gallery'] = $wcfm_settings_form_data_new['store_gallery']; } $wcfm_settings_form = array_merge( $wcfm_settings_form, $wcfm_settings_form_data_storetype ); update_user_meta( $user_id, 'wcfmmp_profile_settings', $wcfm_settings_form ); } //get and display gallery images in about page add_action('wcfmmp_store_after_about','add_shop_gallery_wcfmmp_store_after_about',10); function add_shop_gallery_wcfmmp_store_after_about($vendor_id){ $vendor_data = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true ); $store_gallery = isset( $vendor_data['store_gallery'] ) ? $vendor_data['store_gallery'] : array(); foreach ($store_gallery as $store_gallery_img) { if($store_gallery_img['image'] != '') { $img_url = wcfm_get_attachment_url($store_gallery_img['image']); } else { $img_url = $store_gallery_img['link']; } echo '<img src="'.$img_url.'" />'; //replace with your required HTML to display gallery } }
Thanks.
- May 12, 2020 at 10:06 pm #130152Eden BrownleeParticipant
Where do the vendors upload the gallery images? TY
- May 12, 2020 at 10:15 pm #130154Eden BrownleeParticipant
Found it, it seems like this snippet only allows one product to be added in the gallery though.
- May 12, 2020 at 10:36 pm #130162Eden BrownleeParticipant
By the way I created custom fields on registration but in the vendor dashboard it seems to not be showing anywhere… I want the vendors to have access on it too that way they can update it when needed in the future.
- May 13, 2020 at 2:17 pm #130361Sarmistha ChakrabortyKeymaster
Hello,
Found it, it seems like this snippet only allows one product to be added in the gallery though.
>>//Add Store Gallery option vendor settings page add_filter('wcfm_marketplace_settings_fields_general', 'wcfm_marketplace_settings_fields_general_custom0905', 50, 2 ); function wcfm_marketplace_settings_fields_general_custom0905($general_fields,$vendor_id) { $vendor_data = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true ); $store_gallery = isset( $vendor_data['store_gallery'] ) ? $vendor_data['store_gallery'] : array(); if(isset($general_fields['store_name'])) { $general_fields['store_gallery']= array( 'label' => __('Store Gallery', 'wc-frontend-manager'), 'type' => 'multiinput', 'class' => 'wcfm-text wcfm_ele gallery_type_upload gallery_type_field gallery_type_slider wcfm_non_sortable', 'label_class' => 'wcfm_title gallery_type_field gallery_type_slider', 'value' => $store_gallery, 'options' => array( "image" => array( 'type' => 'upload', 'class' => 'wcfm_gallery_upload gallery_type_upload wcfm-banner-uploads', 'prwidth' => 75), "link" => array( 'type' => 'text', 'class' => 'wcfm-text gallery_type_slilder_link', 'placeholder' => __( 'Gallery Hyperlink', 'wc-frontend-manager' ) ), ) ); } return $general_fields; } add_action( 'wcfm_wcfmmp_settings_update','fn_wcfm_vendor_settings_storetype_update0905', 50, 2); add_action( 'wcfm_vendor_settings_update','fn_wcfm_vendor_settings_storetype_update0905', 50, 2); function fn_wcfm_vendor_settings_storetype_update0905($user_id, $wcfm_settings_form ){ $wcfm_settings_form_data_new = array(); parse_str($_POST['wcfm_settings_form'], $wcfm_settings_form_data_new); $wcfm_settings_form_data_storetype = array(); if(isset($wcfm_settings_form_data_new['store_gallery']) && !empty($wcfm_settings_form_data_new['store_gallery'])) { $wcfm_settings_form_data_storetype['store_gallery'] = $wcfm_settings_form_data_new['store_gallery']; } $wcfm_settings_form = array_merge( $wcfm_settings_form, $wcfm_settings_form_data_storetype ); update_user_meta( $user_id, 'wcfmmp_profile_settings', $wcfm_settings_form ); } //get and display gallery images in about page add_action('wcfmmp_store_after_about','add_shop_gallery_wcfmmp_store_after_about',10); function add_shop_gallery_wcfmmp_store_after_about($vendor_id){ $vendor_data = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true ); $store_gallery = isset( $vendor_data['store_gallery'] ) ? $vendor_data['store_gallery'] : array(); foreach ($store_gallery as $store_gallery_img) { if($store_gallery_img['image'] != '') { $img_url = wcfm_get_attachment_url($store_gallery_img['image']); } else { $img_url = $store_gallery_img['link']; } echo '<img src="'.$img_url.'" />'; //replace with your required HTML to display gallery } }
Adding this code(previously mentioned) you will find “Store Gallery” field in vendor’s settings page and these images will show vendor’s about tab(as per your previous requirement). PFA
By the way I created custom fields on registration but in the vendor dashboard it seems to not be showing anywhere… I want the vendors to have access on it too that way they can update it when needed in the future.
>>You will fnd the custom fields vendor’s profile manager(pfa)Thanks.
Attachments:
You must be logged in to view attached files. - May 13, 2020 at 9:37 pm #130534Eden BrownleeParticipant
Cool! This is working now but the problem is it is only visible in the admin store manager area and not in the vendors side
- May 13, 2020 at 10:00 pm #130545Sarmistha ChakrabortyKeymaster
Hi,
Can you check this properly(after clear cache), because “wcfm_marketplace_settings_fields_general” filter used for admin and as well vendors settings page.
If it’s still not showing in vendor’s settings page, then you can provide us your site access with site url, then we can check your site. (Set as private reply)Thanks
- May 14, 2020 at 6:35 am #130752Eden BrownleeParticipantThis reply has been marked as private.
- May 14, 2020 at 2:40 pm #130897Sarmistha ChakrabortyKeymasterThis reply has been marked as private.
- May 19, 2020 at 6:17 am #132866Eden BrownleeParticipant
Hello Thanks, I am reaching again for another inquiry. Is there any shortcode that can give m the top vendors with a custom field filter. The custom field was added in the registration process. Please let me know, I have asked for this for countless times but nobody responded so I am asking it in this thread again.
- May 19, 2020 at 3:25 pm #133039Sarmistha ChakrabortyKeymaster
Hello,
No, as of now we don’t have this feature. But if you have added custom field from Admin WCFM dashboard -> settings -> vendor registration, then you will find “store list meta filter” widget filter for store list page.
Please for different issues create a different thread or related thread.
Thanks.
- May 20, 2020 at 6:53 am #133360Eden BrownleeParticipant
Could we request this feature? If so how much will we be charged? I already have created a new thread but no one did respond.
https://wclovers.com/forums/topic/shortcode/- May 20, 2020 at 3:09 pm #133497Sarmistha ChakrabortyKeymaster
Hi,
You can post here your request – https://wclovers.com/forums/forum/wcfm-feature-request/
I already have created a new thread but no one did respond.
Okay! We understand.
It requires serious custom development.
Due to COVID-19 we are getting 400-500 more support tickets each day. So we aren’t taking any customizations at this moment. It will be better to find someone who is accustom to WP development. Any problem if you face any difficulty at the time of development we will guide you accordingly.Thanks.
- AuthorPosts
- You must be logged in to reply to this topic.