diff --git a/inc/mep_extra_price.php b/inc/mep_extra_price.php index 4277b94..099cd5e 100644 --- a/inc/mep_extra_price.php +++ b/inc/mep_extra_price.php @@ -181,7 +181,7 @@ if(isset($_POST['mep_event_ticket_type'])){ $cart_item_data['event_tp'] = $tp; $cart_item_data['line_total'] = $tp; $cart_item_data['line_subtotal'] = $tp; - +$cart_item_data['event_id'] = $product_id; @@ -195,11 +195,13 @@ add_action( 'woocommerce_before_calculate_totals', 'add_custom_price' ); function add_custom_price( $cart_object ) { foreach ( $cart_object->cart_contents as $key => $value ) { +$eid = $value['event_id']; +if (get_post_type($eid) == 'mep_events') { $cp = $value['event_tp']; $value['data']->set_price($cp); $new_price = $value['data']->get_price(); } - + } } @@ -234,6 +236,8 @@ add_filter( 'woocommerce_get_item_data', 'mep_display_custom_fields_text_cart', function mep_add_custom_fields_text_to_order_items( $item, $cart_item_key, $values, $order ) { +$eid = $values['event_id']; +if (get_post_type($eid) == 'mep_events') { $mep_events_extra_prices = $values['event_extra_option']; $event_user_info = $values['event_user_info']; $event_ticket_type = $values['event_ticket_type']; @@ -275,6 +279,6 @@ update_post_meta( $product_id, "mep_xtra_$tck_name",$ntesqt); $item->add_meta_data('_event_user_info',$event_user_info); - +} } add_action( 'woocommerce_checkout_create_order_line_item', 'mep_add_custom_fields_text_to_order_items', 10, 4 ); \ No newline at end of file diff --git a/readme.txt b/readme.txt index 60a2ea4..fb42ebf 100644 --- a/readme.txt +++ b/readme.txt @@ -248,6 +248,6 @@ You can display the event list on any page by using the ShortCode. Just use this *= 2.2.0 = *Update Release, Fixed no numeric error, and add feature to hide available seat count. 29 Nov 2018* -*= 2.2.1 = +*= 2.2.1 & 2.2.2 = *Update Release, fixed cart wrong calculation issue. 02 Dec 2018* diff --git a/woocommerce-event-press.php b/woocommerce-event-press.php index 8609f0b..2b3a2af 100644 --- a/woocommerce-event-press.php +++ b/woocommerce-event-press.php @@ -3,7 +3,7 @@ * Plugin Name: Woocommerce Events Manager * Plugin URI: http://mage-people.com * Description: A Complete Event Solution for WordPress by MagePeople.. -* Version: 2.2.1 +* Version: 2.2.2 * Author: MagePeople Team * Author URI: http://www.mage-people.com/ * Text Domain: mage-eventpress