示例#1
0
function rss_feed_title($feed = false)
{
    global $current_category_id;
    if (!$feed) {
        $feed = $_GET['feed'];
    } else {
        if (($i = strpos($feed, '&')) !== false) {
            $feed_args = substr($feed, $i + 1);
            $feed = substr($feed, 0, $i);
        }
    }
    switch (true) {
        case $feed == 'news':
            $title = TEXT_RSS_NEWS;
            break;
        case $feed == 'categories':
            $title = TEXT_RSS_CATEGORIES;
            if (isset($_GET['cPath']) && $current_category_id > 0) {
                $title .= RSS_TITLE_DELIMITER2 . strip_tags(zen_get_categories_name((int) $current_category_id));
            }
            break;
        case $feed == 'specials_random':
        case $feed == 'specials':
            $title = TEXT_RSS_SPECIALS;
            break;
        case $feed == 'featured_random':
        case $feed == 'featured':
            $title = TEXT_RSS_FEATURED_PRODUCTS;
            break;
        case $feed == 'best_sellers_random':
        case $feed == 'best_sellers':
            $title = TEXT_RSS_BEST_SELLERS;
            break;
        case $feed == 'upcoming_random':
        case $feed == 'upcoming':
            $title = TEXT_RSS_UPCOMING_PRODUCTS;
            break;
        case $feed == 'new_products_random':
        case $feed == 'new_products':
            $title = TEXT_RSS_PRODUCTS_NEW;
            break;
        case $feed == 'products':
            if (isset($_GET['products_id'])) {
                $title = TEXT_RSS_PRODUCT . RSS_TITLE_DELIMITER2 . strip_tags(zen_get_products_name((int) $_GET['products_id']));
            } elseif (isset($_GET['cPath']) && $current_category_id > 0) {
                $title = TEXT_RSS_PRODUCTS . RSS_TITLE_DELIMITER2 . strip_tags(zen_get_categories_name((int) $current_category_id));
            } else {
                $title = TEXT_RSS_PRODUCTS_ALL;
            }
            break;
        default:
            $title = TEXT_RSS_FEED;
            break;
    }
    return $title;
}
 function verifyQuantity($pProductsKey, $pQty)
 {
     $pQty = (int) $pQty;
     // verify qty to add
     $add_max = zen_get_products_quantity_order_max($_REQUEST['products_id']);
     $cart_qty = $gBitCustomer->mCart->in_cart_mixed($_REQUEST['products_id']);
     $new_qty = zen_get_buy_now_qty($_REQUEST['products_id']);
     if ($add_max == 1 and $cart_qty == 1) {
         // do not add
         $new_qty = 0;
     } else {
         // adjust quantity if needed
         if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
             $new_qty = $add_max - $cart_qty;
         }
     }
     if (!empty($adjust_max) && $adjust_max == 'true') {
         $messageStack->add_session('header', ERROR_MAXIMUM_QTY . ' - ' . zen_get_products_name($prodId), 'caution');
     }
     if ($product = $this->getProductObject($pProductsKey)) {
         if (is_object($product) && $pQty > $product->getField('products_quantity_order_max')) {
             // we are trying to add quantity greater than max purchable quantity
             $pQty = $product->getField('products_quantity_order_max');
         }
     } else {
         // product couldn't load, delete from card
         $pQty = 0;
     }
     return $pQty;
 }
 case 'attribute_features':
     $copy_attributes_delete_first = '0';
     $copy_attributes_duplicates_skipped = '0';
     $copy_attributes_duplicates_overwrite = '0';
     $copy_attributes_include_downloads = '1';
     $copy_attributes_include_filename = '1';
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
     $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . TEXT_PRODUCTS_ATTRIBUTES_INFO . '</strong>' . '<br />');
     $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><br />' . (zen_has_product_attributes($pInfo->products_id, 'false') ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attributes_preview' . '&products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>' . '&nbsp;&nbsp;' : '') . '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>' . '<br /><br />');
     // only if attributes
     if (zen_has_product_attributes($pInfo->products_id, 'false')) {
         $contents[] = array('align' => 'left', 'text' => '<br />' . '<strong>' . TEXT_PRODUCT_ATTRIBUTES_DOWNLOADS . '</strong>' . zen_has_product_attributes_downloads($pInfo->products_id) . zen_has_product_attributes_downloads($pInfo->products_id, true));
         $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_DELETE . '<strong>' . zen_get_products_name($pInfo->products_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_attributes' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
         $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_UPDATES . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=update_attributes_sort_order' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');
         $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_PRODUCT . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
         $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_CATEGORY . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_category' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
     }
     $contents[] = array('align' => 'center', 'text' => '<br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
     // attribute copier to product
 // attribute copier to product
 case 'attribute_features_copy_to_product':
     $_GET['products_update_id'] = '';
     // excluded current product from the pull down menu of products
     $products_exclude_array = array();
     $products_exclude_array[] = $pInfo->products_id;
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
     $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=update_attributes_copy_to_product&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id) . zen_draw_hidden_field('products_update_id', $_GET['products_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']));
     $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE);
     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_draw_products_pull_down('products_update_id', '', $products_exclude_array, true) . '<br /><br />' . zen_image_submit('button_copy_to.gif', IMAGE_COPY_TO) . '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
<?php

/**
 * Electronics Template designed by zen-cart-power.com
 * zen-cart-power.com - Zen Cart templates and modules
 * Power your Zen Cart!
 * 
 * 
 * @copyright Copyright 2008-2009 Zen-Cart-Power.com
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */
$content = "";
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
$content .= '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BOX_NOTIFY_REMOVE, OTHER_BOX_NOTIFY_REMOVE_ALT) . '</a>';
$content .= '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . '<br />' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, zen_get_products_name($_GET['products_id'])) . '</a>';
$content .= '</div>';
echo TEXT_PRODUCTS_METATAGS_TITLE_TAGLINE_STATUS . '<br />' . zen_draw_radio_field('metatags_title_tagline_status', '1', $is_metatags_title_tagline_status) . '&nbsp;' . TEXT_YES . '&nbsp;' . zen_draw_radio_field('metatags_title_tagline_status', '0', $not_metatags_title_tagline_status) . '&nbsp;' . TEXT_NO;
?>
              </td>
            </tr>
          </table>
        </td>
      </tr>
<?php 
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
    ?>
      <tr>
        <td><table border="3" cellspacing="4" cellpadding="6">
          <tr>
            <td class="main" colspan="2">
              <?php 
    echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . '<strong>' . TEXT_PRODUCTS_NAME . '</strong>' . '&nbsp;' . zen_get_products_name($_GET['pID'], $languages[$i]['id']) . '&nbsp;&nbsp;&nbsp;<strong>' . TEXT_PRODUCTS_MODEL . '</strong>&nbsp;' . $pInfo->products_model . '&nbsp;&nbsp;&nbsp;<strong>' . TEXT_PRODUCTS_PRICE_INFO . '</strong>&nbsp;' . $currencies->format($pInfo->products_price_sorter);
    ?>
            </td>
          </tr>
          <tr>
            <td class="main"valign="top"><?php 
    echo TEXT_META_TAGS_TITLE;
    ?>
&nbsp;</td>
            <td class="main">
              <?php 
    echo zen_draw_input_field('metatags_title[' . $languages[$i]['id'] . ']', isset($metatags_title[$languages[$i]['id']]) ? stripslashes($metatags_title[$languages[$i]['id']]) : zen_get_metatags_title($pInfo->products_id, $languages[$i]['id']), zen_set_field_length(TABLE_META_TAGS_PRODUCTS_DESCRIPTION, 'metatags_title', '150', false));
    //,'id="'.'metatags_title' . $languages[$i]['id'] . '"');
    ?>
            </td>
          </tr>
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';
    }
}
<?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_no_notifications.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
$content = "";
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
$content .= '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BOX_NOTIFY_YES, OTHER_BOX_NOTIFY_YES_ALT) . '<br />' . sprintf(BOX_NOTIFICATIONS_NOTIFY, zen_get_products_name($_GET['products_id'])) . '</a>';
$content .= '</div>';
示例#8
0
            $reviews_text = $db->Execute("select r.reviews_read, r.customers_name,\r\n                                             length(rd.reviews_text) as reviews_text_size\r\n                                      from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd\r\n                                      where r.reviews_id = '" . (int) $reviews->fields['reviews_id'] . "'\r\n                                      and r.reviews_id = rd.reviews_id");
            $products_image = $db->Execute("select products_image\r\n                                        from " . TABLE_PRODUCTS . "\r\n                                        where products_id = '" . (int) $reviews->fields['products_id'] . "'");
            $products_name = $db->Execute("select products_name\r\n                                       from " . TABLE_PRODUCTS_DESCRIPTION . "\r\n                                       where products_id = '" . (int) $reviews->fields['products_id'] . "'\r\n                                       and language_id = '" . (int) $_SESSION['languages_id'] . "'");
            $reviews_average = $db->Execute("select (avg(reviews_rating) / 5 * 100) as average_rating\r\n                                         from " . TABLE_REVIEWS . "\r\n                                         where products_id = '" . (int) $reviews->fields['products_id'] . "'");
            $review_info = array_merge($reviews_text->fields, $reviews_average->fields, $products_name->fields);
            $rInfo_array = array_merge($reviews->fields, $review_info, $products_image->fields);
            $rInfo = new objectInfo($rInfo_array);
        }
        if (isset($rInfo) && is_object($rInfo) && $reviews->fields['reviews_id'] == $rInfo->reviews_id) {
            echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=preview') . '\'">' . "\n";
        } else {
            echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews->fields['reviews_id']) . '\'">' . "\n";
        }
        ?>
                <td class="dataTableContent"><?php 
        echo '<a href="' . zen_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews->fields['reviews_id'] . '&action=preview') . '">' . zen_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . zen_get_products_name($reviews->fields['products_id']);
        ?>
</td>
                <td class="dataTableContent"><?php 
        echo $reviews->fields['customers_name'];
        ?>
</td>
                <td class="dataTableContent" align="right"><?php 
        echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews->fields['reviews_rating'] . '.gif');
        ?>
</td>
                <td class="dataTableContent" align="right"><?php 
        echo zen_date_short($reviews->fields['date_added']);
        ?>
</td>
                <td  class="dataTableContent" align="center">
示例#9
0
                  </tr>
<?php 
$pr_query_raw = "select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and product_id != '0'";
$pr_split = new splitPageResults($_GET['ppage'], MAX_DISPLAY_RESTRICT_ENTRIES, $pr_query_raw, $pr_query_numrows);
$pr_list = $db->Execute($pr_query_raw);
while (!$pr_list->EOF) {
    $rows++;
    if (strlen($rows) < 2) {
        $rows = '0' . $rows;
    }
    if ((!$_GET['cid'] || @$_GET['cid'] == $cr_list->fields['restrict_id']) && !$pInfo) {
        $pInfo = new objectInfo($pr_list);
    }
    echo '          <tr class="dataTableRow">' . "\n";
    $coupon = $db->Execute("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $_GET['cid'] . "' and language_id = '" . (int) $_SESSION['languages_id'] . "'");
    $product_name = zen_get_products_name($pr_list->fields['product_id'], $_SESSION['languages_id']);
    ?>
                <td class="dataTableContent"><?php 
    echo $_GET['cid'];
    ?>
</td>
                <td class="dataTableContent" align="center"><?php 
    echo $coupon->fields['coupon_name'];
    ?>
</td>
                <td class="dataTableContent" align="center"><?php 
    echo $pr_list->fields['product_id'];
    ?>
</td>
                <td class="dataTableContent" align="left"><?php 
    echo '<strong>' . $product_name . '</strong><br />' . TEXT_CATEGORY . zen_get_categories_name_from_product($pr_list->fields['product_id']) . '<br />' . TEXT_MANUFACTURER . zen_get_products_manufacturers_name($pr_list->fields['product_id']);
示例#10
0
 *
 * 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 
示例#11
0
<?php

/**
 * whats_new sidebox - displays a random "new" product
 *
 * @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: whats_new.php 2769 2006-01-02 07:34:58Z drbyte $
 */
// display limits
$display_limit = zen_get_products_new_timelimit();
$random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price\r\n                           from " . TABLE_PRODUCTS . " p\r\n                           where p.products_status = 1 " . $display_limit . "\r\n                           limit " . MAX_RANDOM_SELECT_NEW;
$random_whats_new_sidebox_product = zen_random_select($random_whats_new_sidebox_product_query);
if ($random_whats_new_sidebox_product->RecordCount() > 0) {
    $whats_new_price = zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']);
    $random_whats_new_sidebox_product->fields['products_name'] = zen_get_products_name($random_whats_new_sidebox_product->fields['products_id']);
    $random_whats_new_sidebox_product->fields['specials_new_products_price'] = zen_get_products_special_price($random_whats_new_sidebox_product->fields['products_id']);
    require $template->get_template_dir('tpl_whats_new.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_whats_new.php';
    $title = BOX_HEADING_WHATS_NEW;
    $title_link = FILENAME_PRODUCTS_NEW;
    require $template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base, 'common') . '/' . $column_box_default;
}
示例#12
0
      }
    });
  }
</script>

<?php 
echo $html->form('index');
?>
  <input type="submit" value="<?php 
echo MODULE_EASY_ADMIN_PRODUCTS_LIST;
?>
">
</form>
<div>
<?php 
echo TEXT_INFO_ID . $products_id . ' ' . zen_get_products_model($products_id) . ' - ' . zen_get_products_name($products_id);
?>
</div>
<?php 
global $zco_notifier;
$zco_notifier->notify('NOTIFY_EASY_ADMIN_PRODUCTS_FINISH_DISPLAY_SEARCH_FORM');
?>


<div class="listBox">
<table border="0" class="tableLayout3" width="100%" cellspacing="0" cellpadding="0">
  <?php 
require dirname(__FILE__) . '/products_attributes_list.php';
?>
</table>
</div>
示例#13
0
                        </tr>
                        <tr>
                            <td class="infoBoxContent"><br><b><?php 
echo HEADING_SUBSCRIPTION_ACTIVE;
?>
:</b> <?php 
echo $bis_sub_info['sub_active'] == 1 ? 'Y' : 'N';
?>
</td>
                        </tr>
                        <tr>
                            <td class="infoBoxContent"><br><b><?php 
echo HEADING_PRODUCT;
?>
:</b> <?php 
echo zen_get_products_name($bis_sub_info['product_id']);
?>
</td>
                        </tr>
                        <tr>
                            <td class="infoBoxContent"><br><b><?php 
echo HEADING_CANCEL_W_PURCHASE;
?>
:</b> <?php 
echo $bis_sub_info['active_til_purch'] == 1 ? 'Y' : 'N';
?>
</td>
                        </tr>
                        <tr>
                            <td class="infoBoxContent"><br><b><?php 
echo HEADING_LAST_SENT;
//if (isset($_GET['products_id']) && SHOW_PRODUCT_INFO_COLUMNS_also_purchased_products_db > 0 && MIN_DISPLAY_ALSO_PURCHASED > 0) {
if (isset($_GET['products_id']) && is_numeric($_GET['products_id']) && SHOW_PRODUCT_INFO_COLUMNS_ALSO_PURCHASED_PRODUCTS > 0 && MIN_DISPLAY_ALSO_PURCHASED > 0) {
    //$also_purchased_products_db = $db->Execute(sprintf(SQL_ALSO_PURCHASED, (int)$_GET['products_id'], (int)$_GET['products_id']));
    $also_purchased_products_db_sql = ' SELECT  p.products_id,                                            
										    p.products_image
									FROM ' . TABLE_ORDERS_PRODUCTS . ' opa, 
										 ' . TABLE_ORDERS_PRODUCTS . ' opb, 
										 ' . TABLE_ORDERS . ' o, 
										 ' . TABLE_PRODUCTS . ' p
									WHERE opa.products_id =' . (int) $_GET['products_id'] . '
									AND   opa.orders_id = opb.orders_id
									AND   opb.products_id !=' . (int) $_GET['products_id'] . '
									AND   opb.products_id = p.products_id
									AND   opb.orders_id = o.orders_id
									AND   p.products_status =1
									GROUP BY p.products_id
									ORDER BY o.date_purchased DESC
									LIMIT 6 ';
    $also_purchased_products = array();
    $also_purchased_products_db = $db->Execute($also_purchased_products_db_sql);
    $num_products_ordered = $also_purchased_products_db->RecordCount();
    // show only when 1 or more and equal to or greater than minimum set in admin
    if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED && $num_products_ordered > 0) {
        while (!$also_purchased_products_db->EOF) {
            $tmp_id = $also_purchased_products_db->fields['products_id'];
            $also_purchased_products[] = array('products_name' => zen_get_products_name($tmp_id), 'products_url_link' => zen_href_link(zen_get_info_page($tmp_id), 'products_id=' . $tmp_id), 'products_image' => $also_purchased_products_db->fields['products_image'], 'products_price' => zen_get_products_display_price($tmp_id));
            $also_purchased_products_db->MoveNext();
        }
        $zc_show_also_purchased = true;
    }
}
 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;
 }
示例#16
0
if (zen_not_null($_POST)) {
    $pInfo = new objectInfo($_POST);
    $products_name = $_POST['products_name'];
    $products_description = $_POST['products_description'];
    $products_url = $_POST['products_url'];
} else {
    $product = $db->Execute("select p.products_id, pd.language_id, pd.products_name,\r\n                                      pd.products_description, pd.products_url, p.products_quantity,\r\n                                      p.products_model, p.products_image, p.products_price, p.products_virtual,\r\n                                      p.products_weight, p.products_date_added, p.products_last_modified,\r\n                                      p.products_date_available, p.products_status, p.manufacturers_id,\r\n                                      p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,\r\n                                      p.product_is_free, p.product_is_call, p.products_quantity_mixed,\r\n                                      p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max,\r\n                    p.products_sort_order\r\n                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd\r\n                               where p.products_id = pd.products_id\r\n                               and p.products_id = '" . (int) $_GET['pID'] . "'");
    $pInfo = new objectInfo($product->fields);
    $products_image_name = $pInfo->products_image;
}
$form_action = isset($_GET['pID']) ? 'update_product' : 'insert_product';
echo zen_draw_form($form_action, $type_admin_handler, 'cPath=' . $cPath . (isset($_GET['product_type']) ? '&product_type=' . $_GET['product_type'] : '') . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=' . $form_action . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'post', 'enctype="multipart/form-data"');
$languages = zen_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
    if (isset($_GET['read']) && $_GET['read'] == 'only') {
        $pInfo->products_name = zen_get_products_name($pInfo->products_id, $languages[$i]['id']);
        $pInfo->products_description = zen_get_products_description($pInfo->products_id, $languages[$i]['id']);
        $pInfo->products_url = zen_get_products_url($pInfo->products_id, $languages[$i]['id']);
    } else {
        $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;
 ///////////////////////////////////////////////////////////////
 // get products to be removed as added linked from
 $products_to_categories_from_linked = $db->Execute("select ptoc.products_id, p.master_categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptoc left join " . TABLE_PRODUCTS . " p on ptoc.products_id=p.products_id where ptoc.categories_id='" . $remove_from_linked . "'");
 while (!$products_to_categories_from_linked->EOF) {
     if ($products_to_categories_from_linked->fields['master_categories_id'] == $remove_to_linked) {
         //die('THIS IS THE MASTER CATEGORIES ID!! ' . $remove_to_linked . '<br>');
         //break;
         $master_categories_id_stop[] = array('products_id' => $products_to_categories_from_linked->fields['products_id'], 'master_categories_id' => $products_to_categories_from_linked->fields['master_categories_id']);
     }
     $add_links_array[] = array('products_id' => $products_to_categories_from_linked->fields['products_id'], 'master_categories_id' => $products_to_categories_from_linked->fields['master_categories_id']);
     $products_to_categories_from_linked->MoveNext();
 }
 $stop_warning = '';
 if (sizeof($master_categories_id_stop) > 0) {
     for ($i = 0, $n = sizeof($master_categories_id_stop); $i < $n; $i++) {
         $stop_warning .= TEXT_PRODUCTS_ID . $master_categories_id_stop[$i]['products_id'] . ': ' . zen_get_products_name($master_categories_id_stop[$i]['products_id']) . '<br>';
     }
     $stop_warning_message = WARNING_MASTER_CATEGORIES_ID_CONFLICT . ' ' . TEXT_MASTER_CATEGORIES_ID_CONFLICT_FROM . $remove_from_linked . TEXT_MASTER_CATEGORIES_ID_CONFLICT_TO . $remove_to_linked . '<br />' . TEXT_INFO_MASTER_CATEGORIES_ID_PURPOSE . WARNING_MASTER_CATEGORIES_ID_CONFLICT_FIX . '<br /><br />' . TEXT_INFO_MASTER_CATEGORIES_ID_CONFLICT . $remove_to_linked . '<br />' . $stop_warning . '<br />';
     $messageStack->add_session($stop_warning_message, 'warning');
     zen_redirect(zen_href_link(FILENAME_PRODUCTS_TO_CATEGORIES, 'products_filter=' . $master_categories_id_stop[0]['products_id'] . '&current_category_id=' . $current_category_id));
     //          die('THIS IS THE MASTER CATEGORIES ID!! ' . $remove_to_linked . ' - stop: ' . sizeof($master_categories_id_stop) . '<br>');
 }
 // get products already in category to be removed as linked to
 $products_to_categories_to_linked = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $remove_to_linked . "'");
 while (!$products_to_categories_to_linked->EOF) {
     $remove_links_array[] = array('products_id' => $products_to_categories_to_linked->fields['products_id']);
     $products_to_categories_to_linked->MoveNext();
 }
 //        $cnt_removed = 0;
 // remove elements in $remove_links_array that are in $add_links_array
 for ($i = 0, $n = sizeof($add_links_array); $i < $n; $i++) {
 * @version $Id: also_purchased_products.php 5369 2006-12-23 10:55:52Z drbyte $
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
if (isset($_GET['products_id']) && SHOW_PRODUCT_INFO_COLUMNS_ALSO_PURCHASED_PRODUCTS > 0 && MIN_DISPLAY_ALSO_PURCHASED > 0) {
    $also_purchased_products = $db->Execute(sprintf(SQL_ALSO_PURCHASED, (int) $_GET['products_id'], (int) $_GET['products_id']));
    $num_products_ordered = $also_purchased_products->RecordCount();
    $row = 0;
    $col = 0;
    $list_box_contents = array();
    $title = '';
    // show only when 1 or more and equal to or greater than minimum set in admin
    if ($num_products_ordered > 0 && $num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) {
        while (!$also_purchased_products->EOF) {
            $also_purchased_products->fields['products_name'] = zen_get_products_name($also_purchased_products->fields['products_id']);
            $product_link = zen_href_link(zen_get_info_page($also_purchased_products->fields['products_id']), 'products_id=' . $also_purchased_products->fields['products_id']);
            $show_image = $also_purchased_products->fields['products_image'] != '' || PRODUCTS_IMAGE_NO_IMAGE_STATUS != 0;
            if ($show_image) {
                $product_image = zen_image(DIR_WS_IMAGES . $also_purchased_products->fields['products_image'], $also_purchased_products->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class="img-responsive img-center"');
                $text = "<a class='thumbnail' href='{$product_link}'>{$product_image}" . "{$also_purchased_products->fields['products_name']}</a>";
            } else {
                $text = "<a href='{$product_link}'>" . "{$also_purchased_products->fields['products_name']}</a>";
            }
            $list_box_contents[$row][$col] = array('params' => 'class="' . BootstrapUtils::$thumbnail_grid_classes . '"', 'text' => $text);
            $col++;
            if ($col > SHOW_PRODUCT_INFO_COLUMNS_ALSO_PURCHASED_PRODUCTS - 1) {
                $col = 0;
                $row++;
            }
            $also_purchased_products->MoveNext();
function zen_get_products_image($product_id, $width = SMALL_IMAGE_WIDTH, $height = SMALL_IMAGE_HEIGHT)
{
    global $db;
    $sql = "select p.products_image from " . TABLE_PRODUCTS . " p  where products_id='" . (int) $product_id . "'";
    $look_up = $db->Execute($sql);
    return zen_image(DIR_WS_IMAGES . $look_up->fields['products_image'], zen_get_products_name($product_id), $width, $height);
}
<?php

//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | 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: tpl_yes_notifications.php 290 2004-09-15 19:48:26Z wilt $
//
$content = "";
$content .= '<div class="sideBoxContents" align="center"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BOX_NOTIFY_REMOVE, OTHER_BOX_NOTIFY_REMOVE_ALT) . '</a><br /><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, zen_get_products_name($_GET['products_id'])) . '</a></div>';
&nbsp;</td>
      	    <td class="pageHeading" valign="top">&nbsp;
              <input type="hidden" name="products_id" value="<?php 
            echo $products_filter;
            ?>
">
              <input type="hidden" name="current_category_id" value="<?php 
            echo $current_category_id;
            ?>
">
      	      <?php 
            $show_model = zen_get_products_model($products_filter);
            if (!empty($show_model)) {
                $show_model = " - (" . $show_model . ")";
            }
            echo zen_clean_html(zen_get_products_name($products_filter)) . $show_model;
            ?>
      	    </td>
          </tr></table></td></tr>
          <tr class="attributeBoxContent"><td><table><tr>
            <td class="attributeBoxContent" width="40">&nbsp;</td>
            <td class="attributeBoxContent">&nbsp;<?php 
            echo TABLE_HEADING_OPT_NAME . '<br />';
            ?>
              <select name="options_id" id="OptionName" onChange="update_option(this.form)" size="<?php 
            echo $action != 'delete_attribute' ? "15" : "1";
            ?>
">
<?php 
            $options_values = $db->Execute("select * from " . TABLE_PRODUCTS_OPTIONS . "\n                                    where language_id = '" . (int) $_SESSION['languages_id'] . "'\n                                    order by products_options_name");
            while (!$options_values->EOF) {
示例#22
0
<?php 
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
    ?>
      <tr>
        <td><table border="3" cellspacing="4" cellpadding="6">
          <tr>
<!-- // not used for documents
            <td class="main" colspan="2">
              <?php 
    echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . '<strong>' . TEXT_DOCUMENT_NAME . '</strong>' . '&nbsp;' . zen_get_products_name($_GET['pID'], $languages[$i]['id']) . '&nbsp;&nbsp;&nbsp;<strong>' . TEXT_PRODUCTS_MODEL . '</strong>&nbsp;' . $pInfo->products_model . '&nbsp;&nbsp;&nbsp;<strong>' . TEXT_PRODUCTS_PRICE_INFO . '</strong>&nbsp;' . $currencies->format($pInfo->products_price_sorter);
    ?>
            </td>
-->
            <td class="main" colspan="2">
              <?php 
    echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . '<strong>' . TEXT_DOCUMENT_NAME . '</strong>' . '&nbsp;' . zen_get_products_name($_GET['pID'], $languages[$i]['id']);
    ?>
            </td>

          </tr>
          <tr>
            <td class="main"valign="top"><?php 
    echo TEXT_META_TAGS_TITLE;
    ?>
&nbsp;</td>
            <td class="main">
              <?php 
    echo zen_draw_input_field('metatags_title[' . $languages[$i]['id'] . ']', htmlspecialchars(isset($metatags_title[$languages[$i]['id']]) ? stripslashes($metatags_title[$languages[$i]['id']]) : zen_get_metatags_title($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_META_TAGS_PRODUCTS_DESCRIPTION, 'metatags_title', '150', false));
    //,'id="'.'metatags_title' . $languages[$i]['id'] . '"');
    ?>
            </td>
示例#23
0
require DIR_WS_CLASSES . 'currencies.php';
$currencies = new currencies();
switch ($_GET['action']) {
    case 'update_sort_order':
        foreach ($_POST['options_values_new_sort_order'] as $id => $new_sort_order) {
            $row++;
            $db->Execute("UPDATE " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_sort_order= " . (int) $_POST['options_values_new_sort_order'][$id] . " where products_options_values_id=" . (int) $id);
        }
        $messageStack->add_session(SUCCESS_OPTION_VALUES_SORT_ORDER . ' ' . zen_options_name($_GET['options_id']), 'success');
        $_GET['action'] = '';
        zen_redirect(zen_href_link(FILENAME_PRODUCTS_OPTIONS_VALUES));
        break;
        // update by product
    // update by product
    case 'update_product':
        $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_SORT . $_POST['products_update_id'] . ' ' . zen_get_products_name($_POST['products_update_id'], $_SESSION['languages_id']), 'success');
        zen_update_attributes_products_option_values_sort_order($_POST['products_update_id']);
        $action = '';
        zen_redirect(zen_href_link(FILENAME_PRODUCTS_OPTIONS_VALUES));
        break;
        // update by category
    // update by category
    case 'update_categories_attributes':
        $all_products_attributes = $db->Execute("select ptoc.products_id, pa.products_attributes_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptoc, " . TABLE_PRODUCTS_ATTRIBUTES . " pa " . "\n      where ptoc.categories_id = '" . $_POST['categories_update_id'] . "' and\n      pa.products_id = ptoc.products_id");
        while (!$all_products_attributes->EOF) {
            $count++;
            $product_id_updated .= ' - ' . $all_products_attributes->fields['products_id'] . ':' . $all_products_attributes->fields['products_attributes_id'];
            zen_update_attributes_products_option_values_sort_order($all_products_attributes->fields['products_id']);
            $all_products_attributes->MoveNext();
        }
        $messageStack->add_session(SUCCESS_CATEGORIES_UPDATE_SORT . (int) $_POST['categories_update_id'] . ' ' . zen_get_category_name($_POST['categories_update_id'], $_SESSION['languages_id']), 'success');
示例#24
0
}
$new_products = $db->ExecuteRandomMulti($new_products_query, MAX_DISPLAY_NEW_PRODUCTS);
$row = 0;
$col = 0;
$list_box_contents = '';
$num_products_count = $new_products->RecordCount();
// show only when 1 or more
if ($num_products_count > 0) {
    if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS) {
        $col_width = 100 / $num_products_count;
    } else {
        $col_width = 100 / SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS;
    }
    while (!$new_products->EOF) {
        $products_price = zen_get_products_display_price($new_products->fields['products_id']);
        $new_products->fields['products_name'] = zen_get_products_name($new_products->fields['products_id']);
        $list_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="' . $col_width . '%" valign="top"', 'text' => '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br /><a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);
        $col++;
        if ($col > SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS - 1) {
            $col = 0;
            $row++;
        }
        $new_products->MoveNextRandom();
    }
    if ($new_products->RecordCount() > 0) {
        if (isset($new_products_category_id)) {
            $category_title = zen_get_categories_name((int) $new_products_category_id);
            $title = sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . ($category_title != '' ? ' - ' . $category_title : '');
        } else {
            $title = sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'));
        }
 /**
  * calculate quantity adjustments based on restrictions
  * USAGE:  $qty = $this->adjust_quantity($qty, (int)$products_id, 'shopping_cart');
  *
  * @param float $check_qty
  * @param int $products
  * @param string $message
  */
 function adjust_quantity($check_qty, $products, $stack = 'shopping_cart')
 {
     global $messageStack;
     if ($stack == '' || $stack == FALSE) {
         $stack = 'shopping_cart';
     }
     $old_quantity = $check_qty;
     if (QUANTITY_DECIMALS != 0) {
         //          $new_qty = round($new_qty, QUANTITY_DECIMALS);
         $fix_qty = $check_qty;
         switch (true) {
             case !strstr($fix_qty, '.'):
                 $new_qty = $fix_qty;
                 break;
             default:
                 $new_qty = preg_replace('/[0]+$/', '', $check_qty);
                 break;
         }
     } else {
         if ($check_qty != round($check_qty, QUANTITY_DECIMALS)) {
             $new_qty = round($check_qty, QUANTITY_DECIMALS);
             $messageStack->add_session($stack, ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ERROR_QUANTITY_CHANGED_FROM . $old_quantity . ERROR_QUANTITY_CHANGED_TO . $new_qty, 'caution');
         } else {
             $new_qty = $check_qty;
         }
     }
     return $new_qty;
 }
 if (isset($_GET['read']) && $_GET['read'] == 'only') {
     $pInfo->metatags_title = zen_get_metatags_title($pInfo->products_id, $languages[$i]['id']);
     $pInfo->metatags_keywords = zen_get_metatags_keywords($pInfo->products_id, $languages[$i]['id']);
     $pInfo->metatags_description = zen_get_metatags_description($pInfo->products_id, $languages[$i]['id']);
 } else {
     $pInfo->metatags_title = zen_db_prepare_input($metatags_title[$languages[$i]['id']]);
     $pInfo->metatags_keywords = zen_db_prepare_input($metatags_keywords[$languages[$i]['id']]);
     $pInfo->metatags_description = zen_db_prepare_input($metatags_description[$languages[$i]['id']]);
 }
 ?>
 <table border="0" width="100%" cellspacing="0" cellpadding="2">
   <tr>
     <td><table border="3" cellspacing="4" cellpadding="6">
         <td class="main" valign="top">
           <?php 
 echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . '<strong>' . TEXT_PRODUCTS_NAME . '</strong>' . '&nbsp;' . ($pInfo->metatags_products_name_status == '1' ? zen_get_products_name($_GET['pID'], $languages[$i]['id']) : TEXT_META_EXCLUDED);
 ?>
         </td>
         <td class="main" valign="top">
            <?php 
 echo '<strong>' . TEXT_PRODUCTS_MODEL . '</strong>&nbsp;' . ($pInfo->metatags_model_status == '1' ? $pInfo->products_model : TEXT_META_EXCLUDED);
 ?>
         </td>
         <td class="main" valign="top">
            <?php 
 echo '<strong>' . TEXT_PRODUCTS_PRICE_INFO . '</strong>&nbsp;' . ($pInfo->metatags_price_status == '1' ? $currencies->format($pInfo->products_price_sorter) : TEXT_META_EXCLUDED);
 ?>
         </td>
         <td class="main" valign="top">
            <?php 
 echo '<strong>' . TEXT_PRODUCTS_METATAGS_TITLE_TAGLINE_STATUS . '</strong>&nbsp;' . ($pInfo->metatags_title_tagline_status == '1' ? TITLE . ' ' . SITE_TAGLINE : TEXT_META_EXCLUDED);
示例#27
0
echo (zen_get_categories_status($current_category_id) == '0' ? TEXT_CATEGORIES_STATUS_INFO_OFF : '') . ($out_status == true ? ' ' . TEXT_PRODUCTS_STATUS_INFO_OFF : '');
?>
</td>
					<tr>
<?php 
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
    ?>
					<tr>
						<td class="main"><?php 
    if ($i == 0) {
        echo TEXT_PRODUCTS_NAME;
    }
    ?>
</td>
						<td class="main"><?php 
    echo zen_draw_input_field('products_name[' . $languages[$i]['id'] . ']', isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : zen_get_products_name($pInfo->products_id, $languages[$i]['id']), zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION, 'products_name')) . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']);
    ?>
</td>
					</tr>
<?php 
}
?>
					<tr>
						<td class="main"><?php 
echo TEXT_PRODUCTS_STATUS;
?>
</td>
						<td class="main"><?php 
echo zen_draw_radio_field('products_status', '1', $in_status) . '&nbsp;' . TEXT_PRODUCT_AVAILABLE . '&nbsp;' . zen_draw_radio_field('products_status', '0', $out_status) . '&nbsp;' . TEXT_PRODUCT_NOT_AVAILABLE;
?>
</td>
示例#28
0
function zen_copy_products_attributes($products_id_from, $products_id_to)
{
    global $db;
    global $messageStack;
    global $copy_attributes_delete_first, $copy_attributes_duplicates_skipped, $copy_attributes_duplicates_overwrite, $copy_attributes_include_downloads, $copy_attributes_include_filename;
    // Check for errors in copy request
    if (!zen_has_product_attributes($products_id_from, 'false') or !zen_products_id_valid($products_id_to) or $products_id_to == $products_id_from) {
        if ($products_id_to == $products_id_from) {
            // same products_id
            $messageStack->add_session('<b>WARNING: Cannot copy from Product ID #' . $products_id_from . ' to Product ID # ' . $products_id_to . ' ... No copy was made' . '</b>', 'caution');
        } else {
            if (!zen_has_product_attributes($products_id_from, 'false')) {
                // no attributes found to copy
                $messageStack->add_session('<b>WARNING: No Attributes to copy from Product ID #' . $products_id_from . ' for: ' . zen_get_products_name($products_id_from) . ' ... No copy was made' . '</b>', 'caution');
            } else {
                // invalid products_id
                $messageStack->add_session('<b>WARNING: There is no Product ID #' . $products_id_to . ' ... No copy was made' . '</b>', 'caution');
            }
        }
    } else {
        // FIX HERE - remove once working
        // check if product already has attributes
        $check_attributes = zen_has_product_attributes($products_id_to, 'false');
        if ($copy_attributes_delete_first == '1' and $check_attributes == true) {
            // die('DELETE FIRST - Copying from ' . $products_id_from . ' to ' . $products_id_to . ' Do I delete first? ' . $copy_attributes_delete_first);
            // delete all attributes first from products_id_to
            zen_products_attributes_download_delete($products_id_to);
            $db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int) $products_id_to . "'");
        }
        // get attributes to copy from
        $products_copy_from = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int) $products_id_from . "'" . " order by products_attributes_id");
        while (!$products_copy_from->EOF) {
            // This must match the structure of your products_attributes table
            $update_attribute = false;
            $add_attribute = true;
            $check_duplicate = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int) $products_id_to . "'" . " and options_id= '" . (int) $products_copy_from->fields['options_id'] . "' and options_values_id='" . (int) $products_copy_from->fields['options_values_id'] . "'");
            if ($check_attributes == true) {
                if ($check_duplicate->RecordCount() == 0) {
                    $update_attribute = false;
                    $add_attribute = true;
                } else {
                    if ($check_duplicate->RecordCount() == 0) {
                        $update_attribute = false;
                        $add_attribute = true;
                    } else {
                        $update_attribute = true;
                        $add_attribute = false;
                    }
                }
            } else {
                $update_attribute = false;
                $add_attribute = true;
            }
            // die('UPDATE/IGNORE - Checking Copying from ' . $products_id_from . ' to ' . $products_id_to . ' Do I delete first? ' . ($copy_attributes_delete_first == '1' ? TEXT_YES : TEXT_NO) . ' Do I add? ' . ($add_attribute == true ? TEXT_YES : TEXT_NO) . ' Do I Update? ' . ($update_attribute == true ? TEXT_YES : TEXT_NO) . ' Do I skip it? ' . ($copy_attributes_duplicates_skipped=='1' ? TEXT_YES : TEXT_NO) . ' Found attributes in From: ' . $check_duplicate->RecordCount());
            if ($copy_attributes_duplicates_skipped == '1' and $check_duplicate->RecordCount() != 0) {
                // skip it
                $messageStack->add_session(TEXT_ATTRIBUTE_COPY_SKIPPING . $products_copy_from->fields['products_attributes_id'] . ' for Products ID#' . $products_id_to, 'caution');
            } else {
                if ($add_attribute == true) {
                    // New attribute - insert it
                    $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required) values (0, '" . (int) $products_id_to . "',\n          '" . $products_copy_from->fields['options_id'] . "',\n          '" . $products_copy_from->fields['options_values_id'] . "',\n          '" . $products_copy_from->fields['options_values_price'] . "',\n          '" . $products_copy_from->fields['price_prefix'] . "',\n          '" . $products_copy_from->fields['products_options_sort_order'] . "',\n          '" . $products_copy_from->fields['product_attribute_is_free'] . "',\n          '" . $products_copy_from->fields['products_attributes_weight'] . "',\n          '" . $products_copy_from->fields['products_attributes_weight_prefix'] . "',\n          '" . $products_copy_from->fields['attributes_display_only'] . "',\n          '" . $products_copy_from->fields['attributes_default'] . "',\n          '" . $products_copy_from->fields['attributes_discounted'] . "',\n          '" . $products_copy_from->fields['attributes_image'] . "',\n          '" . $products_copy_from->fields['attributes_price_base_included'] . "',\n          '" . $products_copy_from->fields['attributes_price_onetime'] . "',\n          '" . $products_copy_from->fields['attributes_price_factor'] . "',\n          '" . $products_copy_from->fields['attributes_price_factor_offset'] . "',\n          '" . $products_copy_from->fields['attributes_price_factor_onetime'] . "',\n          '" . $products_copy_from->fields['attributes_price_factor_onetime_offset'] . "',\n          '" . $products_copy_from->fields['attributes_qty_prices'] . "',\n          '" . $products_copy_from->fields['attributes_qty_prices_onetime'] . "',\n          '" . $products_copy_from->fields['attributes_price_words'] . "',\n          '" . $products_copy_from->fields['attributes_price_words_free'] . "',\n          '" . $products_copy_from->fields['attributes_price_letters'] . "',\n          '" . $products_copy_from->fields['attributes_price_letters_free'] . "',\n          '" . $products_copy_from->fields['attributes_required'] . "')");
                    $messageStack->add_session(TEXT_ATTRIBUTE_COPY_INSERTING . $products_copy_from->fields['products_attributes_id'] . ' for Products ID#' . $products_id_to, 'caution');
                }
                if ($update_attribute == true) {
                    // Update attribute - Just attribute settings not ids
                    $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set\n          options_values_price='" . $products_copy_from->fields['options_values_price'] . "',\n          price_prefix='" . $products_copy_from->fields['price_prefix'] . "',\n          products_options_sort_order='" . $products_copy_from->fields['products_options_sort_order'] . "',\n          product_attribute_is_free='" . $products_copy_from->fields['product_attribute_is_free'] . "',\n          products_attributes_weight='" . $products_copy_from->fields['products_attributes_weight'] . "',\n          products_attributes_weight_prefix='" . $products_copy_from->fields['products_attributes_weight_prefix'] . "',\n          attributes_display_only='" . $products_copy_from->fields['attributes_display_only'] . "',\n          attributes_default='" . $products_copy_from->fields['attributes_default'] . "',\n          attributes_discounted='" . $products_copy_from->fields['attributes_discounted'] . "',\n          attributes_image='" . $products_copy_from->fields['attributes_image'] . "',\n          attributes_price_base_included='" . $products_copy_from->fields['attributes_price_base_included'] . "',\n          attributes_price_onetime='" . $products_copy_from->fields['attributes_price_onetime'] . "',\n          attributes_price_factor='" . $products_copy_from->fields['attributes_price_factor'] . "',\n          attributes_price_factor_offset='" . $products_copy_from->fields['attributes_price_factor_offset'] . "',\n          attributes_price_factor_onetime='" . $products_copy_from->fields['attributes_price_factor_onetime'] . "',\n          attributes_price_factor_onetime_offset='" . $products_copy_from->fields['attributes_price_factor_onetime_offset'] . "',\n          attributes_qty_prices='" . $products_copy_from->fields['attributes_qty_prices'] . "',\n          attributes_qty_prices_onetime='" . $products_copy_from->fields['attributes_qty_prices_onetime'] . "',\n          attributes_price_words='" . $products_copy_from->fields['attributes_price_words'] . "',\n          attributes_price_words_free='" . $products_copy_from->fields['attributes_price_words_free'] . "',\n          attributes_price_letters='" . $products_copy_from->fields['attributes_price_letters'] . "',\n          attributes_price_letters_free='" . $products_copy_from->fields['attributes_price_letters_free'] . "',\n          attributes_required='" . $products_copy_from->fields['attributes_required'] . "'" . " where products_id='" . (int) $products_id_to . "'" . " and options_id= '" . $products_copy_from->fields['options_id'] . "' and options_values_id='" . $products_copy_from->fields['options_values_id'] . "'");
                    //           . " where products_id='" . $products_id_to . "'" . " and options_id= '" . $products_copy_from->fields['options_id'] . "' and options_values_id='" . $products_copy_from->fields['options_values_id'] . "' and attributes_image='" . $products_copy_from->fields['attributes_image'] . "' and attributes_price_base_included='" . $products_copy_from->fields['attributes_price_base_included'] .  "'");
                    $messageStack->add_session(TEXT_ATTRIBUTE_COPY_UPDATING . $products_copy_from->fields['products_attributes_id'] . ' for Products ID#' . $products_id_to, 'caution');
                }
            }
            $products_copy_from->MoveNext();
        }
        // end of products attributes while loop
        // reset products_price_sorter for searches etc.
        zen_update_products_price_sorter($products_id_to);
    }
    // end of no attributes or other errors
}
示例#29
0
echo zen_draw_separator('pixel_trans.gif', '1', '10');
?>
</td>
          </tr>
<?php 
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
    ?>
          <tr>
            <td class="main"><?php 
    if ($i == 0) {
        echo TEXT_PRODUCTS_NAME;
    }
    ?>
</td>
            <td class="main"><?php 
    echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : zen_get_products_name($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION, 'products_name'));
    ?>
</td>
          </tr>
<?php 
}
?>

          <tr>
            <td colspan="2"><?php 
echo zen_draw_separator('pixel_trans.gif', '1', '10');
?>
</td>
          </tr>

          <tr>
示例#30
0
 *
 * @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 = '<ul class="recent_view pad_10px">' . "\n";
foreach ($recommendationsArray as $product) {
    //caizhouqing by bof
    $rs = $db->Execute("select s.specials_new_products_price,p.products_price from (specials s,products p)  where s.products_id = p.products_id and p.products_id=" . $product);
    $products_price = $rs->fields['products_price'];
    $specials_price = $rs->fields['specials_new_products_price'];
    //caizhouqing update specials
    $rsp = $db->Execute("select products_quantity from products where products_id=" . $product);
    $products_quantity = $rsp->fields['products_quantity'];
    //product
    if ($products_price != "") {
        $discount = 100 - $specials_price / $products_price * 100;
    }
    $link = zen_href_link(zen_get_info_page($product), 'products_id=' . $product);
    $content .= '<li>' . "\n";
    if ($products_quantity == 0) {
        $content .= '<span class="sold_out_cart"></span>';
    } elseif (!empty($specials_price)) {
        $content .= '<span class="sold_discount_cart"><span class="sold_discount_cart_font">' . $discount . '</span></span>';
    }
    //caizhouqing update by eof my_order
    $content .= "\n" . '<a class="ih" href="' . $link . '">' . zen_get_products_image($product, '85', '85') . '</a>' . "\n" . '<span><a href="' . $link . '">' . zen_get_products_name($product, $_SESSION['languages_id']) . '</a></span>' . "\n" . '</li>';
}
$content .= '</ul>';