function updated

This commit is contained in:
magepeopleteam 2020-02-20 07:19:12 +00:00
parent eaeaf6e515
commit ae24709f3b
3 changed files with 72 additions and 90 deletions

View File

@ -1279,36 +1279,36 @@ function mep_get_all_tax_list($current_tax=null){
function mep_get_full_time_and_date($datetime){
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
$wpdatesettings = $date_format.' '.$time_format;
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec',12);
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
$wpdatesettings = $date_format.' '.$time_format;
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec','wtss');
if($user_set_format==12){
echo date_i18n('D, d M Y h:i A', strtotime($datetime));
echo wp_date('D, d M Y h:i A', strtotime($datetime));
}
if($user_set_format==24){
echo date_i18n('D, d M Y H:i', strtotime($datetime));
echo wp_date('D, d M Y H:i', strtotime($datetime));
}
if($user_set_format=='wtss'){
echo date_i18n($wpdatesettings, strtotime($datetime));
echo wp_date($wpdatesettings, strtotime($datetime));
}
}
function mep_get_only_time($datetime){
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec',12);
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec','wtss');
//echo $date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
if($user_set_format==12){
echo date_i18n('h:i A', strtotime($datetime));
echo wp_date('h:i A', strtotime($datetime));
}
if($user_set_format==24){
echo date_i18n('H:i', strtotime($datetime));
echo wp_date('H:i', strtotime($datetime));
}
if($user_set_format=='wtss'){
echo date_i18n($time_format, strtotime($datetime));
echo wp_date($time_format, strtotime($datetime));
}
}
@ -1968,37 +1968,27 @@ function mep_get_all_tax_list($current_tax=null){
function mep_ticket_sold($event_id){
$args = array(
'post_type' => 'mep_events_attendees',
'posts_per_page' => -1,
'meta_query' => array(
'relation' => 'AND',
array(
'relation' => 'AND',
array(
'key' => 'ea_event_id',
'value' => $event_id,
'compare' => '='
)
),array(
'relation' => 'OR',
array(
'key' => 'ea_order_status',
'value' => 'processing',
'compare' => '='
),
array(
'key' => 'ea_order_status',
'value' => 'completed',
'compare' => '='
)
)
)
);
$loop = new WP_Query($args);
return $loop->post_count;
$event_start_date = date('Y-m-d',strtotime(get_post_meta($event_id,'event_start_date',true)));
$get_ticket_type_list = get_post_meta($event_id,'mep_event_ticket_type',true);
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
$sold = 0;
foreach($get_ticket_type_list as $ticket_type){
$sold = $sold + mep_ticket_type_sold($event_id,$ticket_type['option_name_t'],$event_start_date);
}
if($recurring == 'yes'){
$mep_event_more_date = get_post_meta($event_id,'mep_event_more_date',true);
foreach ($mep_event_more_date as $md) {
foreach($get_ticket_type_list as $ticket_type){
$sold = $sold + mep_ticket_type_sold($event_id,$ticket_type['option_name_t'],$md['event_more_start_date']);
}
}
}
return $sold;
}
@ -2022,7 +2012,7 @@ function mep_get_all_tax_list($current_tax=null){
function get_mep_datetime($date,$type){
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec',12);
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec','wtss');
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
$wpdatesettings = $date_format.' '.$time_format;
@ -2031,37 +2021,37 @@ function mep_get_all_tax_list($current_tax=null){
if($type == 'date'){
if($user_set_format == 'wtss'){
return date_i18n( $date_format, strtotime( $date ) );
return wp_date( $date_format, strtotime( $date ) );
}else{
return date_i18n( 'Y-m-d', strtotime( $date ) );
return wp_date( 'Y-m-d', strtotime( $date ) );
}
}
if($type == 'date-time'){
if($user_set_format == 12){
return date_i18n( 'Y-m-d h:i A', strtotime( $date ) );
return wp_date( 'Y-m-d h:i A', strtotime( $date ) );
}elseif($user_set_format == 24){
return date_i18n( 'Y-m-d H:i', strtotime( $date ) );
return wp_date( 'Y-m-d H:i', strtotime( $date ) );
}elseif($user_set_format == 'wtss'){
return date_i18n( $wpdatesettings, strtotime( $date ) );
return wp_date( $wpdatesettings, strtotime( $date ) );
}
}
if($type == 'date-text'){
if($user_set_format == 12){
return date_i18n( 'd,D M Y', strtotime( $date ) );
return wp_date( 'd,D M Y', strtotime( $date ) );
}elseif($user_set_format == 'wtss'){
return date_i18n( $date_format, strtotime( $date ) );
return wp_date( $date_format, strtotime( $date ) );
}else{
return date_i18n( 'd, D M Y', strtotime( $date ) );
return wp_date( 'd, D M Y', strtotime( $date ) );
}
}
if($type == 'date-time-text'){
if($user_set_format == 12){
return date_i18n( 'd, D M Y h:i A', strtotime( $date ) );
return wp_date( 'd, D M Y h:i A', strtotime( $date ) );
}elseif($user_set_format == 'wtss'){
return date_i18n( $wpdatesettings, strtotime( $date ) );
return wp_date( $wpdatesettings, strtotime( $date ) );
}else{
return date_i18n( 'd, D M Y H:i', strtotime( $date ) );
return wp_date( 'd, D M Y H:i', strtotime( $date ) );
}
}
if($type == 'time'){
@ -2349,16 +2339,14 @@ function mep_get_all_tax_list($current_tax=null){
function mage_array_strip($string, $allowed_tags = NULL){
if (is_array($string))
{
foreach ($string as $k => $v)
{
$string[$k] = mage_array_strip($v, $allowed_tags);
}
return $string;
}
return strip_tags($string, $allowed_tags);
}
if (is_array($string)){
foreach ($string as $k => $v){
$string[$k] = mage_array_strip($v, $allowed_tags);
}
return $string;
}
return strip_tags($string, $allowed_tags);
}
add_filter('wpseo_premium_post_redirect_slug_change', '__return_true' );

View File

@ -227,25 +227,22 @@ add_action('mep_event_time_only', 'mep_ev_time');
function mep_ev_time()
{
global $event_meta;
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$cn = 1;
$more_date = array($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) ? get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) : 'no';
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$cn = 1;
$more_date = array($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
$mep_show_upcoming_event = get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) ? get_post_meta(get_the_id(), 'mep_show_upcoming_event', true) : 'no';
if ($recurring == 'yes') {
$event_more_dates = get_post_meta(get_the_id(), 'mep_event_more_date', true);
$event_more_dates = get_post_meta(get_the_id(), 'mep_event_more_date', true);
foreach ($event_more_dates as $md) {
$more_date[] = $md['event_more_start_date'] . ' ' . $md['event_more_start_time'];
$more_date[] = $md['event_more_start_date'] . ' ' . $md['event_more_start_time'];
}
foreach ($more_date as $ev_date) {
@ -273,14 +270,12 @@ function mep_ev_time()
function mep_ev_time_ticket($event_meta)
{
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
$start_date = $event_meta['event_start_date'][0];
$start_time = $event_meta['event_start_time'][0];
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
$end_date = $event_meta['event_end_date'][0];
$end_time = $event_meta['event_end_time'][0];
mep_get_only_time($start_datetime);
}

View File

@ -130,7 +130,7 @@ function mep_ev_ticket_type(){
}
return false;
});
$("select[name='option_qty[]']").on('click', function () {
$("select[name='option_qty[]']").on('blur', function () {
mageErrorQty();
});
function qtyPlace(target, value) {
@ -163,5 +163,4 @@ function mep_ev_ticket_type(){
});
</script>
<?php
}
}