Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Marketplace › Store hours for different market place
- This topic has 0 replies, 1 voice, and was last updated 4 years, 5 months ago by danick.delaroche.
- AuthorPosts
- May 31, 2020 at 7:17 pm #136985danick.delarocheParticipant
Hello,
My store has different location and diffrent open hours because the vendors are located in different vegetables market. I have done a adapation in the vendors settings. No trouble`<?php
add_filter(‘wcfm_marketplace_settings_fields_general’, ‘wcfm_marketplace_settings_fields_general_custom2004’, 50, 2 );function wcfm_marketplace_settings_fields_general_custom2004($general_fields,$vendor_id) {
$vendor_data = get_user_meta( $vendor_id, ‘wcfmmp_profile_settings’, true );
$store_market1_lieu = isset( $vendor_data[‘Market1_lieu’] ) ? esc_attr( $vendor_data[‘Market1_lieu’] ) : ”;
$store_market1_day = isset( $vendor_data[‘Market1_day’] ) ? esc_attr( $vendor_data[‘Market1_day’] ) : ”;
$store_market1_open = isset( $vendor_data[‘Market1_open’] ) ? esc_attr( $vendor_data[‘Market1_open’] ) : ”;
$store_market1_adresse = isset( $vendor_data[‘Market1_adresse’] ) ? esc_attr( $vendor_data[‘Market1_adresse’] ) : ”;
$store_market1_ville = isset( $vendor_data[‘Market1_ville’] ) ? esc_attr( $vendor_data[‘Market1_ville’] ) : ”;
// Marché 2
$store_market2_lieu = isset( $vendor_data[‘Market2_lieu’] ) ? esc_attr( $vendor_data[‘Market2_lieu’] ) : ”;
$store_market2_day = isset( $vendor_data[‘Market2_day’] ) ? esc_attr( $vendor_data[‘Market2_day’] ) : ”;
$store_market2_open = isset( $vendor_data[‘Market2_open’] ) ? esc_attr( $vendor_data[‘Market2_open’] ) : ”;
$store_market2_adresse = isset( $vendor_data[‘Market2_adresse’] ) ? esc_attr( $vendor_data[‘Market2_adresse’] ) : ”;
$store_market2_ville = isset( $vendor_data[‘Market2_ville’] ) ? esc_attr( $vendor_data[‘Market2_ville’] ) : ”;
// Marché 3
$store_market3_lieu = isset( $vendor_data[‘Market3_lieu’] ) ? esc_attr( $vendor_data[‘Market3_lieu’] ) : ”;
$store_market3_day = isset( $vendor_data[‘Market3_day’] ) ? esc_attr( $vendor_data[‘Market3_day’] ) : ”;
$store_market3_open = isset( $vendor_data[‘Market3_open’] ) ? esc_attr( $vendor_data[‘Market3_open’] ) : ”;
$store_market3_adresse = isset( $vendor_data[‘Market3_adresse’] ) ? esc_attr( $vendor_data[‘Market3_adresse’] ) : ”;
$store_market3_ville = isset( $vendor_data[‘Market3_ville’] ) ? esc_attr( $vendor_data[‘Market3_ville’] ) : ”;if(isset($general_fields[‘store_name’])) {
// Marché 1
$general_fields[‘Market1_lieu’]= array(‘label’ => __(‘Marché 1 – Lieu :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market1_lieu);
$general_fields[‘Market1_day’]= array(‘label’ => __(‘–> Jour :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market1_day);
$general_fields[‘Market1_open’]= array(‘label’ => __(‘–> Ouverture xxhyy – xxhyy :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market1_open);
$general_fields[‘Market1_adresse’]= array(‘label’ => __(‘–> Adresse :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market1_adresse);
$general_fields[‘Market1_ville’]= array(‘label’ => __(‘–> Ville :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market1_ville);// Marché 2
$general_fields[‘Market2_lieu’]= array(‘label’ => __(‘Marché 2 – Lieu :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market2_lieu);
$general_fields[‘Market2_day’]= array(‘label’ => __(‘–> Jour :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market2_day);
$general_fields[‘Market2_open’]= array(‘label’ => __(‘–> Ouverture xxhyy – xxhyy :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market2_open);
$general_fields[‘Market2_adresse’]= array(‘label’ => __(‘–> Adresse :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market2_adresse);
$general_fields[‘Market2_ville’]= array(‘label’ => __(‘–> Ville :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market2_ville);
// Marché 3
$general_fields[‘Market3_lieu’]= array(‘label’ => __(‘Marché 3 – Lieu :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market3_lieu);
$general_fields[‘Market3_day’]= array(‘label’ => __(‘–> Jour :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market3_day);
$general_fields[‘Market3_open’]= array(‘label’ => __(‘–> Ouverture xxhyy – xxhyy :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market3_open);
$general_fields[‘Market3_adresse’]= array(‘label’ => __(‘–> Adresse :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market3_adresse);
$general_fields[‘Market3_ville’]= array(‘label’ => __(‘–> Ville :’, ‘wc-frontend-manager’) , ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘value’ => $store_market3_ville);}
return $general_fields;
}add_action( ‘wcfm_wcfmmp_settings_update’,’fn_wcfm_vendor_settings_storetype_update2004′, 50, 2);
add_action( ‘wcfm_wcfmmp_settings_update’,’fn_wcfm_vendor_settings_storetype_update2004′, 50, 2);
function fn_wcfm_vendor_settings_storetype_update2004($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[‘Market1_lieu’]) && !empty($wcfm_settings_form_data_new[‘Market1_lieu’])) {
$wcfm_settings_form_data_storetype[‘Market1_lieu’] = $wcfm_settings_form_data_new[‘Market1_lieu’];
}
if(isset($wcfm_settings_form_data_new[‘Market1_day’]) && !empty($wcfm_settings_form_data_new[‘Market1_day’])) {
$wcfm_settings_form_data_storetype[‘Market1_day’] = $wcfm_settings_form_data_new[‘Market1_day’];
}
if(isset($wcfm_settings_form_data_new[‘Market1_open’]) && !empty($wcfm_settings_form_data_new[‘Market1_open’])) {
$wcfm_settings_form_data_storetype[‘Market1_open’] = $wcfm_settings_form_data_new[‘Market1_open’];
}
if(isset($wcfm_settings_form_data_new[‘Market1_adresse’]) && !empty($wcfm_settings_form_data_new[‘Market1_adresse’])) {
$wcfm_settings_form_data_storetype[‘Market1_adresse’] = $wcfm_settings_form_data_new[‘Market1_adresse’];
}
if(isset($wcfm_settings_form_data_new[‘Market1_ville’]) && !empty($wcfm_settings_form_data_new[‘Market1_ville’])) {
$wcfm_settings_form_data_storetype[‘Market1_ville’] = $wcfm_settings_form_data_new[‘Market1_ville’];
}// Marché 2
if(isset($wcfm_settings_form_data_new[‘Market2_lieu’]) && !empty($wcfm_settings_form_data_new[‘Market2_lieu’])) {
$wcfm_settings_form_data_storetype[‘Market2_lieu’] = $wcfm_settings_form_data_new[‘Market2_lieu’];
}
if(isset($wcfm_settings_form_data_new[‘Market2_day’]) && !empty($wcfm_settings_form_data_new[‘Market2_day’])) {
$wcfm_settings_form_data_storetype[‘Market2_day’] = $wcfm_settings_form_data_new[‘Market2_day’];
}
if(isset($wcfm_settings_form_data_new[‘Market2_open’]) && !empty($wcfm_settings_form_data_new[‘Market2_open’])) {
$wcfm_settings_form_data_storetype[‘Market2_open’] = $wcfm_settings_form_data_new[‘Market2_open’];
}
if(isset($wcfm_settings_form_data_new[‘Market2_adresse’]) && !empty($wcfm_settings_form_data_new[‘Market2_adresse’])) {
$wcfm_settings_form_data_storetype[‘Market2_adresse’] = $wcfm_settings_form_data_new[‘Market2_adresse’];
}
if(isset($wcfm_settings_form_data_new[‘Market2_ville’]) && !empty($wcfm_settings_form_data_new[‘Market2_ville’])) {
$wcfm_settings_form_data_storetype[‘Market2_ville’] = $wcfm_settings_form_data_new[‘Market2_ville’];
}// Marché 3
if(isset($wcfm_settings_form_data_new[‘Market3_lieu’]) && !empty($wcfm_settings_form_data_new[‘Market3_lieu’])) {
$wcfm_settings_form_data_storetype[‘Market3_lieu’] = $wcfm_settings_form_data_new[‘Market3_lieu’];
}
if(isset($wcfm_settings_form_data_new[‘Market3_day’]) && !empty($wcfm_settings_form_data_new[‘Market3_day’])) {
$wcfm_settings_form_data_storetype[‘Market3_day’] = $wcfm_settings_form_data_new[‘Market3_day’];
}
if(isset($wcfm_settings_form_data_new[‘Market3_open’]) && !empty($wcfm_settings_form_data_new[‘Market3_open’])) {
$wcfm_settings_form_data_storetype[‘Market3_open’] = $wcfm_settings_form_data_new[‘Market3_open’];
}
if(isset($wcfm_settings_form_data_new[‘Market3_adresse’]) && !empty($wcfm_settings_form_data_new[‘Market3_adresse’])) {
$wcfm_settings_form_data_storetype[‘Market3_adresse’] = $wcfm_settings_form_data_new[‘Market3_adresse’];
}
if(isset($wcfm_settings_form_data_new[‘Market3_ville’]) && !empty($wcfm_settings_form_data_new[‘Market3_ville’])) {
$wcfm_settings_form_data_storetype[‘Market3_ville’] = $wcfm_settings_form_data_new[‘Market3_ville’];
}
$wcfm_settings_form = array_merge( $wcfm_settings_form, $wcfm_settings_form_data_storetype );
update_user_meta( $user_id, ‘wcfmmp_profile_settings’, $wcfm_settings_form );
}
?>`Next step I would like to display by using a widget like store hours in the store page. I don’t know how can i proceed. Could you give somes indications, please ?
- AuthorPosts
- You must be logged in to reply to this topic.