get_data()['slug']; $wdp_item_ID = $item->get_ID(); $table_sort = get_option('awdp_table_sort') ? get_option('awdp_table_sort') : ''; $variation_check = $rule['variation_check']; $parent_id = $item->get_parent_id(); $rules_to_validate = ['cart_total_amount', 'cart_total_amount_all_prods', 'product_price']; $cart_total = 0; $updated_product_price = 0; $act_qnty = 0; $discount_pt = 0; $wdp_cart_totals = 0; $wdp_cart_items = 0; $wdp_cart_quantity = 0; $discount_amt = 0; $wdp_applicable_ids = []; $discount = $tr_qn = $tr_pr = ''; $price = $discountedPrice ? $discountedPrice : $price; // Values $value_display = get_option('awdp_table_value') ? get_option('awdp_table_value') : ''; $value_display_text_hide = get_option('awdp_table_value_notext') ? get_option('awdp_table_value_notext') : 0; /* * WPML Label * Version 4.0.5 */ $langSettings = get_option('awdp_settings_lang_options') ? get_option('awdp_settings_lang_options') : []; if ( !empty ($langSettings) && array_key_exists ( $currentLang, $langSettings ) ) { $awdp_pc_title = array_key_exists ( 'pricing_title', $langSettings[$currentLang] ) ? $langSettings[$currentLang]['pricing_title'] : ( get_option('awdp_pc_title') ? get_option('awdp_pc_title') : __("Quantity Discounts", "aco-woo-dynamic-pricing") ); $awdp_pc_label = array_key_exists ( 'pricing_price_label', $langSettings[$currentLang] ) ? $langSettings[$currentLang]['pricing_price_label'] : ( get_option('awdp_pc_label') ? get_option('awdp_pc_label') : __("Price", "aco-woo-dynamic-pricing") ); $awdp_qn_label = array_key_exists ( 'pricing_quantity_label', $langSettings[$currentLang] ) ? $langSettings[$currentLang]['pricing_quantity_label'] : ( get_option('awdp_qn_label') ? get_option('awdp_qn_label') : __("Quantity", "aco-woo-dynamic-pricing") ); $awdp_nw_label = array_key_exists ( 'pricing_new_label', $langSettings[$currentLang] ) ? $langSettings[$currentLang]['pricing_new_label'] : ( get_option('awdp_new_label') ? get_option('awdp_new_label') : __("Price", "aco-woo-dynamic-pricing") ); $value_display_text = array_key_exists ( 'tablevaluetext', $langSettings[$currentLang] ) ? $langSettings[$currentLang]['tablevaluetext'] : get_option('awdp_table_value_text'); $discount_description = array_key_exists ( 'discount_description', $langSettings[$currentLang] ) ? $langSettings[$currentLang]['discount_description'] : get_option('awdp_discount_description'); $discount_item_description = array_key_exists ( 'discount_item_description', $langSettings[$currentLang] ) ? $langSettings[$currentLang]['discount_item_description'] : get_option('awdp_discount_item_description'); } else { $awdp_pc_title = get_option('awdp_pc_title') ? get_option('awdp_pc_title') : __("Quantity Discounts", "aco-woo-dynamic-pricing"); $awdp_pc_label = get_option('awdp_pc_label') ? get_option('awdp_pc_label') : __("Price", "aco-woo-dynamic-pricing"); $awdp_qn_label = get_option('awdp_qn_label') ? get_option('awdp_qn_label') : __("Quantity", "aco-woo-dynamic-pricing"); $awdp_nw_label = get_option('awdp_new_label') ? get_option('awdp_new_label') : __("Price", "aco-woo-dynamic-pricing"); $value_display_text = get_option('awdp_table_value_text') ? get_option('awdp_table_value_text') : ''; $discount_description = get_option('awdp_discount_description') ? get_option('awdp_discount_description') : ''; $discount_item_description = get_option('awdp_discount_item_description') ? get_option('awdp_discount_item_description') : ''; } /* End WPML */ // Pricing table texts $prcn_text = ( !$value_display_text_hide ) ? ( ( ( $value_display == 'discount_value' || $value_display == 'discount_both' ) && $value_display_text ) ? ' '.$value_display_text : __('% OFF', 'aco-woo-dynamic-pricing') ) : ''; $fxd_text = ( !$value_display_text_hide ) ? ( ( ( $value_display == 'discount_value' || $value_display == 'discount_both' ) && $value_display_text ) ? ' '.$value_display_text : __(' OFF on cart value', 'aco-woo-dynamic-pricing') ) : ''; $fxd_text_two = ( !$value_display_text_hide ) ? ( ( ( $value_display == 'discount_value' || $value_display == 'discount_both' ) && $value_display_text ) ? ' '.$value_display_text : __(' OFF', 'aco-woo-dynamic-pricing') ) : ''; $cart_text = ( !$value_display_text_hide ) ? ( ( ( $value_display == 'discount_value' || $value_display == 'discount_both' ) && $value_display_text ) ? ' '.$value_display_text : __(' will be deducted from cart', 'aco-woo-dynamic-pricing') ) : ''; $list_id = ( array_key_exists('product_list', $rule) && $rule['product_list'] ) ? $rule['product_list'] : ''; // Check current product $prod_validate = call_user_func_array ( array ( new AWDP_Discount(), 'validate_discount_rules' ), array ( $item, $rule, $rules_to_validate, $item, true ) ); if ( !$prod_validate ) { return $table; } // End Check // Checking if Product List is Active / Cart rules Validation if ( $list_id && $list_id != 'null' && array_key_exists( $list_id, $prodLists ) && $prodLists[$list_id] && isset ( WC()->cart ) && WC()->cart->get_cart_contents_count() > 0 ) { $applicable_products = $prodLists[$list_id]; $cart_items = WC()->cart->get_cart(); if ($cart_items) { foreach ($cart_items as $cart_item) { if (in_array($cart_item['product_id'], $applicable_products)) { $validate = call_user_func_array ( array ( new AWDP_Discount(), 'validate_discount_rules' ), array ( $cart_item, $rule, $rules_to_validate, $cart_item, true ) ); if ( $validate ) { $product_data = $cart_item['data']->get_data(); // $wdp_cart_totals = $wdp_cart_totals + $product_data['price'] * $cart_item['quantity']; $wdp_cart_totals = $wdp_cart_totals + $cart_item['data']->get_price() * $cart_item['quantity']; $wdp_cart_items = $wdp_cart_items + $cart_item['quantity']; $wdp_cart_quantity = $wdp_cart_quantity + 1; $wdp_applicable_ids[] = $cart_item['data']->get_slug(); } } } } } else if ( isset ( WC()->cart ) && WC()->cart->get_cart_contents_count() > 0 ) { // Cart rules Validation $cart_items = WC()->cart->get_cart(); if ($cart_items) { foreach ($cart_items as $cart_item) { $validate = call_user_func_array ( array ( new AWDP_Discount(), 'validate_discount_rules' ), array ( $cart_item, $rule, $rules_to_validate, $cart_item, true ) ); if ( $validate ) { $product_data = $cart_item['data']->get_data(); // $wdp_cart_totals = $wdp_cart_totals + $product_data['price'] * $cart_item['quantity']; $wdp_cart_totals = $wdp_cart_totals + $cart_item['data']->get_price() * $cart_item['quantity']; $wdp_cart_items = $wdp_cart_items + $cart_item['quantity']; $wdp_cart_quantity = $wdp_cart_quantity + 1; $wdp_applicable_ids[] = $cart_item['data']->get_slug(); } } } } $wdp_applicable_ids = array_values ( array_unique ( $wdp_applicable_ids ) ); $last_key = end($quantity_rules); $max_range = $last_key["start_range"]; $pricing_table_price = wc_add_number_precision ( $price ); // Sort if ( $table_sort == 'descending_order' ) { array_multisort ( array_column ( $quantity_rules, "start_range" ), SORT_DESC, $quantity_rules ); } else { array_multisort ( array_column ( $quantity_rules, "start_range" ), SORT_ASC, $quantity_rules ); } // Variable Product — collect display prices (never treat variation IDs as prices). $variation_prices = []; if ( $item->is_type('variable') ) { if ( $discountProductMaxPrice && $discountProductMinPrice ) { array_push( $variation_prices, wc_add_number_precision ( (float) $discountProductMaxPrice ) ); array_push( $variation_prices, wc_add_number_precision ( (float) $discountProductMinPrice ) ); } else { $available_variations = $item->get_available_variations(); if ( ! empty( $available_variations ) ) { foreach ( $available_variations as $variation ) { if ( isset( $variation['display_price'] ) && $variation['display_price'] !== '' ) { array_push( $variation_prices, wc_add_number_precision( (float) $variation['display_price'] ) ); } } } if ( empty( $variation_prices ) ) { foreach ( $item->get_children() as $child_id ) { $child = wc_get_product( $child_id ); if ( ! $child || $child->get_price() === '' ) { continue; } $child_price = ( 'incl' === get_option( 'woocommerce_tax_display_shop' ) ) ? wc_get_price_including_tax( $child ) : wc_get_price_excluding_tax( $child ); if ( $child_price !== '' && (float) $child_price > 0 ) { $variation_prices[] = wc_add_number_precision( (float) $child_price ); } } } // Last resort: parent/min price already resolved for the table. if ( empty( $variation_prices ) && $price > 0 ) { $variation_prices[] = wc_add_number_precision( (float) $price ); } } } $var_price_display = !empty ( $variation_prices ) ? json_encode($variation_prices) : ''; if ( $quantity_type == 'type_cart' ) { /* * Individual Cart Quantity Rule */ if ( $table_layout == 'horizontal' ) { $table .= '
| ' . $awdp_qn_label . '*' . ' | '; $tr_pr = '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' . $awdp_pc_label . ' | '; if ( $value_display == 'discount_both' ) { $tr_nw = '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' . $awdp_nw_label . ' | '; } } else { if ( $value_display == 'discount_both' ) { $table .= '
| ' . $awdp_qn_label . '*' . ' | ' . $awdp_pc_label . ' | ' . $awdp_nw_label . ' |
| ' . $awdp_qn_label . '*' . ' | ' . $awdp_pc_label . ' | ' . $quantity_rule['start_range'] . ' | '; } else if ($quantity_rule['end_range']) { $tr_qn .= '' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | '; } else { $tr_qn .= '' . $quantity_rule['start_range'] . ' + | '; } if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $tr_pr .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $tr_pr .= '' . wc_price((float)$discount_val) . $fxd_text . ' | '; } } else if ( $value_display == 'discount_both' ) { // Display Both Price and Value if ($discount_typ == 'percentage') { $tr_pr .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $tr_pr .= '' . wc_price((float)$discount_val) . $fxd_text . ' | '; } if ( $discounted_new_min_price == $discounted_new_max_price ) { $tr_nw .= '' . $discounted_new_min_price . ' | '; } else { $tr_nw .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ( $discounted_new_min_price == $discounted_new_max_price ) { $tr_pr .= '' . $discounted_new_min_price . ' | '; } else { $tr_pr .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } } else { if ( $quantity_rule['start_range'] == $quantity_rule['end_range'] ) { $table .= '
| ' . $quantity_rule['start_range'] . ' | '; if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text . ' | '; } } else if ( $value_display == 'discount_both' ) { if ( $discount_typ == 'percentage' ) { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text . ' | '; } if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } $table .= '
| ' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | '; if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text . ' | '; } } else if ( $value_display == 'discount_both' ) { if ( $discount_typ == 'percentage' ) { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text . ' | '; } if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } $table .= '
| ' . $quantity_rule['start_range'] . ' + | '; if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text . ' | '; } } else if ( $value_display == 'discount_both' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text . ' | '; } if ($discounted_new_min_price == $discounted_new_max_price) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ($discounted_new_min_price == $discounted_new_max_price) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } $table .= '' . $quantity_rule['start_range'] . ' | '; } else if ($quantity_rule['end_range']) { $tr_qn .= '' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | '; } else { $tr_qn .= '' . $quantity_rule['start_range'] . ' + | '; } $tr_pr .= '' . $discounted_new_price . ' | '; if ( $value_display == 'discount_both' ) { $tr_nw .= '' . $discounted_new_price_bt . ' | '; } } else { if ($quantity_rule['start_range'] == $quantity_rule['end_range']) { if ( $value_display == 'discount_both' ) { $table .= '
| ' . $quantity_rule['start_range'] . ' | ' . $discounted_new_price . ' | ' . $discounted_new_price_bt . ' | ||||||
| ' . $quantity_rule['start_range'] . ' | ' . $discounted_new_price . ' | |||||||
| ' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | ' . $discounted_new_price . ' | ' . $discounted_new_price_bt . ' | ||||||
| ' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | ' . $discounted_new_price . ' | |||||||
| ' . $quantity_rule['start_range'] . ' + | ' . $discounted_new_price . ' | ' . $discounted_new_price_bt . ' | ||||||
| ' . $quantity_rule['start_range'] . ' + | ' . $discounted_new_price . ' |
*'.$discount_description.'
' : '*'.$awdp_qn_label.' refers to discounted items (products with discount) individual count on cart.
'; $table .= '| ' . $awdp_qn_label . ' | '; $tr_pr = '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' . $awdp_pc_label . ' | '; if ( $value_display == 'discount_both' ) { $tr_nw = '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' . $awdp_nw_label . ' | '; } } else { if ( $value_display == 'discount_both' ) { $table .= '
| ' . $awdp_qn_label . '*' . ' | ' . $awdp_pc_label . ' | ' . $awdp_nw_label . ' |
| ' . $awdp_qn_label . ' | ' . $awdp_pc_label . ' | ' . $quantity_rule['start_range'] . ' | '; } else if ($quantity_rule['end_range']) { $tr_qn .= '' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | '; } else { $tr_qn .= '' . $quantity_rule['start_range'] . ' + | '; } if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $tr_pr .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $tr_pr .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } } else if ( $value_display == 'discount_both' ) { // Display Both Price and Value if ($discount_typ == 'percentage') { $tr_pr .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $tr_pr .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } if ( $discounted_new_min_price == $discounted_new_max_price ) { $tr_nw .= '' . $discounted_new_min_price . ' | '; } else { $tr_nw .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ( $discounted_new_min_price == $discounted_new_max_price ) { $tr_pr .= '' . $discounted_new_min_price . ' | '; } else { $tr_pr .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } } else { if ( $quantity_rule['start_range'] == $quantity_rule['end_range'] ) { $table .= '
| ' . $quantity_rule['start_range'] . ' | '; if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } } else if ( $value_display == 'discount_both' ) { if ( $discount_typ == 'percentage' ) { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } $table .= '
| ' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | '; if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } } else if ( $value_display == 'discount_both' ) { if ( $discount_typ == 'percentage' ) { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } $table .= '
| ' . $quantity_rule['start_range'] . ' + | '; if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } } else if ( $value_display == 'discount_both' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } if ($discounted_new_min_price == $discounted_new_max_price) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ($discounted_new_min_price == $discounted_new_max_price) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } $table .= '' . $quantity_rule['start_range'] . ' | '; } else if ($quantity_rule['end_range']) { $tr_qn .= '' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | '; } else { $tr_qn .= '' . $quantity_rule['start_range'] . ' + | '; } $tr_pr .= '' . $discounted_new_price . ' | '; if ( $value_display == 'discount_both' ) { $tr_nw .= '' . $discounted_new_price_bt . ' | '; } } else { if ($quantity_rule['start_range'] == $quantity_rule['end_range']) { if ( $value_display == 'discount_both' ) { $table .= '
| ' . $quantity_rule['start_range'] . ' | ' . $discounted_new_price . ' | ' . $discounted_new_price_bt . ' | ||||||
| ' . $quantity_rule['start_range'] . ' | ' . $discounted_new_price . ' | |||||||
| ' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | ' . $discounted_new_price . ' | ' . $discounted_new_price_bt . ' | ||||||
| ' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | ' . $discounted_new_price . ' | |||||||
| ' . $quantity_rule['start_range'] . ' + | ' . $discounted_new_price . ' | ' . $discounted_new_price_bt . ' | ||||||
| ' . $quantity_rule['start_range'] . ' + | ' . $discounted_new_price . ' |
*'.$discount_item_description.'
' : '*'.$awdp_qn_label.' refers to discounted items (products with discount) total quantity on cart.
'; $table .= '| ' . $awdp_qn_label . ' | '; $tr_pr = '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' . $awdp_pc_label . ' | '; if ( $value_display == 'discount_both' ) { $tr_nw = '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' . $awdp_nw_label . ' | '; } } else { if ( $value_display == 'discount_both' ) { $table .= '
| ' . $awdp_qn_label . '*' . ' | ' . $awdp_pc_label . ' | ' . $awdp_nw_label . ' |
| ' . $awdp_qn_label . ' | ' . $awdp_pc_label . ' | ' . $quantity_rule['start_range'] . ' | '; } else if ($quantity_rule['end_range']) { $tr_qn .= '' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | '; } else { $tr_qn .= '' . $quantity_rule['start_range'] . ' + | '; } if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $tr_pr .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $tr_pr .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } } else if ( $value_display == 'discount_both' ) { // Display Both Price and Value if ($discount_typ == 'percentage') { $tr_pr .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $tr_pr .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } if ( $discounted_new_min_price == $discounted_new_max_price ) { $tr_nw .= '' . $discounted_new_min_price . ' | '; } else { $tr_nw .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ( $discounted_new_min_price == $discounted_new_max_price ) { $tr_pr .= '' . $discounted_new_min_price . ' | '; } else { $tr_pr .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } } else { if ( $quantity_rule['start_range'] == $quantity_rule['end_range'] ) { $table .= '
| ' . $quantity_rule['start_range'] . ' | '; if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } } else if ( $value_display == 'discount_both' ) { if ( $discount_typ == 'percentage' ) { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } $table .= '
| ' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | '; if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } } else if ( $value_display == 'discount_both' ) { if ( $discount_typ == 'percentage' ) { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ( $discounted_new_min_price == $discounted_new_max_price ) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } $table .= '
| ' . $quantity_rule['start_range'] . ' + | '; if ( $value_display == 'discount_value' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } } else if ( $value_display == 'discount_both' ) { if ($discount_typ == 'percentage') { $table .= '' .(float)$discount_val . $prcn_text . ' | '; } else if ($discount_typ == 'fixed') { $table .= '' . wc_price((float)$discount_val) . $fxd_text_two . ' | '; } if ($discounted_new_min_price == $discounted_new_max_price) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } else { if ($discounted_new_min_price == $discounted_new_max_price) { $table .= '' . $discounted_new_min_price . ' | '; } else { $table .= '' . $discounted_new_min_price . ' - ' . $discounted_new_max_price . ' | '; } } $table .= '' . $quantity_rule['start_range'] . ' | '; } else if ($quantity_rule['end_range']) { $tr_qn .= '' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | '; } else { $tr_qn .= '' . $quantity_rule['start_range'] . ' + | '; } $tr_pr .= '' . $discounted_new_price . ' | '; if ( $value_display == 'discount_both' ) { $tr_nw .= '' . $discounted_new_price_bt . ' | '; } } else { if ($quantity_rule['start_range'] == $quantity_rule['end_range']) { if ( $value_display == 'discount_both' ) { $table .= '
| ' . $quantity_rule['start_range'] . ' | ' . $discounted_new_price . ' | ' . $discounted_new_price_bt . ' | ||||||
| ' . $quantity_rule['start_range'] . ' | ' . $discounted_new_price . ' | |||||||
| ' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | ' . $discounted_new_price . ' | ' . $discounted_new_price_bt . ' | ||||||
| ' . $quantity_rule['start_range'] . ' - ' . $quantity_rule['end_range'] . ' | ' . $discounted_new_price . ' | |||||||
| ' . $quantity_rule['start_range'] . ' + | ' . $discounted_new_price . ' | ' . $discounted_new_price_bt . ' | ||||||
| ' . $quantity_rule['start_range'] . ' + | ' . $discounted_new_price . ' |
'.__("Your Price", "aco-woo-dynamic-pricing").':
'.__("Total Price", "aco-woo-dynamic-pricing").':