function eStore_print_all_products_stylish($style = 1)
{
    $i = 0;
    //set pages to include $limit records per page
    $limit = get_option('eStore_products_per_page');
    if (empty($limit)) {
        $limit = 25;
    }
    if (isset($_GET['product_page'])) {
        $page = strip_tags($_GET['product_page']);
    } else {
        $page = 1;
    }
    $start = ($page - 1) * $limit;
    global $wpdb;
    $products_table_name = WP_ESTORE_PRODUCTS_TABLE_NAME;
    $wp_eStore_db = $wpdb->get_results("SELECT * FROM {$products_table_name} ORDER BY id DESC LIMIT {$start}, {$limit}", OBJECT);
    //get total rows
    $totalrows = $wpdb->get_var("SELECT COUNT(*) FROM {$products_table_name};");
    if ($wp_eStore_db) {
        foreach ($wp_eStore_db as $wp_eStore_db) {
            if ($style == 1) {
                $output .= show_product_fancy_style($wp_eStore_db->id);
            } else {
                if ($style == 2) {
                    $output .= show_product_fancy_style2($wp_eStore_db->id);
                }
            }
        }
    }
    $output .= wp_eStore_generate_pagination_section($totalrows, $limit);
    return $output;
}
示例#2
0
function eStore_fancy2($atts)
{
    extract(shortcode_atts(array('id' => 'no id'), $atts));
    return show_product_fancy_style2($id);
}