} else {
    $customer_group_id = $_SESSION['sppc_customer_group_id'];
}
$expected_query_raw = tep_db_query("select p.products_id, pd.products_name, p.products_image, products_date_available as date_expected,\r\n     if (isnull(pg.customers_group_price), p.products_price, pg.customers_group_price) as products_price\r\n     from (" . TABLE_PRODUCTS . " p \r\n     left join " . TABLE_PRODUCTS_GROUPS . " pg on p.products_id = pg.products_id and pg.customers_group_id = '" . $customer_group_id . "'),\r\n           " . TABLE_PRODUCTS_DESCRIPTION . " pd \r\n     where to_days(products_date_available) >= to_days(now()) \r\n       and p.products_id = pd.products_id \r\n       and pd.language_id = '" . (int) $languages_id . "' \r\n       and p.products_group_access like '%" . $customer_group_id . "%'\r\n     order by rand()\r\n     limit " . MAX_DISPLAY_UPCOMING_PRODUCTS);
$row = 0;
$col = 0;
$num = 0;
while ($expected_query = tep_db_fetch_array($expected_query_raw)) {
    $num++;
    if ($num == 1) {
        new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
    }
    $pf->loadProduct($expected_query['products_id'], $languages_id);
    $products_price_s = $pf->getPriceStringShort();
    $duedate = str_replace("00:00:00", "", $expected_query['date_expected']);
    $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $expected_query['products_image'], $expected_query['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . $expected_query['products_name'] . '</a><br>' . cre_products_blurb($expected_query['products_id']) . $products_price_s . '<br>' . TABLE_HEADING_DATE_EXPECTED . '&nbsp;' . $duedate);
    $col++;
    if ($col > 2) {
        $col = 0;
        $row++;
    }
}
if ($num) {
    new contentBox($info_box_contents, true, true);
    if (TEMPLATE_INCLUDE_CONTENT_FOOTER == 'true') {
        $info_box_contents = array();
        $info_box_contents[] = array('align' => 'left', 'text' => tep_draw_separator('pixel_trans.gif', '100%', '1'));
        new contentBoxFooter($info_box_contents);
    }
}
?>
<?php 
        $info_box_contents = array();
        $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS);
        new contentBoxHeading($info_box_contents);
        $row = 0;
        $col = 0;
        $info_box_contents = array();
        while ($xsell = tep_db_fetch_array($xsell_query)) {
            $pf->loadProduct($xsell['products_id'], $languages_id);
            $xsell_price = $pf->getPriceStringShort();
            $s_buy_now = '';
            $hide_add_to_cart = hide_add_to_cart();
            if ($hide_add_to_cart == 'false' && group_hide_show_prices() == 'true') {
                $s_buy_now = '<br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action', 'cPath', 'products_id')) . 'action=buy_now&products_id=' . $xsell['products_id'] . '&cPath=' . tep_get_product_path($xsell['products_id']), 'NONSSL') . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>';
            }
            $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<center><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] . '</a><br>' . cre_products_blurb($xsell['products_id']) . $xsell_price . $s_buy_now . '</center>');
            $col++;
            if ($col > 2) {
                $col = 0;
                $row++;
            }
        }
        // Modify to avoid display if no X-Sells Defined - courtesy Halbert DMG
        //  halbert mod - Don't show heading if no cross-sell items
        if ($num_products_xsell >= MIN_DISPLAY_XSELL && $num_products_xsell > 0) {
            new contentBox($info_box_contents, true, true);
            if (TEMPLATE_INCLUDE_CONTENT_FOOTER == 'true') {
                $info_box_contents = array();
                $info_box_contents[] = array('align' => 'left', 'text' => tep_draw_separator('pixel_trans.gif', '100%', '1'));
                new contentBoxFooter($info_box_contents);
            }
Ejemplo n.º 3
0
//Eversun mod for sppc and qty price breaks
if (!isset($_SESSION['sppc_customer_group_id'])) {
    $customer_group_id = 'G';
} else {
    $customer_group_id = $_SESSION['sppc_customer_group_id'];
}
$mainpage_featured_query = tep_db_query("select distinct\r\n                           p.products_image,\r\n                           p.products_id,\r\n                           pd.products_name,\r\n                          if (isnull(pg.customers_group_price), p.products_price, pg.customers_group_price) as products_price,\r\n         p.products_image\r\n                          from (" . TABLE_PRODUCTS . " p\r\n                         left join " . TABLE_PRODUCTS_GROUPS . " pg on p.products_id = pg.products_id and pg.customers_group_id = '" . $customer_group_id . "'),\r\n                              " . TABLE_PRODUCTS_DESCRIPTION . " pd,\r\n                        " . TABLE_FEATURED . " f\r\n                                 where\r\n                                   p.products_status = '1'\r\n                                   and f.status = '1'\r\n                                   and p.products_id = f.products_id\r\n                                   and pd.products_id = f.products_id\r\n                                   and pd.language_id = '" . $languages_id . "'\r\n                                   and p.products_group_access like '%" . $customer_group_id . "%'\r\n                                   order by rand(),p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
$mainpage_featured_check = tep_db_num_rows($mainpage_featured_query);
if ($mainpage_featured_check > 0) {
    $row = 0;
    $col = 0;
    $num = 0;
    while ($mainpage_featured_products = tep_db_fetch_array($mainpage_featured_query)) {
        $num++;
        if ($num == 1) {
            // new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_FEATURED_PRODUCTS));
        }
        $pf->loadProduct($mainpage_featured_products['products_id'], $languages_id);
        $products_price_2bb = $pf->getPriceStringShort();
        echo '<div class="col-sm-4 col-lg-4 text-center" style="height:250px"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $mainpage_featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $mainpage_featured_products['products_image'], $mainpage_featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $mainpage_featured_products['products_id']) . '">' . $mainpage_featured_products['products_name'] . '</a><br>' . $new_products['products_name'] . '</a></h3><p class="">' . (INSTALLED_VERSION_TYPE == 'B2B' || INSTALLED_VERSION_TYPE == 'Pro' ? cre_products_blurb($mainpage_featured_products['products_id']) : cre_product_short_description_template($mainpage_featured_products['products_id'])) . $products_price_2bb . '</div>';
        $col++;
        if ($col > 2) {
            $col = 0;
            $row++;
        }
    }
    // new contentBox($info_box_contents, true, true);
}
?>
<!-- featured_products_eof //-->
//Eversun mod for sppc and qty price breaks
if (!isset($_SESSION['sppc_customer_group_id'])) {
    $customer_group_id = 'G';
} else {
    $customer_group_id = $_SESSION['sppc_customer_group_id'];
}
$info_box_contents = array();
$mainpage_featured2_query = tep_db_query("select distinct\r\n                           p.products_image, \r\n                           p.products_id,\r\n                           pd.products_name\r\n                          from (" . TABLE_PRODUCTS . " p \r\n                          left join " . TABLE_PRODUCTS_GROUPS . " pg on p.products_id = pg.products_id and pg.customers_group_id = '" . $customer_group_id . "'),\r\n                              " . TABLE_PRODUCTS_DESCRIPTION . " pd,\r\n                        " . TABLE_FEATURED . " f\r\n                                 where\r\n                                   p.products_status = '1'\r\n                                   and f.status = '1'\r\n                                   and p.products_id = f.products_id\r\n                                   and pd.products_id = f.products_id\r\n                                   and pd.language_id = '" . $languages_id . "'\r\n                                   and p.products_group_access like '%" . $customer_group_id . "%'\r\n                                   order by rand(),p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
$row = 0;
$col = 0;
$num = 0;
$mainpage_featured2_check = tep_db_num_rows($mainpage_featured2_query);
if ($mainpage_featured2_check > 0) {
    while ($mainpage_featured2_products = tep_db_fetch_array($mainpage_featured2_query)) {
        $num++;
        $mainpage_featured2_products_array[] = array('id' => $mainpage_featured2_products['products_id'], 'name' => $mainpage_featured2_products['products_name'], 'blurb' => cre_products_blurb($mainpage_featured2_products['products_id']), 'image' => $mainpage_featured2_products['products_image']);
    }
    for ($i = 0; $i < sizeof($mainpage_featured2_products_array); $i++) {
        $num++;
        $pf->loadProduct($mainpage_featured2_products_array[$i]['id'], $languages_id);
        $products_price = str_replace('&nbsp;', ' ', $pf->getPriceStringShort());
        $featured_str = '';
        $featured_str = '
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="contentBoxHeading">
  <tr>
    <td class="contentBoxHeadingLeft">' . tep_image_infobox('content_top_left.png') . '</td>
    <td width="100%" class="contentBoxHeadingCenter">&nbsp;</td>
    <td class="contentBoxHeadingRight">' . tep_image_infobox('content_top_right.png') . '</td>
  </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="contentBox">
$row = 0;
$col = 0;
$num = 0;
$buyitnow = '';
while ($default_specials_1a = tep_db_fetch_array($new10)) {
    $num++;
    if ($num == 1) {
        new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_SPECIALS));
    }
    $pf->loadProduct($default_specials_1a['products_id'], $languages_id);
    $products_price_s = $pf->getPriceStringShort();
    $hide_add_to_cart = hide_add_to_cart();
    if ($hide_add_to_cart == 'false' && group_hide_show_prices() == 'true') {
        $buyitnow = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'cPath', 'products_id')) . 'action=buy_now&amp;products_id=' . $default_specials_1a['products_id'] . '&amp;cPath=' . tep_get_product_path($default_specials_1a['products_id'])) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
    }
    $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials_1a['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $default_specials_1a['products_image'], $default_specials_1a['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials_1a['products_id']) . '">' . $default_specials_1a['products_name'] . '</a><br>' . cre_products_blurb($default_specials_1a['products_id']) . $products_price_s . '<br>' . $buyitnow);
    $col++;
    if ($col > 2) {
        $col = 0;
        $row++;
    }
}
if ($num) {
    new contentBox($info_box_contents, true, true);
    if (TEMPLATE_INCLUDE_CONTENT_FOOTER == 'true') {
        $info_box_contents = array();
        $info_box_contents[] = array('align' => 'left', 'text' => tep_draw_separator('pixel_trans.gif', '100%', '1'));
        new contentBoxFooter($info_box_contents);
    }
}
?>
$info_box_contents = array();
$info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
$new_products_query = tep_db_query("select distinct\r\n                          p.products_id,\r\n                          p.products_image, \r\n                          p.products_price, \r\n                          p.manufacturers_id,\r\n                          pd.products_name,\r\n                          p.products_tax_class_id, \r\n                          if (isnull(pg.customers_group_price), p.products_price, pg.customers_group_price) as products_price,\r\n                          p.products_date_added, \r\n                           p.products_image \r\n                          from ((((" . TABLE_PRODUCTS . " p \r\n      left join " . TABLE_PRODUCTS_GROUPS . " pg on p.products_id = pg.products_id and pg.customers_group_id = '" . $customer_group_id . "') \r\n      left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id)\r\n      left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id)\r\n      left join " . TABLE_CATEGORIES . " c on c.parent_id = " . (int) $current_category_id . " ) ,\r\n      " . TABLE_PRODUCTS_DESCRIPTION . " pd\r\n      where \r\n       p.products_status = '1' \r\n       and pd.products_id = p.products_id\r\n       and c.categories_id = p2c.categories_id\r\n       and pd.language_id = '" . $languages_id . "' \r\n       and p.products_group_access like '%" . $customer_group_id . "%'\r\n       and DATE_SUB(CURDATE(),INTERVAL " . NEW_PRODUCT_INTERVAL . " DAY) <= p.products_date_added  \r\n       order by rand(), p.products_date_added  limit " . MAX_DISPLAY_NEW_PRODUCTS);
$row = 0;
$col = 0;
$num = 0;
$new_products_blurb = '';
while ($new_products = tep_db_fetch_array($new_products_query)) {
    $num++;
    if ($num == 1) {
        new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_PRODUCTS_NEW));
    }
    $pf->loadProduct($new_products['products_id'], $languages_id);
    $products_price_s = $pf->getPriceStringShort();
    if (tep_not_null(cre_products_blurb($new_products['products_id']))) {
        $new_products_blurb = '<br><div class="blurbs">' . cre_products_blurb($new_products['products_id']) . '</div>';
    }
    $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $products_price_s . $new_products_blurb);
    $col++;
    if ($col > 2) {
        $col = 0;
        $row++;
    }
}
if ($num) {
    new contentBox($info_box_contents, true, true);
    if (TEMPLATE_INCLUDE_CONTENT_FOOTER == 'true') {
        $info_box_contents = array();
        $info_box_contents[] = array('align' => 'left', 'text' => tep_draw_separator('pixel_trans.gif', '100%', '1'));
        new contentboxFooter($info_box_contents);
    }
    $customer_group_id = 'G';
} else {
    $customer_group_id = $_SESSION['sppc_customer_group_id'];
}
$info_box_contents = array();
$info_box_contents = '<h3 class="no-margin-top">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . '</h3>';
$new_products_query = tep_db_query("select distinct\r\n                          p.products_id,\r\n                          p.products_price,\r\n                          p.manufacturers_id,\r\n                          pd.products_name,\r\n                          p.products_tax_class_id,\r\n                          if (isnull(pg.customers_group_price), p.products_price, pg.customers_group_price) as products_price,\r\n                          p.products_date_added,\r\n                           p.products_image\r\n                          from ((" . TABLE_PRODUCTS . " p\r\n      left join " . TABLE_PRODUCTS_GROUPS . " pg on p.products_id = pg.products_id and pg.customers_group_id = '" . $customer_group_id . "')\r\n      left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id),\r\n      " . TABLE_PRODUCTS_DESCRIPTION . " pd\r\n      where\r\n       p.products_status = '1'\r\n       and pd.products_id = p.products_id\r\n       and pd.language_id = '" . $languages_id . "'\r\n       and p.products_group_access like '%" . $customer_group_id . "%'\r\n       and DATE_SUB(CURDATE(),INTERVAL " . NEW_PRODUCT_INTERVAL . " DAY) <= p.products_date_added\r\n                                   and p.products_group_access like '%" . $customer_group_id . "%'\r\n       order by rand(), p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
$row = 0;
$col = 0;
$num = 0;
while ($new_products = tep_db_fetch_array($new_products_query)) {
    $num++;
    if ($num == 1) {
        // new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_PRODUCTS_NEW));
        //  echo $info_box_contents;
    }
    $pf->loadProduct($new_products['products_id'], $languages_id);
    $products_price_s = $pf->getPriceStringShort();
    echo '<div class="product-listing-module-container"><div class="product-listing-module-items"><div class="col-sm-4 col-lg-4 with-padding"><div class="thumbnail align-center large-padding-top" style="height: 410px;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], 200) . '</a><br><h3 style="line-height:1.1;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a></h3><p class="">' . cre_products_blurb($new_products['products_id']) . '</p><div class="row pricing-row"><div class="col-sm-6 col-lg-6"> <p class="lead small-margin-bottom">' . $products_price_s . '</p></div><div class="col-sm-5 col-lg-5 no-margin-left buy-btn-div"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action', 'cPath', 'products_id')) . 'action=buy_now&amp;products_id=' . $new_products['products_id']) . '" style="text-decoration:none"><button type="button" class="content-new-products-add-button btn btn-success btn-block">Buy Now</button></a></div></div></div></div></div></div>';
    $col++;
    if ($col > 2) {
        $col = 0;
        $row++;
    }
}
if ($num) {
    // new contentBox($info_box_contents, true, true);
}
?>
<!-- D new_products_eof //-->