Exemplo n.º 1
0
 public static function api_filter_product($hook, $response, $endpoint, $method)
 {
     $response['product'] = true;
     switch ($method) {
         case 'list':
             $search = isset($_REQUEST['search']) ? $_REQUEST['search'] : array();
             $response['products'] = module_product::get_products($search);
             break;
     }
     return $response;
 }
Exemplo n.º 2
0
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (!$module->can_i('view', 'Products') || !$module->can_i('edit', 'Products')) {
    redirect_browser(_BASE_HREF);
}
// hack to add a "group" option to the pagination results.
if (class_exists('module_group', false) && module_product::can_i('edit', 'Products')) {
    module_group::enable_pagination_hook(array('bulk_actions' => array('delete' => array('label' => 'Delete selected products', 'type' => 'delete', 'callback' => 'module_product::bulk_handle_delete'))));
}
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : array();
$products = module_product::get_products($search);
$heading = array('title' => 'Products', 'type' => 'h2', 'main' => true, 'button' => array());
if (module_product::can_i('create', 'Products')) {
    if (class_exists('module_import_export', false)) {
        $link = module_import_export::import_link(array('callback' => 'module_product::handle_import', 'name' => 'Products', 'return_url' => $_SERVER['REQUEST_URI'], 'fields' => array('Product ID' => 'product_id', 'Product Name' => 'name', 'Product Category' => 'category_name', 'Hours/Qty' => 'quantity', 'Amount' => 'amount', 'Description' => 'description')));
        $heading['button'][] = array('title' => "Import Products", 'type' => 'add', 'url' => $link);
    }
    $heading['button'][] = array('title' => "Create New Product", 'type' => 'add', 'url' => module_product::link_open('new'));
}
print_heading($heading);
?>



<form action="" method="post">