This commit is contained in:
magepeopleteam 2021-03-02 12:27:25 +00:00
parent cdb2c63ade
commit 56e5b673ee
8 changed files with 80 additions and 30 deletions

View File

@ -149,7 +149,6 @@ function mep_display_custom_fields_text_cart($item_data, $cart_item)
<?php
}
if (is_array($ticket_type_arr) && sizeof($ticket_type_arr) > 0) {
// echo $eid;
echo mep_cart_display_ticket_type_list($ticket_type_arr, $eid);
}
if (is_array($event_extra_service) && sizeof($event_extra_service) > 0) {

View File

@ -2424,11 +2424,7 @@ if (!function_exists('get_event_list_js')) {
});
jQuery('#rowtotal_<?php echo $id; ?>').val(total);
total = total.toFixed(2);
let total_part=total.toString().split(".");
total_part[0] = total_part[0].replace(/\B(?=(\d{3})+(?!\d))/g, "<?php echo wc_get_price_thousand_separator(); ?>");
total=total_part.join("<?php echo wc_get_price_decimal_separator(); ?>");
jQuery('#usertotal_<?php echo $id; ?>').html("<?php if($currency_pos=="left"){ echo get_woocommerce_currency_symbol(); } ?>" + total + "<?php if($currency_pos=="right"){ echo get_woocommerce_currency_symbol(); } ?>");
jQuery('#usertotal_<?php echo $id; ?>').html(mp_event_wo_commerce_price_format(total));
}).change(); //trigger change event on page load
@ -3102,15 +3098,7 @@ function mep_single_page_js_script($event_id){
});
//Fix 27.10.2020 Tony
jQuery('#rowtotal').val(total);
total = total.toFixed(2);
let total_part=total.toString().split(".");
total_part[0] = total_part[0].replace(/\B(?=(\d{3})+(?!\d))/g, "<?php echo wc_get_price_thousand_separator(); ?>");
total=total_part.join("<?php echo wc_get_price_decimal_separator(); ?>");
jQuery('#usertotal').html("<?php if ($currency_pos == "left" || $currency_pos == 'left_space') {
echo get_woocommerce_currency_symbol();
} ?>" + total + "<?php if ($currency_pos == "right" || $currency_pos == 'right_space') {
echo get_woocommerce_currency_symbol();
} ?>");
jQuery('#usertotal').html(mp_event_wo_commerce_price_format(total));
}).change(); //trigger change event on page load
<?php
@ -3629,6 +3617,12 @@ function mep_get_event_add_cart_sec($post_id){
?>
<input type='hidden' id='rowtotal' value="<?php echo get_post_meta($post_id, "_price", true); ?>" />
<input type="hidden" name='currency_symbol' value="<?php echo get_woocommerce_currency_symbol(); ?>">
<input type="hidden" name='currency_position' value="<?php echo get_option('woocommerce_currency_pos'); ?>">
<input type="hidden" name='currency_decimal' value="<?php echo wc_get_price_decimal_separator(); ?>">
<input type="hidden" name='currency_thousands_separator' value="<?php echo wc_get_price_thousand_separator(); ?>">
<input type="hidden" name='currency_number_of_decimal' value="<?php echo wc_get_price_decimals(); ?>">
<!--The Add to cart button table start Here-->
<table class='table table-bordered mep_event_add_cart_table'>
<tr>
@ -3668,3 +3662,14 @@ function mep_default_sidebar_reg() {
) );
}
add_action( 'widgets_init', 'mep_default_sidebar_reg' );
// add_action('mep_after_social_share_list','mep_custom_share_btn');
// function mep_custom_share_btn($event_id){
// ?>
<!-- <li><a href="https://api.whatsapp.com/send?text=<?php echo get_the_title($event_id).' '; ?><?php echo get_the_permalink($event_id); ?>" target="_blank"><i class="fab fa-whatsapp"></i></a></li> -->
<!-- // <li><a href="mailto:?subject=I wanted you to see this site&amp;body=<?php echo get_the_title($event_id).' '; ?><?php echo get_the_permalink($event_id); ?>" title="Share by Email"> <i class="fa fa-envelope"></i></a></li> -->
<?php
// }

View File

@ -127,6 +127,12 @@ if (!function_exists('mep_get_event_reg_btn')) {
?>
<input type='hidden' id='rowtotal' value="<?php echo get_post_meta($post_id, "_price", true); ?>" />
<input type="hidden" name='currency_symbol' value="<?php echo get_woocommerce_currency_symbol(); ?>">
<input type="hidden" name='currency_position' value="<?php echo get_option('woocommerce_currency_pos'); ?>">
<input type="hidden" name='currency_decimal' value="<?php echo wc_get_price_decimal_separator(); ?>">
<input type="hidden" name='currency_thousands_separator' value="<?php echo wc_get_price_thousand_separator(); ?>">
<input type="hidden" name='currency_number_of_decimal' value="<?php echo wc_get_price_decimals(); ?>">
<!--The Add to cart button table start Here-->
<table class='table table-bordered mep_event_add_cart_table'>
<tr>
@ -286,6 +292,12 @@ if (!function_exists('mep_get_event_reg_btn_list')) {
?>
<input type='hidden' id='rowtotal' value="<?php echo get_post_meta($post_id, "_price", true); ?>" />
<input type="hidden" name='currency_symbol' value="<?php echo get_woocommerce_currency_symbol(); ?>">
<input type="hidden" name='currency_position' value="<?php echo get_option('woocommerce_currency_pos'); ?>">
<input type="hidden" name='currency_decimal' value="<?php echo wc_get_price_decimal_separator(); ?>">
<input type="hidden" name='currency_thousands_separator' value="<?php echo wc_get_price_thousand_separator(); ?>">
<input type="hidden" name='currency_number_of_decimal' value="<?php echo wc_get_price_decimals(); ?>">
<!--The Add to cart button table start Here-->
<table class='table table-bordered mep_event_add_cart_table'>
<tr>

View File

@ -1,3 +1,29 @@
function mp_event_wo_commerce_price_format(price) {
let currency_position = jQuery('input[name="currency_position"]').val();
let currency_symbol = jQuery('input[name="currency_symbol"]').val();
let currency_decimal = jQuery('input[name="currency_decimal"]').val();
let currency_thousands_separator = jQuery('input[name="currency_thousands_separator"]').val();
let currency_number_of_decimal = jQuery('input[name="currency_number_of_decimal"]').val();
let price_text = '';
price = price.toFixed(currency_number_of_decimal);
console.log('price= '+ price);
let total_part = price.toString().split(".");
total_part[0] = total_part[0].replace(/\B(?=(\d{3})+(?!\d))/g, currency_thousands_separator);
price = total_part.join(currency_decimal);
if (currency_position === 'right') {
price_text = price + currency_symbol;
} else if (currency_position === 'right_space') {
price_text = price + '&nbsp;' + currency_symbol;
} else if (currency_position === 'left') {
price_text = currency_symbol + price;
} else {
price_text = currency_symbol + '&nbsp;' + price;
}
console.log('price= '+ price_text);
return price_text;
}
(function ($) {
//added by sumon
$(document).on('click', '.mp_event_visible_event_time', function (e) {

View File

@ -714,3 +714,8 @@ Early bird feature added in ticket type
Bug fixed
Hook added
25 Feb 2021*
= 3.4.6=
* Update Release:
Total Price 0 issue fixed
02 March 2021*

View File

@ -13,6 +13,7 @@
$total_sold = (int) mep_extra_service_sold($post_id, $field['option_name'], $event_date);
$ext_left = ($total_extra_service - $total_sold);
$tic_price=mep_get_price_including_tax($post_id, $field['option_price']);
$actual_price=strip_tags(wc_price(mep_get_price_including_tax($post_id, $field['option_price'])));
$data_price=str_replace(get_woocommerce_currency_symbol(), '', $actual_price);
$data_price=str_replace(wc_get_price_thousand_separator(), '', $data_price);
@ -49,7 +50,7 @@
</td>
<td class="mage_text_center"><?php echo wc_price(mep_get_price_including_tax($post_id, $field['option_price']));
if ($ext_left > 0) { ?>
<p style="display: none;" class="price_jq"><?php echo $data_price > 0 ? $data_price : 0; ?></p>
<p style="display: none;" class="price_jq"><?php echo $tic_price > 0 ? $tic_price : 0; ?></p>
<input type="hidden" name='event_extra_service_name[]' value='<?php echo $field['option_name']; ?>'>
<input type="hidden" name='event_extra_service_price[]' value='<?php echo $field['option_price']; ?>'>
<?php } ?>

View File

@ -11,7 +11,9 @@
<?php echo mep_get_option('mep_ticket_qty_text', 'label_setting_sec') ? mep_get_option('mep_ticket_qty_text', 'label_setting_sec') : _e('Ticket Qty:', 'mage-eventpress'); ?>
</span>
<?php
$tic_price=mep_get_price_including_tax($post_id,$ticket_price);
$actual_price=strip_tags(wc_price(mep_get_price_including_tax($post_id,$ticket_price)));
$data_price=str_replace(get_woocommerce_currency_symbol(), '', $actual_price);
$data_price=str_replace(wc_get_price_thousand_separator(), '', $data_price);
$data_price=str_replace(wc_get_price_decimal_separator(), '.', $data_price);
@ -48,7 +50,7 @@
<?php echo mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') ? mep_get_option('mep_per_ticket_price_text', 'label_setting_sec') : _e('Per Ticket Price:', 'mage-eventpress'); ?>
</span> <strong><?php echo wc_price(mep_get_price_including_tax($post_id,$ticket_price)); ?></strong>
<?php if ($total_seats > 0) { ?>
<p style="display: none;" class="price_jq"><?php echo $data_price > 0 ? $data_price : 0; ?></p>
<p style="display: none;" class="price_jq"><?php echo $tic_price > 0 ? $tic_price : 0; ?></p>
<?php } ?>
</td>

View File

@ -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: 3.4.5
* Version: 3.4.6
* Author: MagePeople Team
* Author URI: http://www.mage-people.com/
* Text Domain: mage-eventpress