예제 #1
0
                 $save_message = '<img class="wpshopPageMessage_Icon" alt="action error" src="' . WPSHOP_ERROR_ICON . '" />' . __('An error occured during unit group saving', 'wpshop');
             }
             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>' . $save_output;
             break;
         case 'delete_attribute_unit_group':
             $unit_id = wpshop_tools::varSanitizer($_REQUEST['elementIdentifier']);
             $save_output = '';
             $attribute_unit_informations['status'] = 'deleted';
             $attribute_unit_informations['last_update_date'] = date('Y-m-d H:i:s');
             $save_unit_result = wpshop_database::update($attribute_unit_informations, $unit_id, WPSHOP_DBT_ATTRIBUTE_UNIT_GROUP);
             if ($save_unit_result == 'done') {
                 $save_message = '<img class="wpshopPageMessage_Icon" alt="action succesful" src="' . WPSHOP_SUCCES_ICON . '" />' . __('The unit group has been deleted succesfully', 'wpshop');
             } else {
                 $save_message = '<img class="wpshopPageMessage_Icon" alt="action error" src="' . WPSHOP_ERROR_ICON . '" />' . __('An error occured during unit group deletion', 'wpshop');
             }
             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']);