if (zen_not_null($products_image)) {
    require DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars_images.php';
} else {
    echo ' ';
}
?>
    </td>
    <td align="center" class="pageHeading">
<?php 
// base price
if ($show_onetime_charges_description == 'true') {
    $one_time = '<span class="smallText">' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
} else {
    $one_time = '';
}
echo $one_time . ((zen_has_product_attributes_values((int) $_GET['products_id']) and SHOW_PRODUCT_INFO_STARTING_AT == '1') ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int) $_GET['products_id']);
?>
    </td>
  </tr>

  <tr>
    <td class="main" align="center" valign="top">
      <?php 
echo (SHOW_PRODUCT_INFO_MODEL == '1' and $products_model != '') ? TEXT_PRODUCT_MODEL . $products_model : '&nbsp;';
?>
    </td>
  </tr>
  <tr>
    <td class="main" align="center"><?php 
echo (SHOW_PRODUCT_INFO_WEIGHT == '1' and $products_weight != 0) ? TEXT_PRODUCT_WEIGHT . $products_weight . TEXT_PRODUCT_WEIGHT_UNIT : '&nbsp;';
?>
Example #2
0
     $lc_text = $listing->fields['products_model'];
     break;
 case 'PRODUCT_LIST_NAME':
     $lc_align = '';
     if (isset($_GET['manufacturers_id'])) {
         $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
     } else {
         $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
     }
     break;
 case 'PRODUCT_LIST_MANUFACTURER':
     $lc_align = '';
     $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
     break;
 case 'PRODUCT_LIST_PRICE':
     $lc_price = '<span class="table-price">' . zen_get_products_display_price($listing->fields['products_id']) . '</span><br />';
     $lc_align = 'right';
     $lc_text = $lc_price;
     // more info in place of buy now
     $lc_button = '';
     if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
         $lc_button = '<span class="more-info"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a></span>';
     } else {
         if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
             if ($listing->fields['products_qty_box_status'] != 0 && zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N' && $listing->fields['product_is_call'] == 0 && ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0)) {
                 $how_many++;
             }
             // hide quantity box
             if ($listing->fields['products_qty_box_status'] == 0) {
                 $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
             } else {
     }
 } else {
     $display_products_quantity = '';
 }
 if (PRODUCT_NEW_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'date_added')) {
     $display_products_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($products_new->fields['products_date_added']) . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_DATE_ADDED, 3, 1));
 } else {
     $display_products_date_added = '';
 }
 if (PRODUCT_NEW_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'manufacturer')) {
     $display_products_manufacturers_name = $products_new->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $products_new->fields['manufacturers_name'] . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_MANUFACTURER, 3, 1)) : '';
 } else {
     $display_products_manufacturers_name = '';
 }
 if (PRODUCT_NEW_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_new->fields['products_id']) == 'Y' and zen_check_show_prices() == true) {
     $products_price = zen_get_products_display_price($products_new->fields['products_id']);
     $display_products_price = TEXT_PRICE . ' ' . $products_price . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($products_new->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($products_new->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
 } else {
     $display_products_price = '';
 }
 // more info in place of buy now
 if (PRODUCT_NEW_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($products_new->fields['products_id']) == 'Y') {
     if (zen_has_product_attributes($products_new->fields['products_id'])) {
         $link = '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' . $products_new->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     } else {
         //          $link= '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
         if (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART > 0 && $products_new->fields['products_qty_box_status'] != 0) {
             //            $how_many++;
             $link = TEXT_PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $products_new->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
         } else {
             $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
    // Split Page
    ?>
                <td class="dataTableContent" width="20" align="right"><?php 
    echo $products->fields['products_id'];
    ?>
</td>
                <td class="dataTableContent"><?php 
    echo '<a href="' . zen_href_link($type_handler, 'cPath=' . $cPath . '&pID=' . $products->fields['products_id'] . '&action=new_product_preview&read=only' . '&product_type=' . $products->fields['products_type'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $products->fields['products_name'];
    ?>
</td>
                <td class="dataTableContent"><?php 
    echo $products->fields['products_model'];
    ?>
</td>
                <td colspan="2" class="dataTableContent" align="right"><?php 
    echo zen_get_products_display_price($products->fields['products_id']);
    ?>
</td>
                <td class="dataTableContent" align="right"><?php 
    echo $products->fields['products_quantity'];
    ?>
</td>
                <td class="dataTableContent" width="50" align="left">
<?php 
    if ($products->fields['products_status'] == '1') {
        echo zen_draw_form('setflag_products', FILENAME_CATEGORIES, 'action=setflag&pID=' . $products->fields['products_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . (isset($_GET['search']) && !empty($_GET['search']) ? '&search=' . $_GET['search'] : ''));
        ?>
        <input type="image" src="<?php 
        echo DIR_WS_IMAGES;
        ?>
icon_green_on.gif" title="<?php 
<?php 
        if ($_GET['products_filter'] != '') {
            ?>
          <tr>
            <td class="main" width="200" align="left" valign="top">&nbsp;</td>
            <td colspan="2" class="main"><?php 
            echo TEXT_PRODUCT_TO_VIEW;
            ?>
</td>
          </tr>
          <tr>
            <td class="main" width="200" align="center" valign="top">
<?php 
            $display_priced_by_attributes = zen_get_products_price_is_priced_by_attributes($_GET['products_filter']);
            echo $display_priced_by_attributes ? '<span class="alert">' . TEXT_PRICED_BY_ATTRIBUTES . '</span>' . '<br />' : '';
            echo zen_get_products_display_price($_GET['products_filter']) . '<br /><br />';
            echo zen_get_products_quantity_min_units_display($_GET['products_filter'], $include_break = true);
            ?>
            </td>
            <td class="attributes-even" align="center"><?php 
            echo zen_draw_products_pull_down('products_filter', 'size="10"', '', true, $_GET['products_filter'], true, true);
            ?>
</td>
            <td class="main" align="right" valign="top"><?php 
            echo zen_image_submit('button_display.gif', IMAGE_DISPLAY);
            ?>
</td>
          </tr>
        </table></td>
      </form></tr>
 function getProducts()
 {
     $this->cleanup();
     if (count($this->products) < 1) {
         return false;
     }
     $exclude_products_id = 0;
     if (isset($_GET['products_id']) && $_GET['products_id'] > 0) {
         $exclude_products_id = (int) $_GET['products_id'];
     }
     $products = array();
     foreach ($this->products as $products_id => $add_date) {
         if ($products_id != $exclude_products_id) {
             $products[] = array('id' => $products_id, 'add_date' => $add_date, 'name' => zen_get_products_name($products_id), 'display_price' => zen_get_products_display_price($products_id), 'image' => DIR_WS_IMAGES . zen_products_lookup($products_id, 'products_image'), 'url' => zen_href_link(zen_get_info_page($products_id), 'products_id=' . $products_id));
         }
         if (count($products) >= MODULE_VIEWED_PRODUCTS_MAX_DISPLAY_VIEWED) {
             break;
         }
     }
     return $products;
 }
<?php

/**
 * @package modules
 * @author JunsGo@msn.com
 * @copyright Copyright 2013 SL Development Team
 * @copyright Portions Copyright 2003 osCommerce
 */
$tpl_products = array('title' => '', 'products' => array());
if ((int) $_GET['products_id'] > 0) {
    $sql = 'SELECT p.products_image, pd.products_name, p.products_quantity, p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id, p.products_price,
	 p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price,
	 p.products_sort_order, p.product_is_call, p.product_is_free, p.product_is_always_free_shipping, p.products_qty_box_status
			FROM ' . TABLE_PRODUCTS_DESCRIPTION . ' pd, .' . TABLE_PRODUCTS . ' p left join ' . TABLE_MANUFACTURERS . ' m on (p.manufacturers_id = m.manufacturers_id),
				' . TABLE_PRODUCTS_TO_CATEGORIES . ' p2c left join ' . TABLE_SPECIALS . ' s on (p2c.products_id = s.products_id)
			WHERE p.products_status = 1 and (p.products_id = p2c.products_id) and (pd.products_id = p2c.products_id)
					 and p.shop_id = ' . (int) $_SESSION['shop_id'] . '
				and pd.language_id = \'' . (int) $_SESSION['languages_id'] . '\' and p.master_categories_id = \'' . (int) zen_get_products_category_id($_GET['products_id']) . '\'
			ORDER BY RAND()';
    $relateds = $db->Execute($sql, MAX_DISPLAY_PRODUCTS_RELATED, true, CACHE_TIMELIFT);
    while (!$relateds->EOF) {
        $tpl_products['products'][$relateds->fields['products_id']] = array('name' => $relateds->fields['products_name'], 'image' => $relateds->fields['products_image'], 'quantity' => $relateds->fields['products_quantity'], 'weight' => $relateds->fields['products_weight'], 'type' => $relateds->fields['products_type'], 'categories_id' => $relateds->fields['master_categories_id'], 'manufacturers_id' => $relateds->fields['manufacturers_id'], 'products_price' => $relateds->fields['products_price'], 'tax_class_id' => $relateds->fields['products_tax_class_id'], 'specials_price' => $relateds->fields['specials_new_products_price'], 'final_price' => $relateds->fields['final_price'], 'sort_order' => $relateds->fields['products_sort_order'], 'is_call' => $relateds->fields['product_is_call'], 'is_always_free_shipping' => $relateds->fields['product_is_always_free_shipping'], 'qty_box_status' => $relateds->fields['products_qty_box_status'], 'href' => zen_href_link(zen_get_info_page($relateds->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($relateds->fields['master_categories_id']))) . '&products_id=' . $relateds->fields['products_id']), 'display_price' => zen_get_products_display_price($relateds->fields['products_id']), 'is_free' => $relateds->fields['product_is_free'] == '1' ? true : false, 'display_normal_price' => get_normal_price($relateds->fields['products_id']), 'display_special_price' => get_special_price($relateds->fields['products_id']), 'display_sale_price' => get_sale_discount_price($relateds->fields['products_id']));
        $relateds->MoveNext();
    }
}
Example #8
0
        $pInfo->products_name = zen_db_prepare_input($products_name[$languages[$i]['id']]);
        $pInfo->products_description = zen_db_prepare_input($products_description[$languages[$i]['id']]);
        $pInfo->products_url = zen_db_prepare_input($products_url[$languages[$i]['id']]);
    }
    $specials_price = zen_get_products_special_price($pID);
    ?>
    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php 
    echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $pInfo->products_name;
    ?>
</td>
            <td class="pageHeading" align="right"><?php 
    echo $currencies->format($pInfo->products_price) . ($pInfo->products_virtual == 1 ? '<span class="errorText">' . '<br />' . TEXT_VIRTUAL_PREVIEW . '</span>' : '') . ($pInfo->product_is_always_free_shipping == 1 ? '<span class="errorText">' . '<br />' . TEXT_FREE_SHIPPING_PREVIEW . '</span>' : '') . ($pInfo->products_priced_by_attribute == 1 ? '<span class="errorText">' . '<br />' . TEXT_PRODUCTS_PRICED_BY_ATTRIBUTES_PREVIEW . '</span>' : '') . ($pInfo->product_is_free == 1 ? '<span class="errorText">' . '<br />' . TEXT_PRODUCTS_IS_FREE_PREVIEW . '</span>' : '') . ($pInfo->product_is_call == 1 ? '<span class="errorText">' . '<br />' . TEXT_PRODUCTS_IS_CALL_PREVIEW . '</span>' : '') . ($pInfo->products_qty_box_status == 0 ? '<span class="errorText">' . '<br />' . TEXT_PRODUCTS_QTY_BOX_STATUS_PREVIEW . '</span>' : '') . ($pInfo->products_priced_by_attribute == 1 ? '<br />' . zen_get_products_display_price($_GET['pID']) : '');
    ?>
</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php 
    echo zen_draw_separator('pixel_trans.gif', '1', '10');
    ?>
</td>
      </tr>
      <tr>
        <td class="main">
          <?php 
    //auto replace with defined missing image
<?php

/**
 * featured_products module - prepares content for display
 *
 * @package modules
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: featured_products.php 6424 2007-05-31 05:59:21Z ajeh $
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
$featured_products_query = "select distinct p.products_id, p.products_image,\n                                            pd.products_name\n\t\t\t\t\t\t    from (" . TABLE_FEATURED . " f\n\t\t\t\t\t\t    left join " . TABLE_PRODUCTS . " p on f.products_id = p.products_id\n\t\t\t\t\t\t    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )\n\t\t\t\t\t\t    where p.products_status = 1 \n\t\t\t\t\t\t\tand   f.status = 1\n\t\t\t\t\t\t    and   pd.language_id = '" . (int) $_SESSION['languages_id'] . "' \n\t\t\t\t\t\t\torder by p.products_ordered";
if ($featured_products_query != '') {
    $featured_products_db = $db->Execute($featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED);
}
$num_products_count = $featured_products_query == '' ? 0 : $featured_products_db->RecordCount();
// show only when 1 or more
if ($num_products_count > 0) {
    while (!$featured_products_db->EOF) {
        $f_pid = $featured_products_db->fields['products_id'];
        $products_price = zen_get_products_display_price($f_pid);
        $featured_products[] = array('product_name' => zen_trunc_string($featured_products_db->fields['products_name'], 40, true), 'product_price' => $products_price, 'product_image' => $featured_products_db->fields['products_image'], 'product_url_link' => zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $f_pid));
        $featured_products_db->MoveNext();
    }
    $zc_show_featured = true;
}
Example #10
0
<?php

/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_whats_new.php 17617 2010-09-25 20:13:29Z drbyte $
 */
$content = "";
$content .= '<div class="sideBoxContent centeredContent">';
$whats_new_box_counter = 0;
while (!$random_whats_new_sidebox_product->EOF) {
    $whats_new_box_counter++;
    $whats_new_price = zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']);
    $content .= "\n" . '  <div class="sideBoxContentItem">';
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($random_whats_new_sidebox_product->fields['master_categories_id']) . '&products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $content .= '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a>';
    $content .= '<div>' . $whats_new_price . '</div>';
    $content .= '</div>';
    $random_whats_new_sidebox_product->MoveNextRandom();
}
$content .= '</div>' . "\n";
<?php

/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_best_sellers.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
$content = '';
$content .= '' . "\n";
for ($i = 1; $i <= sizeof($bestsellers_list); $i++) {
    $content .= '<dl id="bestsellers-' . $i . '">' . "\n";
    $content .= '<dt><span>' . $i . '</span><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_image(DIR_WS_IMAGES . $bestsellers_list[$i]['image'], $bestsellers_list[$i]['name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '</a></dt>' . "\n";
    $content .= '<dd class="description"><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . $bestsellers_list[$i]['manufacturers'] . '<br />' . $bestsellers_list[$i]['name'] . '</a></dd>' . "\n";
    $content .= '<dd class="price">' . TEXT_PRICE_KN . '' . zen_get_products_display_price($bestsellers_list[$i]['id']) . '' . '</dd>' . "\n";
    $content .= '</dl>' . "\n";
}
/*
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
  $content .= '<div class="wrapper">' . "\n" . '<ol>' . "\n";
  for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
    $content .= '<li><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . '</a></li>' . "\n";
  }
  $content .= '</ol>' . "\n";
  $content .= '</div>' . "\n";
  $content .= '</div>';*/
<?php

// -----
// Scrolling "what's new" sidebox, based on the whats_new.php sidebox that's built into Zen Cart!
//
// Copyright (c) 2014, Vinos de Frutas Tropicales (lat9)
// Copyright 2003-2011 Zen Cart Development Team
// Copyright 2003 osCommerce
// License: http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
//
$content = '<div class="sideBoxContent centeredContent">';
while (!$whats_new_scrolling->EOF) {
    $whats_new_price = zen_get_products_display_price($whats_new_scrolling->fields['products_id']);
    $content .= "\n" . '  <div class="sideBoxContentItem hiddenField whatsNewScroller">';
    $content .= '<a href="' . zen_href_link(zen_get_info_page($whats_new_scrolling->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($whats_new_scrolling->fields['master_categories_id']) . '&products_id=' . $whats_new_scrolling->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $whats_new_scrolling->fields['products_image'], $whats_new_scrolling->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $content .= '<br />' . $whats_new_scrolling->fields['products_name'] . '</a>';
    $content .= '<div>' . $whats_new_price . '</div>';
    $content .= '</div>';
    $whats_new_scrolling->MoveNextRandom();
}
$content .= '</div><script type="text/javascript">$("div.whatsNewScroller").cycle(10000);</script>' . "\n";
 * Template used to render attribute display/input fields
 *
 * @package templateSystem
 * @copyright Portions Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: block_hogehoge.php $
 */
$pId = $_GET['products_id'];
if (count($pId)) {
    ?>
<div id="multi_image_view_thmb" class="centeredContent">
<?php 
    if (count($multi_images) > 1) {
        $img_alt = zen_get_products_name($pId);
        $href_title = $img_alt . '(' . zen_get_products_display_price($pId) . ')';
        $img_alt = htmlspecialchars(zen_clean_html($img_alt), ENT_QUOTES);
        $href_title = htmlspecialchars(zen_clean_html($href_title), ENT_QUOTES);
        $thmb_cnt = 1;
        $image_cnt = -1;
        $str_splt = '';
        $pre_url = '';
        foreach ($multi_images as $item) {
            if ($image_cnt == -1) {
                $str_style = 'selected_thmb ';
            } else {
                $str_style = '';
            }
            ?>
    <div class="<?php 
            echo $str_style;
     }
 } else {
     $display_products_quantity = '';
 }
 if (PRODUCT_FEATURED_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($featured_products->fields['products_id'], 'date_added')) {
     $display_products_date_added = '<span class="service-text">' . TEXT_DATE_ADDED . ' ' . zen_date_long($featured_products->fields['products_date_added']) . '</span>' . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_DATE_ADDED, 3, 1));
 } else {
     $display_products_date_added = '';
 }
 if (PRODUCT_FEATURED_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($featured_products->fields['products_id'], 'manufacturer')) {
     $display_products_manufacturers_name = $featured_products->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $featured_products->fields['manufacturers_name'] . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_MANUFACTURER, 3, 1)) : '';
 } else {
     $display_products_manufacturers_name = '';
 }
 if (PRODUCT_FEATURED_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($featured_products->fields['products_id']) == 'Y' and zen_check_show_prices() == true) {
     $products_price = '<span class="table-price">' . zen_get_products_display_price($featured_products->fields['products_id']) . '</span>';
     $display_products_price = $products_price . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($featured_products->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($featured_products->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
 } else {
     $display_products_price = '';
 }
 // more info in place of buy now
 if (PRODUCT_FEATURED_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($featured_products->fields['products_id']) == 'Y') {
     if (zen_has_product_attributes($featured_products->fields['products_id'])) {
         $link = '<span class="more-info"><a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']) . '&products_id=' . $featured_products->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a></span>';
     } else {
         //          $link= '<a href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
         if (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART > 0 && $featured_products->fields['products_qty_box_status'] != 0) {
             //            $how_many++;
             $link = TEXT_PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $featured_products->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
         } else {
             $link = '<a href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
Example #15
0
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id: specials.php 1266 2005-04-29 02:51:24Z ajeh $
//
// test if box should display
$show_specials = false;
if (isset($_GET['products_id'])) {
    $show_specials = false;
} else {
    $show_specials = true;
}
if ($show_specials == true) {
    $random_specials_sidebox_product_query = "select p.products_id, pd.products_name, p.products_price,\r\n                                    p.products_tax_class_id, p.products_image,\r\n                                    s.specials_new_products_price\r\n                             from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s\r\n                             where p.products_status = '1'\r\n                             and p.products_id = s.products_id\r\n                             and pd.products_id = s.products_id\r\n                             and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\r\n                             and s.status = '1'\r\n                             limit " . MAX_RANDOM_SELECT_SPECIALS;
    $random_specials_sidebox_product = zen_random_select($random_specials_sidebox_product_query);
    if ($random_specials_sidebox_product->RecordCount() > 0) {
        $specials_box_price = zen_get_products_display_price($random_specials_sidebox_product->fields['products_id']);
        require $template->get_template_dir('tpl_specials.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_specials.php';
        $title = BOX_HEADING_SPECIALS;
        $left_corner = false;
        $right_corner = false;
        $right_arrow = false;
        $title_link = FILENAME_SPECIALS;
        require $template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base, 'common') . '/' . $column_box_default;
    }
}
 function convert_product_result($fields)
 {
     $fields['path_image'] = self::get_product_path_image($fields);
     $fields['name'] = $fields['products_name'];
     $fields['url'] = zen_href_link(zen_get_info_page($fields['products_id']), 'products_id=' . $fields['products_id'] . '&categories_id=' . $this->search_params['categories_id']);
     $fields['description'] = zen_trunc_string(zen_clean_html(stripslashes($fields['products_description']), PRODUCT_LIST_DESCRIPTION));
     $fields['model'] = $fields['products_model'];
     $fields['quantity'] = $fields['products_quantity'];
     $fields['date_added'] = zen_date_long($fields['products_date_added']);
     $fields['price'] = $fields['products_price'];
     #FIXME
     $fields['final_price'] = zen_get_products_display_price($fields['products_id']);
     $fields['cart_button'] = self::get_product_cart_button($fields);
     $categories = self::get_product_categories($fields['products_id']);
     foreach ($categories as $category_id) {
         $fields['categories_path'][] = self::get_categories_path($category_id, self::get_super_products_list_link('results'));
     }
     $fields['always_free_shipping'] = $fields['product_is_always_free_shipping'];
     return $fields;
 }
Example #17
0
    $review_info_check_query = $db->bindVars($review_info_check_query, ':languagesID', $_SESSION['languages_id'], 'integer');
    $review_info_check = $db->Execute($review_info_check_query);
    if ($review_info_check->fields['total'] < 1) {
        zen_redirect(zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params(array('reviews_id'))));
    }
} else {
    zen_redirect(zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params(array('reviews_id'))));
}
$sql = "UPDATE " . TABLE_REVIEWS . "\n          SET reviews_read = reviews_read+1\n          WHERE reviews_id = :reviewsID";
$sql = $db->bindVars($sql, ':reviewsID', $_GET['reviews_id'], 'integer');
$db->Execute($sql);
$review_info_query = "SELECT rd.reviews_text, r.reviews_rating, r.reviews_id, r.customers_name,\n                               r.date_added, r.reviews_read, p.products_id, p.products_price,\n                               p.products_tax_class_id, p.products_image, p.products_model, p.products_quantity_order_min, pd.products_name\n                        FROM " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd\n                        WHERE r.reviews_id = :reviewsID\n                        AND r.reviews_id = rd.reviews_id\n                        AND rd.languages_id = :languagesID\n                        AND r.products_id = p.products_id\n                        AND p.products_status = '1'\n                        AND p.products_id = pd.products_id\n                        AND pd.language_id = :languagesID " . $review_status;
$review_info_query = $db->bindVars($review_info_query, ':reviewsID', $_GET['reviews_id'], 'integer');
$review_info_query = $db->bindVars($review_info_query, ':languagesID', $_SESSION['languages_id'], 'integer');
$review_info = $db->Execute($review_info_query);
$products_price = zen_get_products_display_price($review_info->fields['products_id']);
$products_name = $review_info->fields['products_name'];
if ($review_info->fields['products_model'] != '') {
    $products_model = $review_info->fields['products_model'];
} else {
    $products_model = '';
}
$products_quantity_order_min = $review_info->fields['products_quantity_order_min'];
// set image
//  $products_image = $review_info->fields['products_image'];
if ($review_info->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
    $products_image = PRODUCTS_IMAGE_NO_IMAGE;
} else {
    $products_image = $review_info->fields['products_image'];
}
require DIR_WS_MODULES . zen_get_module_directory('require_languages.php');
 while (!$listing->EOF) {
     $rows++;
     $cur_row = sizeof($list_box_contents) - 1;
     $product_link = BootstrapProductListing::product_link($listing);
     $product_image = "<a href='{$product_link}'>" . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], 0, 0, 'class="img-responsive img-center listingProductImage"') . '</a>';
     for ($col = 0, $n = sizeof($column_list); $col < $n; $col++) {
         $lc_class = $lc_text = '';
         switch ($column_list[$col]) {
             case 'PRODUCT_LIST_NAME':
                 $lc_class = 'product-name';
                 $icons = BootstrapProductListing::product_icon_html($sese_icons, $listing);
                 $product_description = zen_trunc_string(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id'])), PRODUCT_LIST_DESCRIPTION);
                 $lc_text = "<h4 class='itemTitle'><a href='{$product_link}'><b>" . "{$listing->fields['products_name']}</b></a>{$icons}</h4>" . "<div class='hidden-xs listingDescription'>{$product_description}</div>\n" . "<div class='visible-xs'>{$product_image}</div>\n";
                 break;
             case 'PRODUCT_LIST_PRICE':
                 $lc_price = "<div class='text-center product-price'><b>" . zen_get_products_display_price($listing->fields['products_id']) . "</b></div>\n";
                 $lc_text = $lc_price;
                 $the_button = BootstrapProductListing::product_cart_button($listing, $product_link);
                 $products_link = "<a href='{$product_link}'>" . MORE_INFO_TEXT . '</a>';
                 $buy_now_button = zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
                 $lc_text .= BootstrapUtils::clean_buy_now_button($buy_now_button, $product_link);
                 $has_free_shipping = zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') && zen_get_product_is_always_free_shipping($listing->fields['products_id']);
                 if ($has_free_shipping) {
                     $lc_text .= TEXT_PRODUCT_FREE_SHIPPING_ICON . "<br />";
                 }
                 if (isset($listing->fields['products_model'])) {
                     $lc_text .= "<div class='text-center'><small class='item-number'><i>Item # {$listing->fields['products_model']}" . "</i></small></div>";
                 }
                 $form_action = zen_href_link(FILENAME_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product');
                 $lc_text = zen_draw_form('multiple_products_cart_quantity', $form_action, 'post', 'enctype="multipart/form-data"') . $lc_text . "</form>";
                 break;
        if ($products_filter > 0) {
            $contents[] = array('text' => zen_image(DIR_WS_CATALOG_IMAGES . $product_to_copy->fields['products_image'], $product_to_copy->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
        }
        $contents[] = array('text' => '<b>' . TEXT_PRODUCTS_NAME . $product_to_copy->fields['products_name'] . '<br />' . TEXT_PRODUCTS_MODEL . $product_to_copy->fields['products_model'] . '</b>');
        $contents[] = array('text' => '<br />' . TEXT_SET_PRODUCTS_TO_CATEGORIES_LINKS . '<br />' . TEXT_PRODUCTS_ID . zen_draw_input_field('products_filter', $products_filter));
        //      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . zen_href_link(FILENAME_PRODUCTS_TO_CATEGORIES, 'products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . '</form>');
        $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . zen_href_link(FILENAME_PRODUCTS_TO_CATEGORIES, 'products_filter=' . $_GET['products_filter']) . '">xxxx' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . '</form>');
        break;
    default:
        $heading[] = array('text' => '<b>' . $product_to_copy->fields['products_id'] . ' ' . $product_to_copy->fields['products_name'] . '</b>');
        if ($products_filter > 0) {
            $contents[] = array('text' => zen_image(DIR_WS_CATALOG_IMAGES . $product_to_copy->fields['products_image'], $product_to_copy->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
        }
        $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_NAME . $product_to_copy->fields['products_name']);
        $contents[] = array('text' => TEXT_PRODUCTS_MODEL . $product_to_copy->fields['products_model']);
        $contents[] = array('text' => TEXT_PRODUCTS_PRICE . zen_get_products_display_price($products_filter));
        switch (true) {
            case $product_to_copy->fields['master_categories_id'] == 0 and $products_filter > 0:
                $contents[] = array('text' => '<br /><span class="alert">' . WARNING_MASTER_CATEGORIES_ID . '</span><br />&nbsp;');
                break;
            default:
                $contents[] = array('text' => '<form action="' . FILENAME_PRODUCTS_TO_CATEGORIES . '.php' . '?action=edit&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id . '" method="post">');
                $contents[] = array('align' => 'center', 'text' => '<input type="submit" value="' . BUTTON_NEW_PRODUCTS_TO_CATEGORIES . '"></form>');
                $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', '3') . '<br />&nbsp;');
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter) . '">' . zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>&nbsp;&nbsp;' . '<a href="' . zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, '&products_filter=' . $products_filter) . '">' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '</a><br /><br />' . '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . zen_get_parent_category_id($products_filter) . '&pID=' . $products_filter . '&product_type=' . zen_get_products_type($products_filter)) . '">' . zen_image_button('button_details.gif', IMAGE_DETAILS) . '</a>&nbsp;&nbsp;' . '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=new_product' . '&cPath=' . zen_get_parent_category_id($products_filter) . '&pID=' . $products_filter . '&product_type=' . zen_get_products_type($products_filter)) . '">' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '</a>' . '<br />&nbsp;');
                break;
        }
        break;
}
if (zen_not_null($heading) && zen_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . "\n";
 * @copyright Portions Copyright 2003 osCommerce
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
$show_submit = zen_run_normal();
$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');
$zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $listing_split->number_of_rows);
$how_many = 0;
$tpl_products = array('title' => '', 'products' => array());
if ($listing_split->number_of_rows > 0) {
    $listing = $db->Execute($listing_split->sql_query, false, true, CACHE_TIMELIFT);
    while (!$listing->EOF) {
        $the_categories_name_query = "select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id= '" . $listing->fields['master_categories_id'] . "' and language_id= '" . $_SESSION['languages_id'] . "'";
        $the_categories_name = $db->Execute($the_categories_name_query, null, true, CACHE_TIMELIFT);
        $tpl_products['products'][$listing->fields['products_id']] = array('name' => $listing->fields['products_name'], 'image' => $listing->fields['products_image'], 'quantity' => $listing->fields['products_quantity'], 'weight' => $listing->fields['products_weight'], 'type' => $listing->fields['products_type'], 'categories_id' => $listing->fields['master_categories_id'], 'categories_name' => $the_categories_name->fields['categories_name'], 'categories_href' => zen_href_link(FILENAME_DEFAULT, 'cPath=' . $listing->fields['master_categories_id']), 'manufacturers_id' => $listing->fields['manufacturers_id'], 'products_price' => $listing->fields['products_price'], 'tax_class_id' => $listing->fields['products_tax_class_id'], 'description' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION), 'content' => $listing->fields['products_description'], 'specials_price' => $listing->fields['specials_new_products_price'], 'final_price' => $listing->fields['final_price'], 'sort_order' => $listing->fields['products_sort_order'], 'is_call' => $listing->fields['product_is_call'], 'is_always_free_shipping' => $listing->fields['product_is_always_free_shipping'], 'qty_box_status' => $listing->fields['products_qty_box_status'], 'href' => zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']), 'display_price' => zen_get_products_display_price($listing->fields['products_id']), 'is_free' => get_product_is_free($listing->fields['products_id']), 'display_normal_price' => get_normal_price($listing->fields['products_id']), 'display_special_price' => get_special_price($listing->fields['products_id']), 'display_sale_price' => get_sale_discount_price($listing->fields['products_id']));
        if (PRODUCT_LIST_MANUFACTURER != 0) {
            $tpl_products['products'][$listing->fields['products_id']]['show_manufacturer'] = true;
            $tpl_products['products'][$listing->fields['products_id']]['manufacturers_name'] = $listing->fields['manufacturers_name'];
            $tpl_products['products'][$listing->fields['products_id']]['manufacturers_href'] = zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']);
        }
        $listing->MoveNext();
    }
    $error_categories = false;
} else {
    $tpl_products = array('title' => '', 'products' => array());
    $error_categories = true;
}
$multiple_buy = false;
if ($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0 and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3)) {
    $show_top_submit_button = true;
Example #21
0
    $last_featured_products = $db->ExecuteRandomMulti($last_featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED);
}
$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';
$num_products_count = $featured_products_query == '' ? 0 : $featured_products->RecordCount();
// show only when 1 or more
if ($num_products_count > 0) {
    if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
        $col_width = floor(100 / $num_products_count);
    } else {
        $col_width = floor(100 / SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);
    }
    while (!$featured_products->EOF) {
        $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
        $fid = $featured_products->fields['products_id'];
        $products_query = "select * from " . TABLE_PRODUCTS . " where products_id='{$fid}' ORDER by products_date_added DESC";
        $products_res = $db->Execute($products_query);
        $specials_query = "select * from " . TABLE_SPECIALS . " where products_id='{$fid}'";
        $specials_res = $db->Execute($specials_query);
        $product_attribute_query = "select distinct products_id from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='{$fid}'";
        $product_attribute_query_result = $db->Execute($product_attribute_query);
        //$feature_query = "select * from ".TABLE_FEATURED." where products_id='$pid'";
        //$featured_res = $db->Execute($feature_query);
        $pid = $products_res->fields['products_id'];
        $sid = $specials_res->fields['products_id'];
        $attribute_product = $product_attribute_query_result->fields['products_id'];
        if ($fid == $pid) {
            $msg_product = "<div class='tag tag-orange' title=''><div class='text'>HOT</div></div>";
        } else {
Example #22
0
 function block_xsell_products()
 {
     global $db;
     $return = array();
     $products = array();
     $title = '';
     $query = "\r\n        select distinct\r\n          p.products_id, p.products_image,\r\n          pd.products_name,\r\n          pt.type_handler,\r\n          mf.manufacturers_name\r\n        from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p\r\n          LEFT JOIN " . TABLE_PRODUCT_TYPES . " pt ON p.products_type = pt.type_id\r\n          LEFT JOIN " . TABLE_MANUFACTURERS . " mf ON p.manufacturers_id = mf.manufacturers_id\r\n          ," . TABLE_PRODUCTS_DESCRIPTION . " pd\r\n        where xp.products_id = '" . (int) $_GET['products_id'] . "'\r\n          and xp.xsell_id = p.products_id\r\n          and p.products_id = pd.products_id\r\n          and pd.language_id = '" . $_SESSION['languages_id'] . "'\r\n          and p.products_status = 1\r\n        order by xp.sort_order asc limit " . (int) MODULE_CAROUSEL_UI_MAX_DISPLAY_XSELL_PRODUCTS;
     $result = $db->Execute($query);
     while (!$result->EOF) {
         $id = $result->fields['products_id'];
         $name = $result->fields['products_name'];
         $image = $result->fields['products_image'];
         $manufacturers = $result->fields['manufacturers_name'];
         if ($result->fields['type_handler'] == '') {
             $type_handler = 'product_info';
         } else {
             $type_handler = $result->fields['type_handler'] . '_info';
         }
         $link = zen_href_link($type_handler, 'products_id=' . $id);
         $price = zen_get_products_display_price($id);
         $products[] = array('id' => $id, 'name' => $name, 'image' => $image, 'link' => $link, 'price' => $price, 'manufacturers' => $manufacturers);
         $result->MoveNext();
     }
     if (count($products) > 0) {
         // 表示件数の倍になるようにする
         $visibleCount = (int) MODULE_CAROUSEL_UI_CONF_VISIBLE_XSELL_PRODUCTS;
         if ($visibleCount == 0) {
             $visibleCount = 1;
         }
         $addCount = count($products) % $visibleCount;
         if ($addCount > 0) {
             $addCount = $visibleCount - $addCount;
         }
         for ($i = 0; $i < $addCount; $i++) {
             $products[] = array('id' => 0, 'name' => '', 'image' => '', 'link' => '', 'price' => '', 'manufacturers' => '');
         }
         if (isset($parent_id) && $parent_id != 0) {
             $category_title = zen_get_categories_name((int) $parent_id);
             $title = sprintf(MODULE_CAROUSEL_UI_BLOCK_XSELL_PRODUCTS_TITLE, strftime('%B')) . ($category_title != '' ? ' - ' . $category_title : '');
         } else {
             $title = sprintf(MODULE_CAROUSEL_UI_BLOCK_XSELL_PRODUCTS_TITLE, strftime('%B'));
         }
         $return['title'] = $title;
         $return['products'] = $products;
         $return['ui_conf'] = array('auto' => (int) MODULE_CAROUSEL_UI_CONF_AUTO_XSELL_PRODUCTS, 'speed' => (int) MODULE_CAROUSEL_UI_CONF_SPEED_XSELL_PRODUCTS, 'vertical' => MODULE_CAROUSEL_UI_CONF_VERTICAL_XSELL_PRODUCTS == 'true' ? 'true' : 'false', 'circular' => MODULE_CAROUSEL_UI_CONF_CIRCULAR_XSELL_PRODUCTS == 'true' ? 'true' : 'false', 'visible' => (int) MODULE_CAROUSEL_UI_CONF_VISIBLE_XSELL_PRODUCTS, 'scroll' => (int) MODULE_CAROUSEL_UI_CONF_SCROLL_XSELL_PRODUCTS);
     }
     if ((int) MODULE_CAROUSEL_UI_CONF_VISIBLE_XSELL_PRODUCTS < count($products)) {
         $return['prevbutton'] = $this->imageButton(BUTTON_IMAGE_CAROUSEL_UI_PREVIOUS, BUTTON_CAROUSEL_UI_PREVIOUS_ALT, 'class="imgover"');
         $return['nextbutton'] = $this->imageButton(BUTTON_IMAGE_CAROUSEL_UI_NEXT, BUTTON_CAROUSEL_UI_NEXT_ALT, 'class="imgover"');
     } else {
         $return['prevbutton'] = $this->imageButton(BUTTON_IMAGE_CAROUSEL_UI_PREVIOUS_DISABLED, BUTTON_CAROUSEL_UI_DISABLED_ALT, '');
         $return['nextbutton'] = $this->imageButton(BUTTON_IMAGE_CAROUSEL_UI_NEXT_DISABLED, BUTTON_CAROUSEL_UI_DISABLED_ALT, '');
     }
     return $return;
 }
     $lc_text = $listing->fields['products_model'];
     break;
 case 'PRODUCT_LIST_NAME':
     $lc_align = '';
     if (isset($_GET['manufacturers_id'])) {
         $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
     } else {
         $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
     }
     break;
 case 'PRODUCT_LIST_MANUFACTURER':
     $lc_align = '';
     $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
     break;
 case 'PRODUCT_LIST_PRICE':
     $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
     $lc_align = 'right';
     $lc_text = $lc_price;
     // more info in place of buy now
     $lc_button = '';
     if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
         $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     } else {
         if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
             if ($listing->fields['products_qty_box_status'] != 0 && zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N' && $listing->fields['product_is_call'] == 0 && ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0)) {
                 $how_many++;
             }
             // hide quantity box
             if ($listing->fields['products_qty_box_status'] == 0) {
                 $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
             } else {
Example #24
0
<?php

/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_best_sellers.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
$content .= '<div class="wrapper">' . "\n" . '<div class="sideBoxContentItem">' . "\n";
for ($i = 1; $i <= sizeof($bestsellers_list); $i++) {
    $bestsellers_name = $bestsellers_list[$i]['name'];
    //$bestsellers_name=ltrim(substr($bestsellers_name, 0, 20));
    $bestsellers_list_price = zen_get_products_display_price($bestsellers_list[$i]['id']);
    $content .= '<div class="sidebox_content"><div class="product_sideboximage">' . zen_image(DIR_WS_IMAGES . $bestsellers_list[$i]['products_image'], $bestsellers_list[$i]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</div>';
    $content .= '<div class="product_sideboxname"><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_trunc_string($bestsellers_name, BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . '</a>';
    $content .= '<div class="sidebox_price">' . $bestsellers_list_price . '</div></div></div>';
}
$content .= '</div>' . "\n";
$content .= '</div>';
$content .= '</div>';
if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0) {
    $specials_query_raw = "SELECT p.products_id, p.products_image, pd.products_name,\n                          p.master_categories_id\n                         FROM (" . TABLE_PRODUCTS . " p\n                         LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id\n                         LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )\n                         WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1'\n                         AND s.status = 1\n                         AND pd.language_id = :languagesID\n                         AND p.shop_id = " . (int) $_SESSION['shop_id'] . "\n                         ORDER BY s.specials_date_added DESC";
    $specials_query_raw = $db->bindVars($specials_query_raw, ':languagesID', $_SESSION['languages_id'], 'integer');
    $specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);
    $specials = $db->Execute($specials_split->sql_query);
    $row = 0;
    $col = 0;
    $list_box_contents = array();
    $title = '';
    $num_products_count = $specials->RecordCount();
    if ($num_products_count) {
        if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS == 0) {
            $col_width = floor(100 / $num_products_count);
        } else {
            $col_width = floor(100 / SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS);
        }
        $list_box_contents = array();
        while (!$specials->EOF) {
            $products_price = zen_get_products_display_price($specials->fields['products_id']);
            $specials->fields['products_name'] = zen_get_products_name($specials->fields['products_id']);
            $list_box_contents[$row][$col] = array('params' => 'class="specialsListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . (($specials->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : zen_image(DIR_WS_IMAGES . $specials->fields['products_image'], $specials->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>') . '<br /><a class="pro_name_hight" href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . $specials->fields['products_name'] . '</a><br />' . $products_price);
            $col++;
            if ($col > SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS - 1) {
                $col = 0;
                $row++;
            }
            $specials->MoveNext();
        }
        require $template->get_template_dir('tpl_specials_default.php', DIR_WS_TEMPLATE, $current_page_base, 'templates') . '/tpl_specials_default.php';
    }
}
 public static function price()
 {
     global $show_onetime_charges_description, $flag_show_product_info_starting_at;
     global $_GET;
     $one_time_text = '';
     if ($show_onetime_charges_description == 'true') {
         $one_time_text = ' <div> Your Price: ' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</div>';
     }
     $base_price_text = '';
     if (zen_has_product_attributes_values((int) $_GET['products_id']) && $flag_show_product_info_starting_at == 1) {
         $base_price_text = TEXT_BASE_PRICE;
     }
     $display_price = zen_get_products_display_price((int) $_GET['products_id']);
     return '<h4 id="product-price" class="text-center">' . $one_time_text . $base_price_text . $display_price . '</h4>';
 }
Example #27
0
<?php

/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2011 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_featured.php 18698 2011-05-04 14:50:06Z wilt $
 */
$content = "";
$content .= '<div class="sideBoxContent centeredContent">';
$featured_box_counter = 0;
while (!$random_featured_product->EOF) {
    $featured_box_counter++;
    $featured_box_price = zen_get_products_display_price($random_featured_product->fields['products_id']);
    $content .= "\n" . '  <div class="sideBoxContentItem">';
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $content .= '<br />' . $random_featured_product->fields['products_name'] . '</a>';
    $content .= '<div>' . $featured_box_price . '</div>';
    $content .= '</div>';
    $random_featured_product->MoveNextRandom();
}
$content .= '</div>' . "\n";
Example #28
0
        default:
            if (is_object($sInfo)) {
                $heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');
                if ($sInfo->products_priced_by_attribute == '1') {
                    $specials_current_price = zen_get_products_base_price($sInfo->products_id);
                } else {
                    $specials_current_price = $sInfo->products_price;
                }
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'action=edit&products_filter=' . $sInfo->products_id) . '">' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '</a>');
                $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($sInfo->specials_date_added));
                $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($sInfo->specials_last_modified));
                $contents[] = array('align' => 'center', 'text' => '<br>' . zen_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
                $contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($specials_current_price));
                $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price));
                $contents[] = array('text' => '' . TEXT_INFO_DISPLAY_PRICE . ' ' . zen_get_products_display_price($sInfo->products_id));
                $contents[] = array('text' => '<br>' . TEXT_INFO_AVAILABLE_DATE . ' <b>' . (($specials->fields['specials_date_available'] != '0001-01-01' and $specials->fields['specials_date_available'] != '') ? zen_date_short($specials->fields['specials_date_available']) : TEXT_NONE) . '</b>');
                $contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . (($specials->fields['expires_date'] != '0001-01-01' and $specials->fields['expires_date'] != '') ? zen_date_short($specials->fields['expires_date']) : TEXT_NONE) . '</b>');
                $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . zen_date_short($sInfo->date_status_change));
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CATEGORIES, '&action=new_product' . '&cPath=' . zen_get_product_path($sInfo->products_id, 'override') . '&pID=' . $sInfo->products_id . '&product_type=' . zen_get_products_type($sInfo->products_id)) . '">' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '<br />' . TEXT_PRODUCT_EDIT . '</a>');
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_SPECIALS, 'action=pre_add') . '">' . zen_image_button('button_select.gif', IMAGE_SELECT) . '<br />' . TEXT_INFO_MANUAL . '</a><br /><br />');
            }
            break;
    }
    if (zen_not_null($heading) && zen_not_null($contents)) {
        echo '            <td width="25%" valign="top">' . "\n";
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . "\n";
    }
}
<h1 id="productName" class="docProduct"><?php 
echo $products_name;
?>
</h1>
<!--eof Product Name-->

<!--bof Product Price block -->
<h2 id="productPrices" class="docProduct">
<?php 
// base price
if ($show_onetime_charges_description == 'true') {
    $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
} else {
    $one_time = '';
}
echo $one_time . ((zen_has_product_attributes_values((int) $_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int) $_GET['products_id']);
?>
</h2>
<!--eof Product Price block -->

<!--bof free ship icon  -->
<?php 
if (zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) {
    ?>
<div id="freeShippingIcon"><?php 
    echo TEXT_PRODUCT_FREE_SHIPPING_ICON;
    ?>
</div>
<?php 
}
?>
Example #30
0
<?php

/**
 * whats_new sidebox - displays a random "new" product
 *
 * @package templateSystem
 * @author JunsGo@msn.com
 * @copyright Copyright 2013 SL Development Team
 * @copyright Portions Copyright 2003 osCommerce
 */
// display limits
// $display_limit = zen_get_products_new_timelimit();
$idx = 0;
$tpl_what_new = array();
$display_limit = zen_get_new_date_range();
// var_dump($display_limit);exit;
$random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name,\n                                              p.master_categories_id, p.product_is_free\n                           from (" . TABLE_PRODUCTS . " p\n                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )\n                           where p.products_id = pd.products_id\n                           and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n                           and p.shop_id = " . (int) $_SESSION['shop_id'] . "\n                           and p.products_status = 1 " . $display_limit;
$random_whats_new_sidebox_product = $db->ExecuteRandomMulti($random_whats_new_sidebox_product_query, MAX_RANDOM_SELECT_NEW, true, CACHE_TIMELIFT);
if ($random_whats_new_sidebox_product->RecordCount() > 0) {
    // var_dump($random_whats_new_sidebox_product);
    // exit;
    while (!$random_whats_new_sidebox_product->EOF) {
        $tpl_what_new[$idx] = array('id' => $random_whats_new_sidebox_product->fields['products_id'], 'name' => $random_whats_new_sidebox_product->fields['products_name'], 'href' => zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($random_whats_new_sidebox_product->fields['master_categories_id']) . '&products_id=' . $random_whats_new_sidebox_product->fields['products_id']), 'image' => $random_whats_new_sidebox_product->fields['products_image'], 'price' => zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']), 'categories_id' => $random_whats_new_sidebox_product->fields['master_categories_id'], 'tax_class_id' => $random_whats_new_sidebox_product->fields['products_tax_class_id'], 'is_free' => $random_whats_new_sidebox_product->fields['product_is_free'] == '1' ? true : false, 'display_normal_price' => get_normal_price($random_whats_new_sidebox_product->fields['products_id']), 'display_special_price' => get_special_price($random_whats_new_sidebox_product->fields['products_id']), 'display_sale_price' => get_sale_discount_price($random_whats_new_sidebox_product->fields['products_id']));
        ++$idx;
        $random_whats_new_sidebox_product->MoveNextRandom();
    }
    unset($idx);
    require $template->get_template_dir('tpl_whats_new2.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_whats_new2.php';
}