echo '<script type="text/javascript" >wpshop(document).ready(function(){setTimeout(function(){ wpshop("#wpshopMessage_unit").removeClass("wpshopPageMessage_Updated"); wpshop("#wpshopMessage_unit").html(""); }, 5000);});</script><div class="fade below-h2 wpshopPageMessage wpshopPageMessage_Updated" id="wpshopMessage_unit">' . $save_message . '</div>' . wpshop_attributes_unit::unit_group_list(); break; } break; case 'products_by_criteria': // If a filter by attribute is found, recalcul the products that matching it if (!empty($_REQUEST['attr'])) { $att = explode(':', $_REQUEST['attr']); $products_id = wpshop_products::get_products_matching_attribute($att[0], $att[1]); } $products_id = !empty($products_id) ? $products_id : $_REQUEST['pid']; $page_number = $_REQUEST['page_number']; if (!empty($_GET['page_product'])) { $page_number = wpshop_tools::varSanitizer($_GET['page_product']); } $data = wpshop_products::wpshop_get_product_by_criteria($_REQUEST['criteria'], $_REQUEST['cid'], $products_id, $_REQUEST['display_type'], $_REQUEST['order'], $page_number, $_REQUEST['products_per_page']); if ($data[0]) { echo json_encode(array(true, do_shortcode($data[1]))); } else { echo json_encode(array(false, __('No product found', 'wpshop'))); } break; case 'ajax_sendMessage': if (!empty($_REQUEST['postid']) && !empty($_REQUEST['title']) && !empty($_REQUEST['message']) && !empty($_REQUEST['recipient'])) { $user_info = get_userdata($_REQUEST['recipient']); $first_name = $user_info->user_firstname; $last_name = $user_info->user_lastname; $data = array('customer_first_name' => $first_name, 'customer_last_name' => $last_name); $wps_message_ctr = new wps_message_ctr(); $title = $wps_message_ctr->customMessage($_REQUEST['title'], $data); $message = $wps_message_ctr->customMessage($_REQUEST['message'], $data);