From f3ff468742bc1d73b8757bd36e2ec0efc7b309b5 Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Tue, 18 Feb 2020 04:56:20 +0000 Subject: [PATCH] just file update with fix function prefix name --- inc/admin_setting_panel.php | 2 +- inc/mep_enque.php | 4 +- inc/mep_event_meta.php | 10 +- inc/mep_extra_price.php | 168 ++-- inc/mep_functions.php | 295 ++---- inc/mep_upgrade.php | 1 + inc/template-prts/event_ticket_type.php | 26 +- languages/mage-eventpress-de_DE.mo | Bin 0 -> 22278 bytes languages/mage-eventpress-de_DE.po | 1230 +++++++++++++++++++++++ 9 files changed, 1404 insertions(+), 332 deletions(-) create mode 100644 languages/mage-eventpress-de_DE.mo create mode 100644 languages/mage-eventpress-de_DE.po diff --git a/inc/admin_setting_panel.php b/inc/admin_setting_panel.php index 83bb704..75eff87 100644 --- a/inc/admin_setting_panel.php +++ b/inc/admin_setting_panel.php @@ -94,7 +94,7 @@ class MAGE_Events_Setting_Controls { 'desc' => __( 'Event Details Template', 'mage-eventpress' ), 'type' => 'select', 'default' => 'no', - 'options' => event_template_name() + 'options' => mep_event_template_name() ), array( 'name' => 'mep_event_price_show', diff --git a/inc/mep_enque.php b/inc/mep_enque.php index f183ff7..45e2b2c 100644 --- a/inc/mep_enque.php +++ b/inc/mep_enque.php @@ -20,7 +20,7 @@ if($user_api){ } -function add_admin_scripts( $hook ) { +function mep_add_admin_scripts( $hook ) { global $post; @@ -36,7 +36,7 @@ function add_admin_scripts( $hook ) { } } } -add_action( 'admin_enqueue_scripts', 'add_admin_scripts', 10, 1 ); +add_action( 'admin_enqueue_scripts', 'mep_add_admin_scripts', 10, 1 ); diff --git a/inc/mep_event_meta.php b/inc/mep_event_meta.php index 8cef06e..73a7f9a 100644 --- a/inc/mep_event_meta.php +++ b/inc/mep_event_meta.php @@ -902,11 +902,17 @@ function mep_event_ticket_type() { var row = $( '.empty-row-t.screen-reader-text' ).clone(true); row.removeClass( 'empty-row-t screen-reader-text' ); row.insertBefore( '#repeatable-fieldset-one-t tbody>tr:last' ); + jQuery('#mep_ticket_type_empty option[value=inputbox]').attr('selected','selected'); + jQuery('.empty-row-t #mep_ticket_type_empty option[value=inputbox]').removeAttr('selected'); return false; }); $( '.remove-row-t' ).on('click', function() { $(this).parents('tr').remove(); + // $("selector").removeAttr(attribute); + jQuery('#mep_ticket_type_empty option[value=inputbox]').removeAttr('selected'); + jQuery('#mep_ticket_type_empty option[value=dropdown]').removeAttr('selected'); + return false; }); }); @@ -973,7 +979,9 @@ $opt_rst_qty = isset($field['option_rsv_t']) ? $field['option_rsv_t'] : 0; '?> - + + diff --git a/inc/mep_extra_price.php b/inc/mep_extra_price.php index d73cb4e..2b8cf78 100644 --- a/inc/mep_extra_price.php +++ b/inc/mep_extra_price.php @@ -2,7 +2,7 @@ function mep_add_custom_fields_text_to_cart_item( $cart_item_data, $product_id, $variation_id ){ $product_id = get_post_meta($product_id,'link_mep_event',true) ? get_post_meta($product_id,'link_mep_event',true) : $product_id; - + $recurring = get_post_meta($product_id, 'mep_enable_recurring', true) ? get_post_meta($product_id, 'mep_enable_recurring', true) : 'no'; if (get_post_type($product_id) == 'mep_events') { $tp = get_post_meta($product_id,'_price',true); @@ -147,10 +147,17 @@ if(isset($_POST['mep_event_ticket_type'])){ $cnt++; } } - + + if($recurring == 'yes'){ + $recurring_event_date = isset($_POST['recurring_event_date']) ? $_POST['recurring_event_date'] : array(); + }else{ + $recurring_event_date = array(); + } + + $cart_item_data['event_ticket_info'] = $ticket_type_arr; - $cart_item_data['event_validate_info'] = $validate; + $cart_item_data['event_validate_info'] = $validate; $cart_item_data['event_extra_option'] = $new; $cart_item_data['event_user_info'] = $user; $cart_item_data['event_tp'] = $tp; @@ -159,6 +166,8 @@ if(isset($_POST['mep_event_ticket_type'])){ $cart_item_data['event_extra_service'] = $event_extra; $cart_item_data['event_cart_location'] = $event_cart_location; $cart_item_data['event_cart_date'] = $mep_event_start_date; + $cart_item_data['event_recurring_date'] = array_unique($recurring_event_date); + $cart_item_data['event_recurring_date_arr'] = $recurring_event_date; // $cart_item_data['event_cart_date'] = $event_cart_date; } $cart_item_data['event_id'] = $product_id; @@ -169,8 +178,8 @@ add_filter( 'woocommerce_add_cart_item_data', 'mep_add_custom_fields_text_to_car -add_action( 'woocommerce_before_calculate_totals', 'add_custom_price',90,1 ); -function add_custom_price( $cart_object ) { +add_action( 'woocommerce_before_calculate_totals', 'mep_add_custom_price',90,1 ); +function mep_add_custom_price( $cart_object ) { foreach ( $cart_object->cart_contents as $key => $value ) { $eid = $value['event_id']; @@ -197,11 +206,23 @@ $eid = $cart_item['event_id']; if (get_post_type($eid) == 'mep_events') { $user_info = $cart_item['event_user_info']; $ticket_type_arr = $cart_item['event_ticket_info']; - $event_extra_service = $cart_item['event_extra_service']; + $event_extra_service = $cart_item['event_extra_service']; + $event_recurring_date = $cart_item['event_recurring_date']; - + $recurring = get_post_meta($eid, 'mep_enable_recurring', true) ? get_post_meta($eid, 'mep_enable_recurring', true) : 'no'; echo "