static function parseParam(&$page, &$params, $languages_id, $languages_code) { $pos = array_search(self::$query_key, $params); if (!empty($params[$pos + 1])) { $products_id = $params[$pos + 1]; // recalculate 'page', just in case the product_type passed is wrong if (self::getMainPage() == $page) { self::$main_page = $page = zen_get_info_page($products_id); } $params[$pos] = self::getName($products_id, $languages_id, $languages_code); // recalculate cPath if needed to /*if(self::getMainPage() == $page){ if(($cPos = array_search(categoriesParser::$query_key, $params)) !== false){ $cPath = self::getProductPath($products_id, $params[$cPos+1]); $params[$cPos] = categoriesParser::getName($cPath, $languages_id, $languages_code); unset($params[$cPos+1]); } else { $cPath = self::getProductPath($products_id, 0); $params = array_merge(array(categoriesParser::getName($cPath, $languages_id, $languages_code)), $params); $pos++; } }*/ } else { unset($params[$pos]); } unset($params[$pos + 1]); }
public static function product_cart_button($product, $product_link) { global $how_many; $has_attributes = zen_has_product_attributes($product->fields['products_id']); $hide_quantity = $product->fields['products_qty_box_status'] == 0; if ($has_attributes || PRODUCT_LIST_PRICE_BUY_NOW == '0') { $lc_button = "<a class='btn btn-default' href='{$product_link}'>" . MORE_INFO_TEXT . "</a>"; } elseif (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) { $can_add_to_cart = zen_get_products_allow_add_to_cart($product->fields['products_id']) != 'N'; $in_stock_or_ignore_stock = $product->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0; $not_call_for_price = $product->fields['product_is_call'] == 0; if (!$hide_quantity && $can_add_to_cart && $not_call_for_price && $in_stock_or_ignore_stock) { $how_many++; } if ($hide_quantity) { $buy_now_link = zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product->fields['products_id']); $buy_now_button = "<button class='btn btn-primary'>" . BUTTON_BUY_NOW_ALT . "</button>"; $lc_button = "<a href='{$buy_now_link}'>{$buy_now_button}</a>"; } else { $add_to_cart_button = '<span class="input-group-btn">' . '<button class="btn btn-primary" type="submit">Add</button></span>'; $lc_button = "<div class='input-group'>" . "<input type='text' class='form-control' name='products_id[" . "{$product->fields['products_id']}]' value='1' size='4' />" . "{$add_to_cart_button}</div>"; } } elseif (PRODUCT_LIST_PRICE_BUY_NOW == '2' && !$hide_quantity) { $action_link = zen_href_link(zen_get_info_page($product->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $product->fields['products_id']); $buy_now_qty = zen_get_buy_now_qty($product->fields['products_id']); $lc_button = zen_draw_form('cart_quantity', $action_link, 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . $buy_now_qty . '" ' . 'maxlength="6" size="4" />' . zen_draw_hidden_field('products_id', $product->fields['products_id']) . "<button class='btn btn-default' type='submit'>" . BUTTON_IN_CART_ALT . "</button></form>"; } else { $action_link = zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product->fields['products_id']); $buy_now_button = zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"'); $lc_button = "<a class='btn btn-default' href='{$action_link}'>" . BUTTON_BUY_NOW_ALT . "</a>"; } return $lc_button; }
$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> '; } } $the_button = $link; $products_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>'; $display_products_button = zen_get_buy_now_button($products_new->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_BUY_NOW, 3, 1)); } else { $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>'; $the_button = $link; $products_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>'; $display_products_button = zen_get_buy_now_button($products_new->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_BUY_NOW, 3, 1)); } if (PRODUCT_NEW_LIST_DESCRIPTION > '0') { $disp_text = zen_get_products_description($products_new->fields['products_id']); $disp_text = zen_clean_html($disp_text); $display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_NEW_LIST_DESCRIPTION, '<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 { $display_products_description = ''; } ?> <ul class="list_product clear"> <li class="relative"><?php echo $display_products_image; ?> </li> <li class="li_con"> <dl> <dt><?php echo $display_products_name; ?>
<?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";
/** * Method to handle cart Action - Customer Order * * @param string forward destination * @param url parameters */ function actionCustomerOrder($goto, $parameters) { global $zco_page, $messageStack; if ($this->display_debug_messages) { $messageStack->add_session('header', 'FUNCTION ' . __FUNCTION__, 'caution'); } if ($_SESSION['customer_id'] && isset($_GET['pid'])) { if (zen_has_product_attributes($_GET['pid'])) { zen_redirect(zen_href_link(zen_get_info_page($_GET['pid']), 'products_id=' . $_GET['pid'])); } else { $this->add_cart($_GET['pid'], $this->get_quantity($_GET['pid']) + 1); } } // display message if all is good and not on shopping_cart page if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART && $messageStack->size('shopping_cart') == 0) { $messageStack->add_session('header', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . SUCCESS_ADDED_TO_CART_PRODUCTS, 'success'); } else { if (DISPLAY_CART == 'false') { zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); } } zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); }
$lc_align = 'right'; $lc_text = $listing->fields['products_quantity']; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = $listing->fields['products_weight']; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) { $lc_text = ''; } else { if (isset($_GET['manufacturers_id'])) { $lc_text = '<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']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; } else { $lc_text = '<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']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; } } break; } $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="productListing-data"', 'text' => $lc_text); } // add description and match alternating colors //if (PRODUCT_LIST_DESCRIPTION > 0) { // $rows++; // if ($extra_row == 1) { // $list_box_description = "productListing-data-description-even"; // $extra_row=0; // } else { // $list_box_description = "productListing-data-description-odd"; // $extra_row=1;
foreach ($cats as $key => $value) { $mycats[] = $value["link"]; } $cats = '<ul id="couponCatRestrictions">' . '<li>' . implode('<li>', $mycats) . '</ul>'; $text_coupon_help .= $cats; $text_coupon_help .= TEXT_COUPON_HELP_PRODUCTS; $get_result = $db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id='" . (int) $lookup_coupon_id . "' and product_id !='0'"); $prods = array(); while (!$get_result->EOF) { if ($get_result->fields['coupon_restrict'] == 'N') { $restrict = TEXT_PROD_ALLOWED; } else { $restrict = TEXT_PROD_DENIED; } $result = $db->Execute("SELECT * FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id = pd.products_id and\n pd.language_id = '" . (int) $_SESSION['languages_id'] . "' and p.products_id = '" . $get_result->fields['product_id'] . "'"); $prods[] = array("validity" => $get_result->fields['coupon_restrict'] == 'N' ? 'A' : 'D', 'name' => $result->fields["products_name"], 'link' => '<a href="' . zen_href_link(zen_get_info_page($result->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($result->fields['master_categories_id']) . '&products_id=' . $result->fields['products_id']) . '">' . $result->fields['products_name'] . '</a>' . $restrict); $get_result->MoveNext(); } if (sizeof($prods) == 0) { $prods[] = array("link" => TEXT_NO_PROD_RESTRICTIONS); } sort($prods); $myprods = array(); foreach ($prods as $key => $value) { $myprods[] = $value["link"]; } $prods = '<ul id="couponProdRestrictions">' . '<li>' . implode('<li>', $myprods) . '</ul>'; $text_coupon_help .= $prods . TEXT_COUPON_GV_RESTRICTION; } } // include template specific file name defines
</p> <div class="preis"> <p> <strong><?php //echo TEXT_PRODUCT_PRICE; ?> </strong> <strong class="neue_text3"><?php echo $products_price; ?> </strong> </p> <!--bof Form start--> <?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($products_id), zen_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'enctype="multipart/form-data" id="products_add_form"'); ?> <!--eof Form start--> <p class="p_top"> <?php require $template->get_template_dir('tpl_modules_attributes.php', DIR_WS_TEMPLATE, $current_page_base, 'templates') . '/tpl_modules_attributes.php'; ?> <div class="clear"></div> <?php if (defined('AJAX_ADD_TO_CART_ENABLED') && AJAX_ADD_TO_CART_ENABLED) { ?> <div id="a_addcart_result" class="tb-cart-info"> <div id="tb-action-hint"> <h4><?php echo TEXT_ADD_ITEM_SUCCESS_TIP;
// $Id$ // ?> <!-- bof: upcoming_products --> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="tableHeading"><?php echo TABLE_HEADING_UPCOMING_PRODUCTS; ?> </td> <td align="right" nowrap="nowrap" class="tableHeading"><?php echo TABLE_HEADING_DATE_EXPECTED; ?> </td> </tr> <?php $row = 0; while (!$expected->EOF) { $row++; if ($row / 2 == floor($row / 2)) { echo ' <tr class="upcomingProducts-even">' . "\n"; } else { echo ' <tr class="upcomingProducts-odd">' . "\n"; } echo ' <td class="smallText"><a href="' . zen_href_link(zen_get_info_page($expected->fields['products_id']), 'products_id=' . $expected->fields['products_id']) . '">' . $expected->fields['products_name'] . '</a></td>' . "\n" . ' <td align="right" class="smallText">' . zen_date_short($expected->fields['date_expected']) . '</td>' . "\n" . ' </tr>' . "\n"; $expected->MoveNext(); } ?> </table> <!-- eof: upcoming_products -->
echo $list_box_contents[$row]['product_is_always_free_shipping']; ?> </p> <div class="black line_120 margin_t"> <strong>Our Price: </strong> <?php if (!empty($specials_price)) { //caizhouqing by bof $products_price = $products_price * ($specials_price / $products_price); echo '<a href="' . zen_href_link(zen_get_info_page($list_box_contents[$row]['products_id']), 'cPath=' . zen_get_generated_category_path_rev($_GET['cPath']) . '&products_id=' . $list_box_contents[$row]['products_id'] . '&action=buy_now') . '" >'; echo '<span class="car_price">'; echo $list_box_contents[$row]['products_price'] == 0 ? $currencies->display_price($products_price, zen_get_tax_rate($products_tax_class_id)) : $currencies->display_price($products_price, zen_get_tax_rate($products_tax_class_id)); echo '</span>'; echo '</a>'; } elseif ($list_box_contents[$row]['products_quantity'] > 0) { echo '<a href="' . zen_href_link(zen_get_info_page($list_box_contents[$row]['products_id']), 'cPath=' . zen_get_generated_category_path_rev($_GET['cPath']) . '&products_id=' . $list_box_contents[$row]['products_id'] . '&action=buy_now') . '" >'; echo '<span class="car_price">'; echo $list_box_contents[$row]['products_price'] == 0 ? $currencies->display_price($list_box_contents[$row]['products_price_sample'], zen_get_tax_rate($products_tax_class_id)) : $currencies->display_price($list_box_contents[$row]['products_price'], zen_get_tax_rate($products_tax_class_id)); echo '</span>'; echo '</a>'; } else { echo '<span">'; echo $list_box_contents[$row]['products_price'] == 0 ? $currencies->display_price($list_box_contents[$row]['products_price_sample'], zen_get_tax_rate($products_tax_class_id)) : $currencies->display_price($list_box_contents[$row]['products_price'], zen_get_tax_rate($products_tax_class_id)); echo '</span>'; } ?> <div class="margin_t">Compare at: <?php echo $list_box_contents[$row]['products_price_retail']; ?> </div> <div><span class="fl"><?php
$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')); } require $template->get_template_dir('tpl_modules_whats_new.php', DIR_WS_TEMPLATE, $current_page_base, 'templates') . '/tpl_modules_whats_new.php';
</td> </tr> <?php } if ($reviews_split->number_of_rows > 0 && (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3')) { ?> <tr> <td class="pageresults"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?> </td> <td align="right" class="pageresults"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'main_page'))); ?> </td> </tr> <?php } ?> <tr> <td class="main"><?php echo '<a href="' . zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params()) . '">' . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?> </td> <td class="main" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, zen_get_all_get_params()) . '">' . zen_image_button(BUTTON_IMAGE_WRITE_REVIEW, BUTTON_WRITE_REVIEW_ALT) . '</a>'; ?> </td> </tr> </table>
<?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 (!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(); }
* @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;
// } // else // { // $category_depth = 'products'; // category has no products, but display the 'no products' message // } // } } // include template specific file name defines $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_MAIN_PAGE, 'false'); require DIR_WS_MODULES . zen_get_module_directory('require_languages.php'); // set the product filters according to selected product type $typefilter = 'default'; if (isset($_GET['typefilter'])) { $typefilter = $_GET['typefilter']; } require zen_get_index_filters_directory($typefilter . '_filter.php'); // query the database based on the selected filters $listing = $db->Execute($listing_sql); // category is invalid or has no products, so don't index it: if ($category_depth == 'products' && $listing->RecordCount() == 0) { $robotsNoIndex = true; } // if only one product in this category, go directly to the product page, instead of displaying a link to just one item: // if filter_id exists the 1 product redirect is ignored if (SKIP_SINGLE_PRODUCT_CATEGORIES == 'True' and (!isset($_GET['filter_id']) and !isset($_GET['alpha_filter']))) { if ($listing->RecordCount() == 1 && (!isset($category_parent) || !$category_parent->fields['total'])) { zen_redirect(zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing->fields['products_id'])); } } // This should be last line of the script: $zco_notifier->notify('NOTIFY_HEADER_END_INDEX');
$list_box_contents = array(); $title = ''; $num_products_count = $new_products_query == '' ? 0 : $new_products->RecordCount(); // show only when 1 or more if ($num_products_count > 0) { if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS == 0) { $col_width = floor(100 / $num_products_count); } else { $col_width = floor(100 / SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS); } while (!$new_products->EOF) { $products_price = zen_get_products_display_price($new_products->fields['products_id']); if (!isset($productsInCategory[$new_products->fields['products_id']])) { $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']); } $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$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']), 'cPath=' . $productsInCategory[$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) && $new_products_category_id != 0) { $category_title = zen_get_categories_name((int) $new_products_category_id); $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . ($category_title != '' ? ' - ' . $category_title : '') . '</h2>'; } else { $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . '</h2>'; } $zc_show_new_products = true;
<?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" . '<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>';
} $email_body .= sprintf(EMAIL_TEXT_LINK, zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' . $_GET['products_id']), '', false) . "\n\n" . sprintf(EMAIL_TEXT_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n"); $html_msg['EMAIL_TEXT_HEADER'] = EMAIL_TEXT_HEADER; $html_msg['EMAIL_PRODUCT_LINK'] = sprintf(str_replace('\\n\\n', '<br />', EMAIL_TEXT_LINK), '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']) . '">' . $product_info->fields['products_name'] . '</a>', '', false); $html_msg['EMAIL_TEXT_SIGNATURE'] = sprintf(str_replace('\\n', '', EMAIL_TEXT_SIGNATURE), ''); // include disclaimer $email_body .= "\n\n" . EMAIL_ADVISORY . "\n\n"; //send the email zen_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address, $html_msg, 'tell_a_friend'); // send additional emails if (SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO_STATUS == '1' and SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO != '') { if ($_SESSION['customer_id']) { $account_query = "SELECT customers_firstname, customers_lastname, customers_email_address\n FROM " . TABLE_CUSTOMERS . "\n WHERE customers_id = :customersID"; $account_query = $db->bindVars($account_query, ':customersID', $_SESSION['customer_id'], 'integer'); $account = $db->Execute($account_query); } $extra_info = email_collect_extra_info($from_name, $from_email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address']); $html_msg['EXTRA_INFO'] = $extra_info['HTML']; zen_mail('', SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO, SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO_SUBJECT . ' ' . $email_subject, $email_body . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'tell_a_friend_extra'); } $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info->fields['products_name'], zen_output_string_protected($to_name)), 'success'); zen_redirect(zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' . $_GET['products_id'])); } } elseif ($_SESSION['customer_id']) { $account_query = "SELECT customers_firstname, customers_lastname, customers_email_address\n FROM " . TABLE_CUSTOMERS . "\n WHERE customers_id = :customersID"; $account_query = $db->bindVars($account_query, ':customersID', $_SESSION['customer_id'], 'integer'); $account = $db->Execute($account_query); $from_name = $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname']; $from_email_address = $account->fields['customers_email_address']; } $breadcrumb->add(NAVBAR_TITLE);
<div class="price"> <?php echo $products_price; ?> </div> </div> </div> <!-- Product Grid View Ends --> <!-- Product List View --> <div class="product-listview list-view"> <div class="row product-list-row"> <div class="col col-lg-4 col-sm-4"> <div class="product-image"> <div class="image"> <a href="<?php echo zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']); ?> "><?php echo $display_products_image; ?> </a> </div> </div> </div> <div class="col col-lg-8 col-sm-8"> <div class="product-info"> <h3 class="name"> <?php echo $display_products_name; ?> </h3>
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'; } }
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; }
function zen_get_buy_now_button($product_id, $link, $additional_link = false) { global $db; // show case only superceeds all other settings if (STORE_STATUS != '0') { return '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_SHOWCASE_ONLY . '</a>'; } // 0 = normal shopping // 1 = Login to shop // 2 = Can browse but no prices // verify display of prices switch (true) { case CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '': // customer must be logged in to browse $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE . '</a>'; return $login_for_price; break; case CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == '': if (TEXT_LOGIN_FOR_PRICE_PRICE == '') { // show room only return TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE; } else { // customer may browse but no prices $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE . '</a>'; } return $login_for_price; break; // show room only // show room only case CUSTOMERS_APPROVAL == '3': $login_for_price = TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM; return $login_for_price; break; case CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3' and $_SESSION['customer_id'] == '': // customer must be logged in to browse $login_for_price = TEXT_AUTHORIZATION_PENDING_BUTTON_REPLACE; return $login_for_price; break; case CUSTOMERS_APPROVAL_AUTHORIZATION == '3' and $_SESSION['customer_id'] == '': // customer must be logged in and approved to add to cart $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . TEXT_LOGIN_TO_SHOP_BUTTON_REPLACE . '</a>'; return $login_for_price; break; case CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and $_SESSION['customers_authorization'] > '0': // customer must be logged in to browse $login_for_price = TEXT_AUTHORIZATION_PENDING_BUTTON_REPLACE; return $login_for_price; break; default: // proceed normally break; } $button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int) $product_id . "'"); switch (true) { // cannot be added to the cart case zen_get_products_allow_add_to_cart($product_id) == 'N': return $additional_link; break; case $button_check->fields['product_is_call'] == '1': $return_button = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>'; break; case $button_check->fields['products_quantity'] <= 0 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1': if ($_GET['main_page'] == zen_get_info_page($product_id)) { $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT, BUTTON_SOLD_OUT_ALT); } else { $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT_SMALL, BUTTON_SOLD_OUT_SMALL_ALT); } break; default: $return_button = $link; break; } if ($return_button != $link and $additional_link != false) { return $additional_link . '<br />' . $return_button; } else { return $return_button; } }
<?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(); } }
} else { $where = " email='" . $email . "' and products_id='{$products_id}' and remote_ip='{$remote_ip}' "; $sql_query = "select id,viewed_num from `products_viewed_stat` where " . $where; $result_viewed_num = $db->Execute($sql_query); //多次点击,累计次数 if ($result_viewed_num->RecordCount() > 0) { $tmp_id = $result_viewed_num->fields['id']; $tmp_viewed_num = $result_viewed_num->fields['viewed_num'] + 1; $sql_update = "update `products_viewed_stat` set viewed_num='{$tmp_viewed_num}',opened_time='{$add_time}' where id=" . $tmp_id; } else { //首次点击,插入一个新记录 $sql_update = "insert into `products_viewed_stat` (products_id,email,remote_ip,viewed_num,opened_time)\n\t\t values('{$products_id}','{$email}','{$remote_ip}','{$email_list_tag}','{$add_time}')"; } } $db->Execute($sql_update); zen_redirect(zen_href_link(zen_get_info_page($products_id), ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $products_id)); exit; } if ($act == 'del_unsubscriber') { $sql_query = "delete from `products_viewed_stat` where email='" . $email . "' and remote_ip='400'"; $db->Execute($sql_query); } if ($act == 'unsubscribe') { $sql_query = "select email from `products_viewed_stat` where email='" . $email . "' and remote_ip='400'"; $result_viewed = $db->Execute($sql_query); $email_viewed = array(); if ($result_viewed->RecordCount() == 0) { $sql_update = "insert into `products_viewed_stat` (products_id,email,remote_ip,viewed_num,add_time)\n values('0','{$email}','400','0','{$add_time}')"; $db->Execute($sql_update); } }
} else { unset($GLOBALS[$key]); } } } /** * sanitize $_SERVER vars */ $_SERVER['REMOTE_ADDR'] = preg_replace('~[^a-fA-F0-9.:%/]~', '', $_SERVER['REMOTE_ADDR']); /** * validate products_id for search engines and bookmarks, etc. */ if (isset($_GET['products_id']) && isset($_SESSION['check_valid']) && $_SESSION['check_valid'] != 'false') { $check_valid = zen_products_id_valid($_GET['products_id']); if (!$check_valid) { $_GET['main_page'] = zen_get_info_page($_GET['products_id']); /** * do not recheck redirect */ $_SESSION['check_valid'] = 'false'; zen_redirect(zen_href_link($_GET['main_page'], 'products_id=' . $_GET['products_id'])); } } else { $_SESSION['check_valid'] = 'true'; } /** * We do some checks here to ensure $_GET['main_page'] has a sane value */ if (!isset($_GET['main_page']) || !zen_not_null($_GET['main_page'])) { $_GET['main_page'] = 'index'; }
$attrArray[$option]['products_options_name'] = $attributes_values->fields['products_options_name']; $attrArray[$option]['options_values_id'] = $value; $attrArray[$option]['products_options_values_name'] = zen_output_string_protected($attr_value); $attrArray[$option]['options_values_price'] = $attributes_values->fields['options_values_price']; $attrArray[$option]['price_prefix'] = $attributes_values->fields['price_prefix']; } } //end foreach [attributes] if (STOCK_CHECK == 'true') { $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']); if ($flagStockCheck == true) { $flagAnyOutOfStock = true; } } $linkProductsImage = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']); $linkProductsName = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']); $productsImage = IMAGE_SHOPPING_CART_STATUS == 1 ? zen_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) : ''; $show_products_quantity_max = zen_get_products_quantity_order_max($products[$i]['id']); $showFixedQuantity = ($show_products_quantity_max == 1 or zen_get_products_qty_box_status($products[$i]['id']) == 0) ? true : false; // $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('products_id[]', $products[$i]['id']) . zen_draw_hidden_field('cart_quantity[]', 1); // $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]', 1); $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']); $showMinUnits = zen_get_products_quantity_min_units_display($products[$i]['id']); $quantityField = zen_draw_input_field('cart_quantity[]', $products[$i]['quantity'], ' size="4" onfocus="set_update_count(this);" onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\\d]/g,\'\'));update_count(this);" onkeyup="value=value.replace(/[^\\d]/g,\'\');update_count(this);" class="check_input_num" id="cart_quantity[]"'); $buttonUpdate = ((SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) ? zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT) : '') . zen_draw_hidden_field('products_id[]', $products[$i]['id']); $productsPrice = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : ''); $productsPriceEach = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : ''); $productArray[$i] = array('attributeHiddenField' => $attributeHiddenField, 'flagStockCheck' => $flagStockCheck, 'flagShowFixedQuantity' => $showFixedQuantity, 'linkProductsImage' => $linkProductsImage, 'linkProductsName' => $linkProductsName, 'productsImage' => $productsImage, 'productsName' => $productsName, 'showFixedQuantity' => $showFixedQuantity, 'showFixedQuantityAmount' => $showFixedQuantityAmount, 'showMinUnits' => $showMinUnits, 'quantityField' => $quantityField, 'buttonUpdate' => $buttonUpdate, 'productsPrice' => $productsPrice, 'productsPriceEach' => $productsPriceEach, 'rowClass' => $rowClass, 'buttonDelete' => $buttonDelete, 'checkBoxDelete' => $checkBoxDelete, 'id' => $products[$i]['id'], 'attributes' => $attrArray); } // end FOR loop $flag_disable_footer = TRUE;
</a> </div> <div class="product-compare-link buttons"> <a title="Add to Compare" class="addtocompare" href="' . $compare_link . '"> <i class="fa fa-files-o fa-lg"></i> </a> </div> </div> ' . $msg_product . ' </div> </div> <div class="product-info"> <h3 class="name">') . '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '">' . $products_name . '</a> </h3>' . mb_product_reviews($featured_products->fields['products_id']) . ' <div class="price">' . $products_price . '</div> </div> </div>'); $col++; if ($col > SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS - 1) { $col = 0; $row++; } $featured_products->MoveNextRandom(); } if ($featured_products->RecordCount() > 0) { if (isset($new_products_category_id) && $new_products_category_id != 0) { $category_title = zen_get_categories_name((int) $new_products_category_id); $title = '<h3 class="section-title">' . TABLE_HEADING_FEATURED_PRODUCTS . '</h3>';
* * Loaded automatically by index.php?main_page=document_product_info.<br /> * Displays template according to "document-product" product-type needs * * @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_document_product_info_display.php 19690 2011-10-04 16:41:45Z drbyte $ */ ?> <div class="centerColumn" id="docProductDisplay"> <!--bof Form start--> <?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product', $request_type), 'post', 'enctype="multipart/form-data"') . "\n"; ?> <!--eof Form start--> <?php if ($messageStack->size('product_info') > 0) { echo $messageStack->output('product_info'); } ?> <!--bof Category Icon --> <?php if ($module_show_categories != 0) { /** * display the category icons */
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: tpl_shopping_cart.php 3650 2006-05-22 04:15:19Z ajeh $ */ $content = ""; $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">'; if ($_SESSION['cart']->count_contents() > 0) { $content .= '<div id="cartBoxListWrapper">' . "\n" . '<ul>' . "\n"; $products = $_SESSION['cart']->get_products(); for ($i = 0, $n = sizeof($products); $i < $n; $i++) { $content .= '<li>'; if ($_SESSION['new_products_id_in_cart'] && $_SESSION['new_products_id_in_cart'] == $products[$i]['id']) { $content .= '<span class="cartNewItem">'; } else { $content .= '<span class="cartOldItem">'; } $content .= $products[$i]['quantity'] . BOX_SHOPPING_CART_DIVIDER . '</span><a href="' . zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']) . '">'; if ($_SESSION['new_products_id_in_cart'] && $_SESSION['new_products_id_in_cart'] == $products[$i]['id']) { $content .= '<span class="cartNewItem">'; } else { $content .= '<span class="cartOldItem">'; } $content .= $products[$i]['name'] . '</span></a></li>' . "\n"; if ($_SESSION['new_products_id_in_cart'] && $_SESSION['new_products_id_in_cart'] == $products[$i]['id']) { $_SESSION['new_products_id_in_cart'] = ''; } } $content .= '</ul>' . "\n" . '</div>'; } else { $content .= '<div class="sideBoxContent center bold">' . BOX_SHOPPING_CART_EMPTY . '</div>'; } if ($_SESSION['cart']->count_contents() > 0) {