本文整理汇总了PHP中zen_get_generated_category_path_rev函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_get_generated_category_path_rev函数的具体用法?PHP zen_get_generated_category_path_rev怎么用?PHP zen_get_generated_category_path_rev使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_get_generated_category_path_rev函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: right
?>
</ul>
<?php
$producttags_split_sql = "select p.`products_id`,pd.`products_name` from " . TABLE_PRODUCTS . " p," . TABLE_PRODUCTS_DESCRIPTION . " pd where p.`products_id` = pd.`products_id` AND right(LEFT(pd.`products_name`,9),1) LIKE '" . strtolower($_GET['letter']) . "'";
//print_r($producttags_split_sql);LEFT(pd.`products_name`,1)
$producttags_split = new splitPageResults($producttags_split_sql, PRODCUTTAGS_LIST_PAGE_SIZE, 'p.products_id', 'page');
$zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $producttags_split->number_of_rows);
$producttags = $db->Execute($producttags_split->sql_query);
//echo $producttags->RecordCount();
?>
<ul class="a_z_grid">
<?php
if ($producttags->RecordCount() > 0) {
while (!$producttags->EOF) {
echo '<li><a href="' . zen_href_link(zen_get_info_page($producttags->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($_GET['cPath']) . '&products_id=' . $producttags->fields['products_id']) . '" >' . str_replace("Replica ", "", $producttags->fields['products_name']) . '</a>';
$producttags->MoveNext();
}
} else {
if (!in_array($_GET['letter'], range('a', 'z')) && $_GET['letter'] != '0-9') {
//cx update
//zen_redirect(zen_href_link(FILENAME_DEFINE_PAGE_NOT_FOUND));
echo '<div style="text-align:center"><div class="error_box" style="width:300px;text-align:center; margin:0 auto;">Sorry,This is Tags "' . $_GET['letter'] . '" no Container Products</div></div>';
}
//echo FILENAME_DEFINE_PAGE_NOT_FOUND;
//zen_redirect(zen_href_link(FILENAME_DEFINE_PAGE_NOT_FOUND));
}
?>
</ul>
<?php
//print_r(zen_get_all_get_params(array('page', 'info', 'x', 'y')));
示例2: switch
$canonicalLink = '';
switch (TRUE) {
/**
* SSL Pages get no special treatment, since they're not normally indexed (unless the entire site is intentionally set to always be SSL, which is not typical)
*/
case $request_type == 'SSL' && substr(HTTP_SERVER, 0, 5) != 'https':
$canonicalLink = '';
break;
/**
* for products (esp those linked to multiple categories):
*/
/**
* for products (esp those linked to multiple categories):
*/
case strstr($current_page, '_info') && isset($_GET['products_id']):
$canonicalLink = zen_href_link($current_page, ($includeCPath ? 'cPath=' . zen_get_generated_category_path_rev(zen_get_products_category_id($_GET['products_id'])) . '&' : '') . 'products_id=' . $_GET['products_id'], 'NONSSL', false);
break;
/**
* for product listings:
*/
/**
* for product listings:
*/
case $current_page == 'index' && isset($_GET['cPath']):
$canonicalLink = zen_href_link($current_page, zen_get_all_get_params($excludeParams), 'NONSSL', false);
break;
/**
* for music products:
*/
/**
* for music products:
示例3: while
<?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";
示例4: array
$row = 0;
$col = 0;
$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>';
示例5: FROM
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';
}
}
示例6: die
* @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;
示例7: zen_href_link
<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>
示例8: array
$frist_get_pid_query3 = " select distinct products_id\n\t\t from products \n\t\t\t\t\t\t\t where products_status = 1 \n\t\t\t\t\t\t\t order by products_date_added desc\n\t\t\t\t\t\t\t limit 0," . MAX_DISPLAY_NEW_PRODUCTS;
$frist_get_pid_db3 = $db->Execute($frist_get_pid_query3);
$frist_get_pid3 = array();
if ($frist_get_pid_db3->RecordCount() > 0) {
while (!$frist_get_pid_db3->EOF) {
$frist_get_pid3[] = $frist_get_pid_db3->fields['products_id'];
$frist_get_pid_db3->MoveNext();
}
$frist_pid_str3 = implode(',', $frist_get_pid3);
$new_products_query = "select distinct p.products_id, p.products_image, \n\t\t\t\t\t\t\t\t\t\t\t\t pd.products_name,\n\t\t\t\t\t\t\t\t\t\t\t\t p.master_categories_id\n\t\t\t\t\t\t\t\t from " . TABLE_PRODUCTS . " p, \n\t\t\t\t\t\t\t\t\t " . TABLE_PRODUCTS_DESCRIPTION . " pd\n\t\t\t\t\t\t\t\t where p.products_id = pd.products_id\n\t\t\t\t\t\t\t\t and pd.language_id = " . (int) $_SESSION['languages_id'] . "\n\t\t\t\t\t\t\t\t and p.products_id in(" . $frist_pid_str3 . ")\n\t\t\t\t\t\t\t\t ";
//. $display_limit;
}
}
} else {
// get all products and cPaths in this subcat tree
$productsInCategory = zen_get_categories_products_list($manufacturers_id > 0 && $_GET['filter_id'] > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath, false, true, 0, $display_limit);
if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
// build products-list string to insert into SQL query
foreach ($productsInCategory as $key => $value) {
$list_of_products .= $key . ', ';
}
$list_of_products = substr($list_of_products, 0, -2);
// remove trailing comma
$new_products_query = "select distinct p.products_id, p.products_image, \n\t pd.products_name,\n p.master_categories_id\n from " . TABLE_PRODUCTS . " p, \n\t\t\t\t\t\t " . TABLE_PRODUCTS_DESCRIPTION . " pd\n where p.products_id = pd.products_id \n\t\t\t\t\t\t and p.products_status = 1 \n and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n and p.products_id in (" . $list_of_products . ") \n\t\t\t\t\t\t order by p.products_ordered desc,p.products_date_added desc limit 0," . MAX_DISPLAY_NEW_PRODUCTS;
}
}
if ($new_products_query != '') {
$new_products_db = $db->Execute($new_products_query);
}
$num_products_count = $new_products_query == '' ? 0 : $new_products_db->RecordCount();
// show only when 1 or more
示例9: from
<?php
/**
* featured sidebox - displays a random Featured Product
*
* @package templateSystem
* @author JunsGo@msn.com
* @copyright Copyright 2013 SL Development Team
* @copyright Portions Copyright 2003 osCommerce
*/
// test if box should display
$show_featured = true;
if ($show_featured == true) {
$random_featured_products_query = "select p.products_id, p.products_image, pd.products_name,\n p.master_categories_id, p.product_is_free\n from (" . TABLE_PRODUCTS . " p\n left join " . TABLE_FEATURED . " f on p.products_id = f.products_id\n left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )\n where p.products_id = f.products_id\n and p.products_id = pd.products_id\n and p.products_status = 1\n and f.status = 1\n and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'";
// randomly select ONE featured product from the list retrieved:
// $random_featured_product = zen_random_select($random_featured_products_query);
$random_featured_product = $db->ExecuteRandomMulti($random_featured_products_query, MAX_RANDOM_SELECT_FEATURED_PRODUCTS, true, CACHE_TIMELIFT);
if ($random_featured_product->RecordCount() > 0) {
$tpl_feature_array = array();
while (!$random_featured_product->EOF) {
$tpl_feature_array[] = array('id' => $random_featured_product->fields['products_id'], 'name' => $random_featured_product->fields['products_name'], '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"]), 'image' => $random_featured_product->fields['products_image'], 'price' => zen_get_products_display_price($random_featured_product->fields['products_id']), 'categories_id' => $random_featured_product->fields['master_categories_id'], 'is_free' => $random_featured_product->fields['product_is_free'] == 1 ? true : false, 'display_normal_price' => get_normal_price($random_featured_product->fields['products_id']), 'display_special_price' => get_special_price($random_featured_product->fields['products_id']), 'display_sale_price' => get_sale_discount_price($random_featured_product->fields['products_id']));
$random_featured_product->MoveNextRandom();
}
require $template->get_template_dir('tpl_featured.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_featured.php';
}
}
示例10: zen_get_generated_category_path_rev
$review_query = "select products_id, reviews_rating from " . TABLE_REVIEWS . " where products_id='{$pid}'";
$review_res = $db->Execute($review_query);
$rating_stars = $review_res->fields['reviews_rating'];
if ($pid == $sid) {
$msg_product = "<div class='tag tag-orange' title=''><div class='text'>SALE</div></div>";
} else {
if ($pid == $fid) {
$msg_product = "<div class='tag tag-orange' title=''><div class='text'>HOT</div></div>";
} else {
$msg_product = "<div class='tag tag-blue' title=''><div class='text'>NEW</div></div>";
}
}
$products_name = $relatedResult->fields['products_name'];
//$products_name = ltrim(substr($products_name, 0, 35) . ''); //Trims and Limits the product name
if (!isset($productsInCategory[$relatedResult->fields['products_id']])) {
$productsInCategory[$relatedResult->fields['products_id']] = zen_get_generated_category_path_rev($relatedResult->fields['master_categories_id']);
}
if (UN_MODULE_WISHLISTS_ENABLED) {
$wishlist_link = zen_href_link(UN_FILENAME_WISHLIST, 'products_id=' . $relatedResult->fields['products_id'] . '&action=wishlist_add_product');
} else {
$wishlist_link = '';
}
$compare_link = 'javascript: compareNew(' . $relatedResult->fields['products_id'] . ', \'add\')';
$buy_now = zen_get_buy_now_button($relatedResult->fields['products_id'], '');
if ($buy_now != NULL) {
$buy_now = '<a title="Sold Out" class="detailbutton-wrapper add-to-cart" href="' . zen_href_link(zen_get_info_page($relatedResult->fields['products_id']), 'cPath=' . $productsInCategory[$relatedResult->fields['products_id']] . '&products_id=' . $relatedResult->fields['products_id']) . '"><i class="fa fa-ban fa-lg"></i></a>';
} elseif ($attribute_product == $pid) {
$buy_now = '<a title="Add to Cart" class="detailbutton-wrapper add-to-cart" href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $relatedResult->fields['products_id']) . '"><i class="fa fa-shopping-cart fa-lg"></i></a>';
} else {
$buy_now = '<a title="Add to Cart" class="detailbutton-wrapper add-to-cart" href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $relatedResult->fields['products_id']) . '"><i class="fa fa-shopping-cart fa-lg"></i></a>';
}
示例11: while
<?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_whats_new.php 18698 2011-05-04 14:50:06Z wilt $
*/
$content = "";
$content .= '<div class="sideBoxContent centeredContent">';
$whats_new_box_counter = 0;
while (!$random_whats_new_sidebox_product->EOF) {
$whats_new_box_counter++;
$whats_new_price = zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']);
$content .= "\n" . ' <div class="sideBoxContentItem">';
$content .= '<div class="sidebox_content"><div class="product_sideboximage">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</div>';
$content .= '<div class="product_sideboxname"><a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($random_whats_new_sidebox_product->fields['master_categories_id']) . '&products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . $random_whats_new_sidebox_product->fields['products_name'] . '</a>';
$content .= '<div class="sidebox_price">' . $whats_new_price . '</div></div></div>';
$content .= '</div>';
$random_whats_new_sidebox_product->MoveNextRandom();
}
$content .= '</div>' . "\n";
示例12: array
<?php
/**
* specials sidebox - displays a random product "on special"
*
* @package templateSystem
* @author JunsGo@msn.com
* @copyright Copyright 2013 SL Development Team
* @copyright Portions Copyright 2003 osCommerce
*/
// test if box should display
$show_specials = false;
if (isset($_GET['products_id'])) {
$show_specials = false;
} else {
$show_specials = true;
}
if ($show_specials == true) {
$random_specials_sidebox_product_query = "select p.products_id, pd.products_name, p.products_price,\n p.products_tax_class_id, p.products_image,\n s.specials_new_products_price,\n p.master_categories_id\n from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s\n where p.products_status = 1\n and p.products_id = s.products_id\n and pd.products_id = s.products_id\n and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n and s.status = 1";
// $random_specials_sidebox_product = zen_random_select($random_specials_sidebox_product_query);
$random_specials_sidebox_product = $db->ExecuteRandomMulti($random_specials_sidebox_product_query, MAX_RANDOM_SELECT_SPECIALS, true, CACHE_TIMELIFT);
if ($random_specials_sidebox_product->RecordCount() > 0) {
$tpl_special_array = array();
while (!$random_specials_sidebox_product->EOF) {
$tpl_special_array[] = array('id' => $random_specials_sidebox_product->fields["products_id"], 'name' => $random_specials_sidebox_product->fields["products_name"], 'href' => zen_href_link(zen_get_info_page($random_specials_sidebox_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_specials_sidebox_product->fields["master_categories_id"]) . '&products_id=' . $random_specials_sidebox_product->fields["products_id"]), 'image' => $random_specials_sidebox_product->fields['products_image'], 'price' => zen_get_products_display_price($random_specials_sidebox_product->fields['products_id']), 'categories_id' => $random_specials_sidebox_product->fields['master_categories_id'], 'tax_class_id' => $random_specials_sidebox_product->fields['products_tax_class_id']);
$random_specials_sidebox_product->MoveNextRandom();
}
require $template->get_template_dir('tpl_specials.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_specials.php';
}
}
示例13: zen_get_reviews
function zen_get_reviews($products_id)
{
global $db;
$reviewArray = array();
$querySql = "SELECT r.`reviews_rating` FROM reviews r\n WHERE r.`status` = 1 AND r.`products_id` = " . $products_id . "\n ORDER BY r.`reviews_rating` DESC";
$reviews = $db->Execute($querySql);
if ($reviews->RecordCount() > 0) {
while (!$reviews->EOF) {
$reviewArray[] = $reviews->fields['reviews_rating'];
$reviews->MoveNext();
}
$outString = '<span class="fl">';
$starNum = $reviewArray[0];
for ($i = 0; $i < 5; $i++) {
if ($i < $starNum) {
$outString .= '<span class="star"></span>';
} else {
$outString .= '<span class="star_gray"></span>';
}
}
$outString .= ' <a href="' . zen_href_link(zen_get_info_page($products_id), 'cPath=' . zen_get_generated_category_path_rev($_GET['cPath']) . '&products_id=' . $products_id) . '" >' . sizeof($reviewArray) . ' review</a></span>';
} else {
$outString = '<span class="fl"><a href="' . zen_href_link(zen_get_info_page($products_id), 'cPath=' . zen_get_generated_category_path_rev($_GET['cPath']) . '&products_id=' . $products_id) . '#review" >' . PRODUCTS_LISTING_WRITE_VIEWS . '</a></span>';
}
return $outString;
}
示例14: foreach
if ($productIsSBA[$i] && (PRODINFO_ATTRIBUTE_PLUGIN_MULTI == 'single_dropdown' || PRODINFO_ATTRIBUTE_PLUGIN_MULTI == 'single_radioset') && (PRODINFO_ATTRIBUTE_DYNAMIC_STATUS == '1' || PRODINFO_ATTRIBUTE_DYNAMIC_STATUS == '2')) {
/* Breakdown the attributes into individual attributes to then be able to
* feed them into the applicable section(s).
*
*/
}
foreach ($_POST['id'] as $key => $value) {
$check = zen_get_attributes_valid($_POST['products_id'], $key, $value);
if ($check == false) {
$the_list .= TEXT_ERROR_OPTION_FOR . '<span class="alertBlack">' . zen_options_name($key) . '</span>' . TEXT_INVALID_SELECTION . '<span class="alertBlack">' . ($value == (int) PRODUCTS_OPTIONS_VALUES_TEXT_ID ? TEXT_INVALID_USER_INPUT : zen_values_name($value)) . '</span>' . '<br />';
}
}
}
if (!is_numeric($_POST['cart_quantity']) || $_POST['cart_quantity'] < 0) {
// adjust quantity when not a value
$chk_link = '<a href="' . zen_href_link(zen_get_info_page($_POST['products_id']), 'cPath=' . zen_get_generated_category_path_rev(zen_get_products_category_id($_POST['products_id'])) . '&products_id=' . $_POST['products_id']) . '">' . zen_get_products_name($_POST['products_id']) . '</a>';
$messageStack->add_session('header', ERROR_CORRECTIONS_HEADING . ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART . $chk_link . ' ' . PRODUCTS_ORDER_QTY_TEXT . zen_output_string_protected($_POST['cart_quantity']), 'caution');
$_POST['cart_quantity'] = 0;
}
$attr_list = array();
$attr_dash = array();
$attr_id = array();
$attr_val = array();
if ((PRODINFO_ATTRIBUTE_PLUGIN_MULTI == 'single_dropdown' || PRODINFO_ATTRIBUTE_PLUGIN_MULTI == 'single_radioset') && (PRODINFO_ATTRIBUTE_DYNAMIC_STATUS == '1' || PRODINFO_ATTRIBUTE_DYNAMIC_STATUS == '2')) {
/*single dropdown as multiple*/
$attr_list = explode(',', $_POST['attrcomb']);
foreach ($attr_list as $attr_item) {
list($attr_id, $attr_val) = explode('-', $attr_item);
if (zen_not_null($attr_id) && zen_not_null($attr_val)) {
$_POST['id'][$attr_id] = $attr_val;
}
示例15: array
$col = 0;
$list_box_contents = array();
$title = '';
$num_products_count = $specials_index_query == '' ? 0 : $specials_index->RecordCount();
// show only when 1 or more
if ($num_products_count > 0) {
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_index->EOF) {
$products_price = zen_get_products_display_price($specials_index->fields['products_id']);
if (!isset($productsInCategory[$specials_index->fields['products_id']])) {
$productsInCategory[$specials_index->fields['products_id']] = zen_get_generated_category_path_rev($specials_index->fields['master_categories_id']);
}
$specials_index->fields['products_name'] = zen_get_products_name($specials_index->fields['products_id']);
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => (($specials_index->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . (int) $specials_index->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $specials_index->fields['products_image'], $specials_index->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . $specials_index->fields['products_id']) . '">' . $specials_index->fields['products_name'] . '</a><br />' . $products_price);
$col++;
if ($col > SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS - 1) {
$col = 0;
$row++;
}
$specials_index->MoveNextRandom();
}
if ($specials_index->RecordCount() > 0) {
$title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')) . '</h2>';
$zc_show_specials = true;
}
}