public function vtmin_create_text_error_message($i) { global $vtmin_setup_options, $vtmin_cart, $vtmin_rules_set, $vtmin_rule, $vtmin_info; $vtmin_rules_set[$i]->rule_requires_cart_action = 'yes'; //v1.08 begin if ($vtmin_rules_set[$i]->custMsg_text > ' ') { //custom msg override $vtmin_cart->error_messages[] = array('msg_from_this_rule_id' => $vtmin_rules_set[$i]->post_id, 'msg_from_this_rule_occurrence' => $i, 'msg_text' => $vtmin_rules_set[$i]->custMsg_text, 'msg_is_custom' => 'yes'); $this->vtmin_set_custom_msgs_status('customMsg'); return; } //v1.08 end if ($vtmin_setup_options['show_error_messages_in_table_form'] == 'yes') { $vtmin_info['error_message_needed'] = 'yes'; // $vtmin_cart->error_messages[] = array ('msg_from_this_rule_id' => $vtmin_rules_set[$i]->post_id, 'msg_from_this_rule_occurrence' => $i,'msg_text' => '' ); } else { //SHOW PRODUCT NAME(S) IN ERROR $message; //initialize $message switch ($vtmin_rules_set[$i]->inpop_selection) { case 'cart': $message .= __('<span class="errmsg-begin">Minimum Purchase Required -</span> for ', 'vtmin'); //mwnt switch ($vtmin_rules_set[$i]->specChoice_in_selection) { case 'all': //$message .= __('all', 'vtmin'); break; case 'each': $message .= __('each of', 'vtmin'); break; case 'any': $message .= __('each of', 'vtmin'); break; } $message .= __(' the product(s) in this group: <span class="red-font-italic">', 'vtmin'); //mwnt $message .= $this->vtmin_list_out_product_names($i); $message .= __('</span>', 'vtmin'); break; case 'groups': $message .= __('<span class="errmsg-begin">Minimum Purchase Required -</span> for ', 'vtmin'); //mwnt // mwnt begin switch ($vtmin_rules_set[$i]->specChoice_in_selection) { case 'all': $message .= __(' the products in this group: <span class="red-font-italic">', 'vtmin'); break; default: $message .= __(' this product: <span class="red-font-italic">', 'vtmin'); break; } //mwnt end // $message .= __(' the products in this group: <span class="red-font-italic">', 'vtmin'); //mwnt $message .= $this->vtmin_list_out_product_names($i); $message .= __('</span>', 'vtmin'); break; case 'vargroup': $message .= __('<span class="errmsg-begin">Minimum Purchase Required -</span> for ', 'vtmin'); //mwnt switch ($vtmin_rules_set[$i]->specChoice_in_selection) { case 'all': //$message .= __('all', 'vtmin'); break; case 'each': $message .= __('each of', 'vtmin'); break; case 'any': $message .= __('each of', 'vtmin'); break; } $message .= __(' the products in this group: <span class="red-font-italic">', 'vtmin'); //mwnt $message .= $this->vtmin_list_out_product_names($i); $message .= __('</span>', 'vtmin'); break; case 'single': $message .= __('For this product: <span class="red-font-italic">"', 'vtmin'); //mwnt $message .= $vtmin_rules_set[$i]->errProds_names[0]; $message .= __('"</span> ', 'vtmin'); break; } //SHOW TARGET MIN $/QTY AND CURRENTLY REACHED TOTAL if ($vtmin_rules_set[$i]->amtSelected_selection == 'currency') { $message .= __('<br /><span class="errmsg-text">A minimum of <span class="errmsg-amt-required"> ', 'vtmin'); //mwnt $message .= vtmin_format_money_element($vtmin_rules_set[$i]->minimum_amt['value']); // $message .= $vtmin_rules_set[$i]->minimum_amt['value']; mwnt // $message .= __(' total dollars</span> must be purchased. The current total ', 'vtmin'); mwnt switch ($vtmin_rules_set[$i]->specChoice_in_selection) { case 'all': $message .= __('</span> for the total group must be purchased. The current total ', 'vtmin'); //mwnt $message .= __('for all the products ', 'vtmin'); //$message .= __('for the products ', 'vtmin'); mwnt $message .= __('in the group is: <span class="errmsg-amt-current"> ', 'vtmin'); //mwnt break; default: //each or any $message .= __('</span> for this product must be purchased. The current total ', 'vtmin'); //mwnt $message .= __('for this product is: ', 'vtmin'); //$message .= __('for this product ', 'vtmin'); mwnt break; //case 'any': // $message .= __(' dollars</span> for each product in the group must be purchased. The current total ', 'vtmin'); //mwnt // $message .= __('for each product ', 'vtmin'); //$message .= __('for this product ', 'vtmin'); mwnt // break; } //$message .= __('in the group is: <span class="errmsg-amt-current"> ', 'vtmin'); //mwnt $message .= vtmin_format_money_element($vtmin_rules_set[$i]->errProds_total_price); //mwnt $message .= __(' </span></span> ', 'vtmax'); //mwnt //mwnt begin //$message .= $vtmin_rules_set[$i]->errProds_total_price; //if ($vtmin_rules_set[$i]->errProds_total_price > 1 ) { // $message .= __(' dollars.</span></span> ', 'vtmin'); //} else { // $message .= __(' dollar.</span></span> ', 'vtmin'); //} mwnt end } else { $message .= __('<br /><span class="errmsg-text">A minimum quantity of <span class="errmsg-amt-required"> ', 'vtmin'); //mwnt $message .= $vtmin_rules_set[$i]->minimum_amt['value']; //$message .= __(' total units</span> must be purchased. The current total ', 'vtmin'); mwnt switch ($vtmin_rules_set[$i]->specChoice_in_selection) { case 'all': $message .= __(' units</span> for the total group must be purchased. The current total ', 'vtmin'); //mwnt $message .= __('for all the products ', 'vtmin'); //$message .= __('for the products ', 'vtmin'); mwnt $message .= __('in the group is: <span class="errmsg-amt-current"> ', 'vtmin'); //mwnt break; default: //each or any $message .= __(' units</span> for each product in the group must be purchased. The current total ', 'vtmin'); //mwnt $message .= __('for this product is: ', 'vtmin'); //$message .= __('for this product ', 'vtmin'); mwnt break; // case 'any': // $message .= __(' units</span> for each product in the group must be purchased. The current total ', 'vtmin'); //mwnt // $message .= __('for each product ', 'vtmin'); //$message .= __('for this product ', 'vtmin'); mwnt // break; } //$message .= __('in the group is: <span class="errmsg-amt-current"> ', 'vtmin'); //mwnt $message .= $vtmin_rules_set[$i]->errProds_qty; if ($vtmin_rules_set[$i]->errProds_qty > 1) { $message .= __(' units.</span></span> ', 'vtmin'); } else { $message .= __(' unit.</span></span> ', 'vtmin'); } } //show rule id in error msg if ($vtmin_setup_options['show_rule_ID_in_errmsg'] == 'yes' || $vtmin_setup_options['debugging_mode_on'] == 'yes') { $message .= __('<span class="rule-id"> (Rule ID = ', 'vtmin'); $message .= $vtmin_rules_set[$i]->post_id; $message .= __(') </span>', 'vtmin'); } //SHOW CATEGORIES TO WHICH THIS MSG APPLIES IN GENERAL, IF RELEVANT if ($vtmin_rules_set[$i]->inpop_selection != 'single' && sizeof($vtmin_rules_set[$i]->errProds_cat_names) > 0) { $vtmin_rules_set[$i]->errProds_size = sizeof($vtmin_rules_set[$i]->errProds_cat_names); $message .= __('<br />:: <span class="black-font">The minimum purchase rule applies to any products in the following categories: </span><span class="black-font-italic">', 'vtmin'); for ($k = 0; $k < $vtmin_rules_set[$i]->errProds_size; $k++) { $message .= __(' "', 'vtmin'); $message .= $vtmin_rules_set[$i]->errProds_cat_names[$k]; $message .= __('" ', 'vtmin'); // if ( $k < $vtmin_rules_set[$i]->errProds_size ) { //mwnt $message .= __('</span>', 'vtmin'); // } } //$message .= __('" ', 'vtmin'); //mwnt } //queue the message to go back to the screen $vtmin_cart->error_messages[] = array('msg_from_this_rule_id' => $vtmin_rules_set[$i]->post_id, 'msg_from_this_rule_occurrence' => $i, 'msg_text' => $message, 'msg_is_custom' => 'no'); $this->vtmin_set_custom_msgs_status('standardMsg'); //v1.08 } //end text message formatting /* if ( $vtmin_setup_options['debugging_mode_on'] == 'yes' ){ echo '$message'; echo '<pre>'.print_r($message, true).'</pre>' ; echo '$vtmin_rules_set[$i]->errProds_qty = '; echo '<pre>'.print_r($vtmin_rules_set[$i]->errProds_qty, true).'</pre>' ; echo '$vtmin_rules_set[$i]->errProds_total_price = ' ; echo '<pre>'.print_r($vtmin_rules_set[$i]->errProds_total_price, true).'</pre>' ; echo '$vtmin_rules_set[$i]->errProds_names = '; echo '<pre>'.print_r($vtmin_rules_set[$i]->errProds_names, true).'</pre>' ; echo '$vtmin_rules_set[$i]->errProds_cat_names = '; echo '<pre>'.print_r($vtmin_rules_set[$i]->errProds_cat_names, true).'</pre>' ; } */ }
public function vtmin_table_text_line($i) { global $vtmin_setup_options, $vtmin_cart, $vtmin_rules_set, $vtmin_rule, $vtmin_info; $message_text; $vtmin_info['line_cnt']++; //SHOW TARGET MIN $/QTY AND CURRENTLY REACHED TOTAL $message_text .= __('<span class="table-error-msg"><span class="bold-this color-grp', 'vtmin'); $message_text .= $vtmin_info['cart_color_cnt']; //append the count which corresponds to a css color... $message_text .= __('">', 'vtmin'); $message_text .= __('Error => ', 'vtmin'); //v1.09.6 begin if ($vtmin_rules_set[$i]->repeatingGroups > 0) { //v1.09.7 $message_text .= __('</span>Minimum Purchase/Repeating Groups ', 'vtmin'); //end "color-grp" } else { $message_text .= __('</span>Minimum Purchase ', 'vtmin'); //end "color-grp" } //v1.09.6 end if ($vtmin_rules_set[$i]->amtSelected_selection == 'currency') { if ($vtmin_rules_set[$i]->specChoice_in_selection == 'all') { $message_text .= __('total', 'vtmin'); } } else { $message_text .= __(' <span class="color-grp', 'vtmin'); $message_text .= $vtmin_info['cart_color_cnt']; //append the count which corresponds to a css color... $message_text .= __('">', 'vtmin'); $message_text .= __('quantity</span>', 'vtmin'); //end "color-grp" } $message_text .= __(' of <span class="color-grp', 'vtmin'); $message_text .= $vtmin_info['cart_color_cnt']; //append the count which corresponds to a css color... $message_text .= __('">', 'vtmin'); if ($vtmin_rules_set[$i]->amtSelected_selection == 'currency') { $message_text .= vtmin_format_money_element($vtmin_rules_set[$i]->minimum_amt['value']); $message_text .= __('</span> required ', 'vtmin'); //if branch end "color-grp" } else { $message_text .= $vtmin_rules_set[$i]->minimum_amt['value']; $message_text .= __(' </span>units required ', 'vtmin'); //if branch end "color-grp" } switch ($vtmin_rules_set[$i]->inpop_selection) { case 'single': $message_text .= __('for this product.', 'vtmin'); break; case 'vargroup': $message_text .= __('for this product.', 'vtmin'); break; case 'groups': switch ($vtmin_rules_set[$i]->specChoice_in_selection) { case 'all': $message_text .= __('for this group.', 'vtmin'); break; case 'each': $message_text .= __('of each product within the product group.', 'vtmin'); break; case 'any': $message_text .= __('for the first ', 'vtmin'); $message_text .= __('<span class="color-grp', 'vtmin'); $message_text .= $vtmin_info['cart_color_cnt']; //append the count which corresponds to a css color... $message_text .= __('">', 'vtmin'); $message_text .= $vtmin_rules_set[$i]->anyChoice_max['value']; $message_text .= __(' </span>product(s) found within the product group.', 'vtmin'); //end "color-grp" break; } break; case 'cart': switch ($vtmin_rules_set[$i]->specChoice_in_selection) { case 'all': $message_text .= __('for the cart.', 'vtmin'); break; case 'each': $message_text .= __('of each product the cart.', 'vtmin'); break; case 'any': $message_text .= __('for the first ', 'vtmin'); $message_text .= __('<span class="color-grp', 'vtmin'); $message_text .= $vtmin_info['cart_color_cnt']; //append the count which corresponds to a css color... $message_text .= __('">', 'vtmin'); $message_text .= $vtmin_rules_set[$i]->anyChoice_max['value']; $message_text .= __(' </span>product(s) found within the cart.', 'vtmin'); //end "color-grp" break; } break; } //show rule id in error msg if ($vtmin_setup_options['show_rule_ID_in_errmsg'] == 'yes' || $vtmin_setup_options['debugging_mode_on'] == 'yes') { $message_text .= __('<span class="rule-id"> (Rule ID = ', 'vtmin'); $message_text .= $vtmin_rules_set[$i]->post_id; $message_text .= __(') </span>', 'vtmin'); } $message_text .= __('</span>', 'vtmin'); //end "table-error-msg" //SHOW CATEGORIES TO WHICH THIS MSG APPLIES IN GENERAL, IF RELEVANT if ($vtmin_rules_set[$i]->inpop_selection != 'single' && sizeof($vtmin_rules_set[$i]->errProds_cat_names) > 0) { $vtmin_info['line_cnt']++; $message_text .= __('<span class="table-text-line">', 'vtmin'); $vtmin_rules_set[$i]->errProds_size = sizeof($vtmin_rules_set[$i]->errProds_cat_names); $message_text .= __('<span class="table-text-cats">The minimum purchase rule applies to any products in the following categories: </span><span class="black-font-italic">', 'vtmin'); for ($k = 0; $k < $vtmin_rules_set[$i]->errProds_size; $k++) { $message_text .= __(' "', 'vtmin'); $message_text .= $vtmin_rules_set[$i]->errProds_cat_names[$k]; $message_text .= __('" ', 'vtmin'); } $message_text .= __('</span>', 'vtmin'); //end "table-text-cats" $message_text .= __('</span>', 'vtmin'); //end "table-text-line" } return $message_text; }