diff --git a/inc/mep_extra_price.php b/inc/mep_extra_price.php index 331d095..1b161ab 100644 --- a/inc/mep_extra_price.php +++ b/inc/mep_extra_price.php @@ -113,6 +113,8 @@ function mep_add_custom_price($cart_object) } + + /** * After update the price now need to show user what they selected and the Price details, the below fuunction is for that, Its showing the details into the cart below the event name. */ @@ -358,6 +360,10 @@ function mep_add_custom_fields_text_to_order_items($item, $cart_item_key, $value } } + + + + if (is_array($event_extra_service) && sizeof($event_extra_service) > 0) { foreach ($event_extra_service as $extra_service) { $service_type_name = $extra_service['service_name'] . " - " . wc_price(mep_get_price_including_tax($eid, $extra_service['service_price'])) . ' x ' . $extra_service['service_qty'] . ' = '; @@ -376,4 +382,4 @@ function mep_add_custom_fields_text_to_order_items($item, $cart_item_key, $value do_action('mep_event_cart_order_data_add', $values, $item); } } -add_action('woocommerce_checkout_create_order_line_item', 'mep_add_custom_fields_text_to_order_items', 90, 4); \ No newline at end of file +add_action('woocommerce_checkout_create_order_line_item', 'mep_add_custom_fields_text_to_order_items', 90, 4); diff --git a/inc/mep_file_include.php b/inc/mep_file_include.php index 200f607..b2b4ee5 100755 --- a/inc/mep_file_include.php +++ b/inc/mep_file_include.php @@ -22,7 +22,7 @@ if (!class_exists('EDD_SL_Plugin_Updater')) { require_once(dirname(__DIR__) . "/inc/mep_enque.php"); require_once(dirname(__DIR__) . "/inc/mep_user_custom_style.php"); require_once(dirname(__DIR__) . "/inc/mep_tax_meta.php"); - require_once(dirname(__DIR__) . "/inc/mep_upgrade.php"); + // require_once(dirname(__DIR__) . "/inc/mep_upgrade.php"); require_once(dirname(__DIR__) . "/inc/mep_functions.php"); require_once(dirname(__DIR__) . "/inc/mep_query.php"); require_once(dirname(__DIR__) . "/support/elementor/elementor-support.php"); \ No newline at end of file diff --git a/inc/mep_functions.php b/inc/mep_functions.php index 72e9117..199433f 100755 --- a/inc/mep_functions.php +++ b/inc/mep_functions.php @@ -413,11 +413,17 @@ if (!function_exists('mep_attendee_create')) { $payment_method = isset($order_meta['_payment_method_title'][0]) ? sanitize_text_field($order_meta['_payment_method_title'][0]) : ''; $user_id = isset($order_meta['_customer_user'][0]) ? sanitize_text_field($order_meta['_customer_user'][0]) : ''; + $first_name = isset($order_meta['_billing_first_name'][0]) ? sanitize_text_field($order_meta['_billing_first_name'][0]) : ''; + $last_name = isset($order_meta['_billing_last_name'][0]) ? sanitize_text_field($order_meta['_billing_last_name'][0]) : ''; + $billing_full_name = $first_name . ' ' . $last_name; + + + + + if ($type == 'billing') { // Billing Information - $first_name = isset($order_meta['_billing_first_name'][0]) ? sanitize_text_field($order_meta['_billing_first_name'][0]) : ''; - $last_name = isset($order_meta['_billing_last_name'][0]) ? sanitize_text_field($order_meta['_billing_last_name'][0]) : ''; - $uname = $first_name . ' ' . $last_name; + $company = isset($order_meta['_billing_company'][0]) ? sanitize_text_field($order_meta['_billing_company'][0]) : ''; $address_1 = isset($order_meta['_billing_address_1'][0]) ? sanitize_text_field($order_meta['_billing_address_1'][0]) : ''; $address_2 = isset($order_meta['_billing_address_2'][0]) ? sanitize_text_field($order_meta['_billing_address_2'][0]) : ''; @@ -439,7 +445,7 @@ if (!function_exists('mep_attendee_create')) { } elseif ($type == 'user_form') { - $uname = sanitize_text_field($_user_info['user_name']); + $_uname = sanitize_text_field($_user_info['user_name']); $email = sanitize_text_field($_user_info['user_email']); $phone = sanitize_text_field($_user_info['user_phone']); $address = sanitize_text_field($_user_info['user_address']); @@ -458,7 +464,8 @@ if (!function_exists('mep_attendee_create')) { } $ticket_total_price = (int) (mep_get_event_ticket_price_by_name($event_id, $ticket_type) * (int) $ticket_qty); - + $uname = isset($_uname) && !empty($_uname) ? $_uname : $billing_full_name; + $new_post = array( 'post_title' => $uname, 'post_content' => '', @@ -2522,7 +2529,7 @@ function mep_get_location($event_id, $type) { if ($type == 'full') { - echo esc_html(implode(',', array_filter($location_arr))); + echo esc_html(implode(', ', array_filter($location_arr))); } if ($type == 'location') { @@ -2737,7 +2744,6 @@ if (!function_exists('mep_product_tags_sorting_query')) { 'terms' => 'uncategorized ', 'operator' => 'NOT IN', ] - ); $query->set('tax_query', $tax_query); } @@ -4142,18 +4148,28 @@ function mep_default_sidebar_reg() { } add_action('widgets_init', 'mep_default_sidebar_reg'); + + +function mep_html_chr($string){ + $find = ['&','#038;']; + $replace = ['and','']; + return html_entity_decode(str_replace($find,$replace,$string)); + // return str_replace("&","pink",'Test & Time Event'); +} + + //********************Share button*************// add_action('mep_after_social_share_list', 'mep_custom_share_btn', 10, 1); if (!function_exists('mep_custom_share_btn')) { function mep_custom_share_btn($event_id) { ?>