file & function update

This commit is contained in:
magepeopleteam 2021-12-13 12:12:54 +00:00
parent ead1b56881
commit ddb0fda668
9 changed files with 40 additions and 22 deletions

View File

@ -241,6 +241,13 @@ if (!class_exists('MAGE_Events_Setting_Controls')) :
'type' => 'text',
'default' => 'Price Starts from:'
),
array(
'name' => 'event_price_label_single',
'label' => __('Event Price Label For Single Price', 'mage-eventpress'),
'desc' => __('Enter The text which you want to show as price label For Single Price, Its only displayed if Show Event price value is YES above. ', 'mage-eventpress'),
'type' => 'text',
'default' => 'Price:'
),
array(
'name' => 'mep_event_time_format',
'label' => __('Event Time Format', 'mage-eventpress'),

View File

@ -1653,25 +1653,20 @@ if (!function_exists('mep_get_tshirts_sizes')) {
if (!function_exists('mep_event_list_price')) {
function mep_event_list_price($pid) {
function mep_event_list_price($pid, $type='price') {
global $post;
$cur = get_woocommerce_currency_symbol();
$mep_event_ticket_type = get_post_meta($pid, 'mep_event_ticket_type', true);
$mep_events_extra_prices = get_post_meta($pid, 'mep_events_extra_prices', true);
$mep_event_ticket_type = get_post_meta($pid, 'mep_event_ticket_type', true) ? get_post_meta($pid, 'mep_event_ticket_type', true) : [];
$n_price = get_post_meta($pid, '_price', true);
$price_arr = [];
if ($n_price == 0) {
$gn_price = "Free";
} else {
$gn_price = wc_price($n_price);
if(sizeof($mep_event_ticket_type) > 0){
foreach ($mep_event_ticket_type as $ticket) {
$price_arr[] = $ticket['option_price_t'];
}
}
if ($mep_event_ticket_type) {
$gn_price = wc_price($mep_event_ticket_type[0]['option_price_t']);
}
return $gn_price;
return $type == 'price' ? wc_price(min($price_arr)) : count($price_arr);
}
}

View File

@ -9,7 +9,10 @@ if (!function_exists('mep_display_event_loop_list')) {
{
$now = current_time('Y-m-d H:i:s');
$show_price = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
$show_price_label = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
$price_count = mep_event_list_price($event_id, 'count');
// event_price_label_single
$show_price_label = $price_count == 1 ? mep_get_option('event_price_label_single', 'general_setting_sec', __('Price:','mage-eventpress')) : mep_get_option('event-price-label', 'general_setting_sec', __('Price Starts from:','mage-eventpress'));
$event_meta = get_post_custom($event_id);
$author_terms = get_the_terms($event_id, 'mep_org') ? get_the_terms($event_id, 'mep_org') : [];
$time = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
@ -20,6 +23,7 @@ if (!function_exists('mep_display_event_loop_list')) {
$cat_class = mep_get_term_as_class($event_id, 'mep_cat',$unq_id);
$event_multidate = array_key_exists('mep_event_more_date', $event_meta) ? maybe_unserialize($event_meta['mep_event_more_date'][0]) : array();
$available_seat = mep_get_total_available_seat($event_id, $event_meta);
// $available_seat = 1;
$hide_org_list = mep_get_option('mep_event_hide_organizer_list', 'general_setting_sec', 'no');
$hide_location_list = mep_get_option('mep_event_hide_location_list', 'general_setting_sec', 'no');
$hide_time_list = mep_get_option('mep_event_hide_time_list', 'general_setting_sec', 'no');

View File

@ -14,7 +14,9 @@ if (!function_exists('mep_event_loop_minimal_style')) {
$now = current_time('Y-m-d H:i:s');
$show_price = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
$show_price_label = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
$price_count = mep_event_list_price($event_id, 'count');
$show_price_label = $price_count == 1 ? mep_get_option('event_price_label_single', 'general_setting_sec', __('Price:','mage-eventpress')) : mep_get_option('event-price-label', 'general_setting_sec', __('Price Starts from:','mage-eventpress'));
$event_meta = get_post_custom($event_id);
$author_terms = get_the_terms($event_id, 'mep_org');
$time = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);

View File

@ -14,7 +14,9 @@ if (!function_exists('mep_event_loop_native_style')) {
if ($style == 'native') {
$now = current_time('Y-m-d H:i:s');
$show_price = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
$show_price_label = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
$price_count = mep_event_list_price($event_id, 'count');
$show_price_label = $price_count == 1 ? mep_get_option('event_price_label_single', 'general_setting_sec', __('Price:','mage-eventpress')) : mep_get_option('event-price-label', 'general_setting_sec', __('Price Starts from:','mage-eventpress'));
$event_meta = get_post_custom($event_id);
$author_terms = get_the_terms($event_id, 'mep_org');
$time = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);

View File

@ -15,7 +15,9 @@ if (!function_exists('mep_event_loop_spring_style')) {
if ($style == 'spring') {
$now = current_time('Y-m-d H:i:s');
$show_price = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
$show_price_label = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
$price_count = mep_event_list_price($event_id, 'count');
$show_price_label = $price_count == 1 ? mep_get_option('event_price_label_single', 'general_setting_sec', __('Price:','mage-eventpress')) : mep_get_option('event-price-label', 'general_setting_sec', __('Price Starts from:','mage-eventpress'));
$event_meta = get_post_custom($event_id);
$author_terms = get_the_terms($event_id, 'mep_org');
$start_time = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);

View File

@ -14,7 +14,9 @@ if (!function_exists('mep_event_loop_timeline_style')) {
if ($style == 'timeline') {
$now = current_time('Y-m-d H:i:s');
$show_price = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
$show_price_label = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
$price_count = mep_event_list_price($event_id, 'count');
$show_price_label = $price_count == 1 ? mep_get_option('event_price_label_single', 'general_setting_sec', __('Price:','mage-eventpress')) : mep_get_option('event-price-label', 'general_setting_sec', __('Price Starts from:','mage-eventpress'));
$event_meta = get_post_custom($event_id);
$author_terms = get_the_terms($event_id, 'mep_org');
$time = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);

View File

@ -15,7 +15,9 @@ if (!function_exists('mep_event_loop_title_style')) {
$now = current_time('Y-m-d H:i:s');
$show_price = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
$show_price_label = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
$price_count = mep_event_list_price($event_id, 'count');
$show_price_label = $price_count == 1 ? mep_get_option('event_price_label_single', 'general_setting_sec', __('Price:','mage-eventpress')) : mep_get_option('event-price-label', 'general_setting_sec', __('Price Starts from:','mage-eventpress'));
$event_meta = get_post_custom($event_id);
$author_terms = get_the_terms($event_id, 'mep_org');
$time = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);

View File

@ -15,7 +15,9 @@ if (!function_exists('mep_event_loop_winter_style')) {
if ($style == 'winter') {
$now = current_time('Y-m-d H:i:s');
$show_price = mep_get_option('mep_event_price_show', 'general_setting_sec', 'yes');
$show_price_label = mep_get_option('event-price-label', 'general_setting_sec', 'Price Starts from:');
$price_count = mep_event_list_price($event_id, 'count');
$show_price_label = $price_count == 1 ? mep_get_option('event_price_label_single', 'general_setting_sec', __('Price:','mage-eventpress')) : mep_get_option('event-price-label', 'general_setting_sec', __('Price Starts from:','mage-eventpress'));
$event_meta = get_post_custom($event_id);
$author_terms = get_the_terms($event_id, 'mep_org');
$start_time = strtotime($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);