function file update

This commit is contained in:
magepeopleteam 2021-02-04 07:34:54 +00:00
parent a143a4f6d5
commit 937d110d51
1 changed files with 22 additions and 19 deletions

View File

@ -2200,13 +2200,13 @@ function get_mep_datetime($date,$type){
if (!function_exists('mep_get_event_upcomming_date')) {
function mep_get_event_upcomming_date($event_id,$type){
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$more_date = get_post_meta($event_id,'mep_event_more_date',true) ? get_post_meta($event_id,'mep_event_more_date',true) : array();
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$more_date = get_post_meta($event_id,'mep_event_more_date',true) ? get_post_meta($event_id,'mep_event_more_date',true) : array();
$start_datetime = get_post_meta($event_id,'event_start_datetime',true);
$start_date = date('Y-m-d H:i:s',strtotime(get_post_meta($event_id,'event_start_datetime',true)));
$end_date = get_post_meta($event_id,'event_end_date',true);
$end_datetime = get_post_meta($event_id,'event_end_datetime',true);
$show_multidate = mep_get_option('mep_date_list_in_event_listing', 'general_setting_sec', 'no');
$show_multidate = mep_get_option('mep_date_list_in_event_listing', 'general_setting_sec', 'no');
// if (strtotime(current_time('Y-m-d H:i')) < strtotime($start_datetime)) {
@ -2717,24 +2717,27 @@ function mep_hide_event_order_meta_in_emails( $meta ) {
}
add_filter( 'woocommerce_order_item_get_formatted_meta_data', 'mep_hide_event_order_data_from_thankyou_and_email', 10, 1 );
if (!function_exists('mep_hide_event_order_data_from_thankyou_and_email')) {
function mep_hide_event_order_data_from_thankyou_and_email($formatted_meta){
$hide_location_status = mep_get_option('mep_hide_location_from_order_page', 'general_setting_sec', 'no');
$hide_date_status = mep_get_option('mep_hide_date_from_order_page', 'general_setting_sec', 'no');
$hide_location = $hide_location_status == 'yes' ? array('Location') : array();
$hide_date = $hide_date_status == 'yes' ? array('Date') : array();
$default = array('event_id');
$default = array_merge($default,$hide_date);
$hide_them = array_merge($default,$hide_location);
function mep_hide_event_order_data_from_thankyou_and_email($formatted_meta){
$hide_location_status = mep_get_option('mep_hide_location_from_order_page', 'general_setting_sec', 'no');
$hide_date_status = mep_get_option('mep_hide_date_from_order_page', 'general_setting_sec', 'no');
$location_text = mep_get_option('mep_location_text', 'label_setting_sec', __('Location', 'mage-eventpress')) ? mep_get_option('mep_location_text', 'label_setting_sec', __('Location', 'mage-eventpress')) : 'Location';
$date_text = mep_get_option('mep_event_date_text', 'label_setting_sec', __('Date', 'mage-eventpress')) ? mep_get_option('mep_event_date_text', 'label_setting_sec', __('Date', 'mage-eventpress')) : 'Date';
$hide_location = $hide_location_status == 'yes' ? array($location_text) : array();
$hide_date = $hide_date_status == 'yes' ? array($date_text) : array();
$default = array('event_id');
$default = array_merge($default,$hide_date);
$hide_them = array_merge($default,$hide_location);
$temp_metas = [];
foreach($formatted_meta as $key => $meta) {
if ( isset( $meta->key ) && ! in_array( $meta->key, $hide_them ) ) {
$temp_metas[ $key ] = $meta;
}
}
return $temp_metas;
}
foreach($formatted_meta as $key => $meta) {
if ( isset( $meta->key ) && ! in_array( $meta->key, $hide_them ) ) {
$temp_metas[ $key ] = $meta;
}
}
return $temp_metas;
}
}