case 'PRODUCT_LIST_BUY_NOW':
                    $table_inner_array[] = array('case' => 'buy_now', 'products_buy_form_begin' => xos_draw_form('cart_quantity_' . $rows, xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('action')) . 'action=add_product', $request_type)), 'form_name' => 'cart_quantity_' . $rows, 'form_end' => '</form>', 'label_for_products_input_quantity' => 'products_quantity_' . $listing['products_id'], 'products_input_quantity' => xos_draw_input_field('products_quantity', '1', 'id="products_quantity_' . $listing['products_id'] . '" class="form-control input-quantity" maxlength="5"'), 'products_hidden_field' => xos_draw_hidden_field('p', $listing['products_id']));
                    break;
            }
        }
        $table_outer_array[] = array('table_inner' => $table_inner_array);
        unset($price_breaks_array);
        unset($table_inner_array);
    }
    if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
        $smarty->assign('nav_bar_top', true);
    }
    if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
        $smarty->assign('nav_bar_bottom', true);
    }
    $smarty->assign(array('listing' => true, 'selected_none' => $selected_none, 'table_heading' => $table_heading_array, 'table_heading_alt' => $table_heading_alt_array, 'nav_bar_number' => $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS), 'nav_bar_result' => '<nav><ul class="pagination">' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>', 'table_data_list' => $table_outer_array));
    if ($product_list_b) {
        $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_listing_b');
        $output_product_listing = $smarty->fetch(SELECTED_TPL . '/includes/modules/product_listing_b.tpl');
    } else {
        //      $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_listing_a');
        $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_listing_b');
        $output_product_listing = $smarty->fetch(SELECTED_TPL . '/includes/modules/product_listing_a.tpl');
    }
    $smarty->clearAssign(array('product_info', 'product_image', 'nav_bar_top', 'nav_bar_bottom', 'listing', 'selected_none', 'table_heading', 'nav_bar_number', 'nav_bar_result', 'table_data_list'));
    $smarty->assign('product_listing', $output_product_listing);
} else {
    $smarty->assign('text_no_products', TEXT_NO_PRODUCTS);
    if ($product_list_b) {
        $output_product_listing = $smarty->fetch(SELECTED_TPL . '/includes/modules/product_listing_b.tpl');
    } else {
require DIR_WS_INCLUDES . 'header.php';
require DIR_WS_INCLUDES . 'footer.php';
$orders_total = xos_count_customer_orders();
if ($orders_total > 0) {
    $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int) $_SESSION['customer_id'] . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int) $_SESSION['languages_id'] . "' and s.public_flag = '1' group by o.orders_id order by o.orders_id DESC";
    $history_split = new splitPageResultsBootstrap($history_query_raw, MAX_DISPLAY_ORDER_HISTORY, 'o.orders_id');
    $history_query = xos_db_query($history_split->sql_query);
    $orders_array = array();
    while ($history = xos_db_fetch_array($history_query)) {
        $products_query = xos_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $history['orders_id'] . "'");
        $products = xos_db_fetch_array($products_query);
        $oder_total_query = xos_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $history['orders_id'] . "' and class = 'ot_total' order by orders_total_id DESC limit 1");
        $oder_total = xos_db_fetch_array($oder_total_query);
        if (xos_not_null($history['delivery_name'])) {
            $order_type = 'shipped_to';
            $order_name = $history['delivery_name'];
        } else {
            $order_type = 'billed_to';
            $order_name = $history['billing_name'];
        }
        $orders_array[] = array('link_filename_account_history_info' => xos_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL'), 'order_id' => $history['orders_id'], 'order_status_name' => $history['orders_status_name'], 'date_purchased' => xos_date_long($history['date_purchased']), 'order_type' => $order_type, 'order_name' => xos_output_string_protected($order_name), 'products_count' => $products['count'], 'order_total' => strip_tags($oder_total['text']));
    }
    $smarty->assign(array('orders' => true, 'nav_bar_number' => $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS), 'nav_bar_result' => '<nav><ul class="pagination">' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>'));
}
$smarty->assign(array('orders_array' => $orders_array, 'link_filename_account' => xos_href_link(FILENAME_ACCOUNT, '', 'SSL')));
$smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'account_history');
$output_account_history = $smarty->fetch(SELECTED_TPL . '/account_history.tpl');
$smarty->assign('central_contents', $output_account_history);
$smarty->display(SELECTED_TPL . '/frame.tpl');
require DIR_WS_INCLUDES . 'application_bottom.php';
return 'overwrite_all';
Example #3
0
if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true')) {
    $smarty->caching = 1;
    $cache_id = 'L3|cc_reviews|' . $_SESSION['language'] . '-' . $_GET['lnc'] . '-' . $_GET[session_name()] . '-' . $session_started . '-' . SELECTED_TPL . '-' . $_SESSION['currency'];
}
if (!$smarty->isCached(SELECTED_TPL . '/reviews.tpl', $cache_id)) {
    $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where c.categories_or_pages_status = '1' and p.products_id = p2c.products_id and p2c.categories_or_pages_id = c.categories_or_pages_id and p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int) $_SESSION['languages_id'] . "' and rd.languages_id = '" . (int) $_SESSION['languages_id'] . "' order by r.reviews_id DESC";
    $reviews_split = new splitPageResultsBootstrap($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
    if ($reviews_split->number_of_rows > 0) {
        $reviews_query = xos_db_query($reviews_split->sql_query);
        $reviews_array = array();
        while ($reviews = xos_db_fetch_array($reviews_query)) {
            $product_image = xos_get_product_images($reviews['products_image']);
            $reviews_array[] = array('link_filename_product_reviews_info' => xos_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'p=' . $reviews['products_id'] . '&r=' . $reviews['reviews_id']), 'date_added' => xos_date_long($reviews['date_added']), 'products_image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($product_image['name']), $reviews['products_name'], '', '', 'class="img-responsive"'), 'td_width_img' => SMALL_PRODUCT_IMAGE_MAX_WIDTH + 10, 'reviews_rating' => $reviews['reviews_rating'], 'review_text' => xos_break_string(xos_output_string_protected($reviews['reviews_text']), 60, '-<br />'), 'stars_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'customers_name' => xos_output_string_protected($reviews['customers_name']), 'products_name' => $reviews['products_name']);
        }
        if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_top', true);
        }
        if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_bottom', true);
        }
        $smarty->assign('reviews', true);
    }
    $smarty->assign(array('nav_bar_number' => $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS), 'nav_bar_result' => '<nav><ul class="pagination">' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>', 'reviews_array' => $reviews_array));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'reviews');
}
$output_reviews = $smarty->fetch(SELECTED_TPL . '/reviews.tpl', $cache_id);
$smarty->assign('central_contents', $output_reviews);
$smarty->caching = 0;
$smarty->display(SELECTED_TPL . '/frame.tpl');
require DIR_WS_INCLUDES . 'application_bottom.php';
return 'overwrite_all';
Example #4
0
                $sizeof = count($products_prices[0]);
                if ($sizeof > 2) {
                    $array_keys = array_keys($products_prices[0]);
                    for ($count = 2, $n = $sizeof; $count < $n; $count++) {
                        $qty = $array_keys[$count];
                        $price_breaks_array[] = array('qty' => $qty, 'price_break' => $currencies->display_price($products_prices[0][$qty]['regular'], $products_tax_rate), 'price_break_special' => $products_prices[0]['special_status'] == 1 && $products_prices[0][$qty]['special'] > 0 ? $currencies->display_price($products_prices[0][$qty]['special'], $products_tax_rate) : '');
                    }
                }
            }
            $product_image = xos_get_product_images($products_new['products_image']);
            $popup_content_id = xos_get_delivery_times_values($products_new['products_delivery_time_id'], 'popup_content_id');
            $products_new_array[] = array('link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $products_new['products_id']), 'href_buy_now' => xos_href_link(FILENAME_PRODUCTS_NEW, xos_get_all_get_params(array('action')) . 'action=buy_now&p=' . $products_new['products_id']), 'date_added' => xos_date_long($products_new['products_date_added']), 'image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($product_image['name']), $products_new['products_name'], '', '', 'class="img-responsive"'), 'td_width_img' => SMALL_PRODUCT_IMAGE_MAX_WIDTH + 10, 'manufacturer' => $products_new['manufacturers_name'], 'tax_description' => xos_get_products_tax_description($products_new['products_tax_class_id'], $products_tax_rate), 'products_delivery_time' => xos_get_delivery_times_values($products_new['products_delivery_time_id']), 'link_filename_popup_content_products_delivery_time' => $popup_content_id > 0 ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=' . $popup_content_id . '&p=' . $products_new['products_id'], $request_type) : '', 'price' => $product_price, 'price_special' => $product_price_special, 'price_breaks' => $price_breaks_array, 'info' => $products_new['products_info'], 'products_p_unit' => $products_new['products_p_unit'], 'products_model' => $products_new['products_model'], 'products_quantity' => $products_new['products_quantity'], 'name' => $products_new['products_name']);
            unset($price_breaks_array);
        }
        if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_top', true);
        }
        if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_bottom', true);
        }
        $smarty->assign('new_products', true);
    }
    $smarty->assign(array('nav_bar_number' => $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW), 'nav_bar_result' => '<nav><ul class="pagination">' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>', 'interval_days_back' => INTERVAL_DAYS_BACK, 'products_new' => $products_new_array));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'products_new');
}
$output_products_new = $smarty->fetch(SELECTED_TPL . '/products_new.tpl', $cache_id);
$smarty->assign('central_contents', $output_products_new);
$smarty->caching = 0;
$smarty->display(SELECTED_TPL . '/frame.tpl');
require DIR_WS_INCLUDES . 'application_bottom.php';
return 'overwrite_all';
        while ($reviews = xos_db_fetch_array($reviews_query)) {
            $product_reviews_array[] = array('link_filename_product_reviews_info' => xos_href_link(FILENAME_PRODUCT_REVIEWS_INFO, xos_get_all_get_params(array('lnc', 'cur', 'tpl')) . 'r=' . $reviews['reviews_id']), 'date_added' => xos_date_long($reviews['date_added']), 'reviews_rating' => $reviews['reviews_rating'], 'review_text' => xos_break_string(xos_output_string_protected($reviews['reviews_text']), 60, '-<br />'), 'stars_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'customers_name' => xos_output_string_protected($reviews['customers_name']));
        }
        if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_top', true);
        }
        if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_bottom', true);
        }
        $smarty->assign(array('product_reviews_array' => $product_reviews_array, 'product_reviews' => true));
    }
    $products_image_name = xos_get_product_images($product_info['products_image']);
    if (xos_not_null($products_image_name)) {
        $smarty->assign(array('product_img' => xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), addslashes($product_info['products_name']), '', '', 'class="img-responsive"')));
    }
    $smarty->assign(array('products_name' => $product_info['products_name'], 'products_model' => $product_info['products_model'], 'link_filename_product_reviews_write' => xos_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, xos_get_all_get_params(array('lnc', 'cur', 'tpl', 'rmp')), 'SSL'), 'nav_bar_number' => $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS), 'nav_bar_result' => '<nav><ul class="pagination">' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_reviews');
}
// link_back will not be cached (nocache)
$back = sizeof($_SESSION['navigation']->path) - 2;
if (!empty($_SESSION['navigation']->path[$back])) {
    $get_params_array = $_SESSION['navigation']->path[$back]['get'];
    $get_params_array['rmp'] = '0';
    $smarty->assign('link_back', xos_href_link($_SESSION['navigation']->path[$back]['page'], xos_array_to_query_string($get_params_array, array('action', xos_session_name())), $_SESSION['navigation']->path[$back]['mode']), true);
} else {
    $smarty->assign('link_back', 'javascript:history.go(-1)', true);
}
$output_product_reviews = $smarty->fetch(SELECTED_TPL . '/product_reviews.tpl', $cache_id);
$smarty->assign('central_contents', $output_product_reviews);
$smarty->caching = 0;
$smarty->display(SELECTED_TPL . '/frame.tpl');