本文整理汇总了PHP中tep_get_product_path函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_get_product_path函数的具体用法?PHP tep_get_product_path怎么用?PHP tep_get_product_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_get_product_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
function start()
{
if (PHP_VERSION < 4.1) {
global $_GET;
}
global $cPath, $cPath_array, $current_category_id;
if (isset($_GET['cPath'])) {
$cPath = $_GET['cPath'];
} elseif (isset($_GET['products_id']) && !isset($_GET['manufacturers_id'])) {
$cPath = tep_get_product_path($_GET['products_id']);
} else {
$cPath = '';
}
if (!empty($cPath)) {
$cPath_array = tep_parse_category_path($cPath);
$cPath = implode('_', $cPath_array);
$current_category_id = end($cPath_array);
} else {
$current_category_id = 0;
}
include 'includes/classes/category_tree.php';
return true;
}
示例2: tep_activate_banners
// infobox
require DIR_WS_CLASSES . 'boxes.php';
// auto activate and expire banners
require DIR_WS_FUNCTIONS . 'banner.php';
tep_activate_banners();
tep_expire_banners();
// auto expire special products
require DIR_WS_FUNCTIONS . 'specials.php';
tep_expire_specials();
require DIR_WS_CLASSES . 'osc_template.php';
$oscTemplate = new oscTemplate();
// calculate category path
if (isset($HTTP_GET_VARS['cPath'])) {
$cPath = $HTTP_GET_VARS['cPath'];
} elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
} else {
$cPath = '';
}
if (tep_not_null($cPath)) {
$cPath_array = tep_parse_category_path($cPath);
$cPath = implode('_', $cPath_array);
$current_category_id = $cPath_array[sizeof($cPath_array) - 1];
} else {
$current_category_id = 0;
}
// include the breadcrumb class and start the breadcrumb trail
require DIR_WS_CLASSES . 'breadcrumb.php';
$breadcrumb = new breadcrumb();
$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
$breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));
示例3: calculate_tax_deduction
function calculate_tax_deduction($amount, $od_amount, $method)
{
global $customer_id, $order, $cc_id, $cart;
//$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead.
$coupon_query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'");
if (tep_db_num_rows($coupon_query) != 0) {
$coupon_result = tep_db_fetch_array($coupon_query);
$coupon_get = tep_db_query("select coupon_amount, coupon_minimum_order, restrict_to_products, restrict_to_categories, coupon_type from " . TABLE_COUPONS . " where coupon_code = '" . $coupon_result['coupon_code'] . "'");
$get_result = tep_db_fetch_array($coupon_get);
if ($get_result['coupon_type'] != 'S') {
//RESTRICTION--------------------------------
if ($get_result['restrict_to_products'] || $get_result['restrict_to_categories']) {
// What to do here.
// Loop through all products and build a list of all product_ids, price, tax class
// at the same time create total net amount.
// then
// for percentage discounts. simply reduce tax group per product by discount percentage
// or
// for fixed payment amount
// calculate ratio based on total net
// for each product reduce tax group per product by ratio amount.
$products = $cart->get_products();
$valid_product = false;
for ($i = 0; $i < sizeof($products); $i++) {
$valid_product = false;
$t_prid = tep_get_prid($products[$i]['id']);
$cc_query = tep_db_query("select products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");
$cc_result = tep_db_fetch_array($cc_query);
if ($get_result['restrict_to_products']) {
$pr_ids = split("[,]", $get_result['restrict_to_products']);
for ($p = 0; $p < sizeof($pr_ids); $p++) {
if ($pr_ids[$p] == $t_prid) {
$valid_product = true;
}
}
}
if ($get_result['restrict_to_categories']) {
// Tanaka 2005-4-30: Original Code
/*$cat_ids = split("[,]", $get_result['restrict_to_categories']);
for ($c = 0; $c < sizeof($cat_ids); $c++) {
// Tanaka 2005-4-30: changed $products_id to $t_prid and changed $i to $c
$cat_query = tep_db_query("select products_id from products_to_categories where products_id = '" . $t_prid . "' and categories_id = '" . $cat_ids[$c] . "'");
if (tep_db_num_rows($cat_query) !=0 ) $valid_product = true;
}*/
// v5.13a Tanaka 2005-4-30: New code, this correctly identifies valid products in subcategories
$cat_ids = split("[,]", $get_result['restrict_to_categories']);
$my_path = tep_get_product_path($t_prid);
$sub_cat_ids = split("[_]", $my_path);
for ($iii = 0; $iii < count($sub_cat_ids); $iii++) {
for ($ii = 0; $ii < count($cat_ids); $ii++) {
if ($sub_cat_ids[$iii] == $cat_ids[$ii]) {
$valid_product = true;
continue 2;
}
}
}
}
if ($valid_product) {
$price_excl_vat = $products[$i]['final_price'] * $products[$i]['quantity'];
//Fred - added
$price_incl_vat = $this->product_price($t_prid);
//Fred - added
$valid_array[] = array('product_id' => $t_prid, 'products_price' => $price_excl_vat, 'products_tax_class' => $cc_result['products_tax_class_id']);
//jason //Fred - changed from $products[$i]['final_price'] 'products_tax_class' => $cc_result['products_tax_class_id']);
// $total_price += $price_incl_vat; //Fred - changed
$total_price += $price_excl_vat;
// changed
}
}
if (sizeof($valid_array) > 0) {
// if ($valid_product) {
if ($get_result['coupon_type'] == 'P') {
$ratio = $get_result['coupon_amount'] / 100;
} else {
$ratio = $od_amount / $total_price;
}
if ($get_result['coupon_type'] == 'S') {
$ratio = 1;
}
if ($method == 'Credit Note') {
$tax_rate = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
if ($get_result['coupon_type'] == 'P') {
$tod_amount = $od_amount / (100 + $tax_rate) * $tax_rate;
} else {
$tod_amount = $order->info['tax_groups'][$tax_desc] * $od_amount / 100;
}
$order->info['tax_groups'][$tax_desc] -= $tod_amount;
$order->info['total'] -= $tod_amount;
// need to modify total ...OLD
$order->info['tax'] -= $tod_amount;
//Fred - added
} else {
for ($p = 0; $p < sizeof($valid_array); $p++) {
$tax_rate = tep_get_tax_rate($valid_array[$p]['products_tax_class'], $order->delivery['country']['id'], $order->delivery['zone_id']);
$tax_desc = tep_get_tax_description($valid_array[$p]['products_tax_class'], $order->delivery['country']['id'], $order->delivery['zone_id']);
if ($tax_rate > 0) {
//Fred $tod_amount[$tax_desc] += ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; //OLD
$tod_amount = $valid_array[$p]['products_price'] * $tax_rate / 100 * $ratio;
// calc total tax Fred - added
//.........这里部分代码省略.........
示例4: tep_check_stock
$lc_align = 'center';
$lc_text = ' ' . $duedate . ' ';
break;
case 'PRODUCT_LIST_BUY_NOW':
$valid_to_checkout = true;
if (STOCK_CHECK == 'true') {
$stock_check = tep_check_stock((int) $listing[$x]['products_id'], 1);
if (tep_not_null($stock_check) && STOCK_ALLOW_CHECKOUT == 'false') {
$valid_to_checkout = false;
}
}
if ($valid_to_checkout == true) {
$hide_add_to_cart = hide_add_to_cart();
$lc_text = '';
if ($hide_add_to_cart == 'false' && group_hide_show_prices() == 'true') {
$lc_text = '<div class="col-sm-6 col-lg-6 no-margin-left product-listing-module-buy-now buy-btn-div"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'cPath', 'products_id')) . 'action=buy_now&products_id=' . $listing[$x]['products_id'] . '&cPath=' . tep_get_product_path($listing[$x]['products_id']) . $params) . '"><button class="product-listing-module-buy-now-button btn btn-success btn-block">' . IMAGE_BUTTON_BUY_NOW . '</button></a></div>';
}
}
$lc_text .= '</div>';
break;
}
$product_contents[] = $lc_text;
}
$lc_text = implode($product_contents);
echo '<div class="product-listing-module-items"><div class="col-sm-4 col-lg-4 with-padding"><div class="thumbnail align-center" style="height: 460px;">' . $lc_text . '</div></div></div>';
$column++;
if ($column >= COLUMN_COUNT) {
$row++;
$column = 0;
}
}
示例5: Copyright
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
$history = new box_order_history();
if (count($history->rows) > 0) {
?>
<!-- order_history //-->
<div class="well" >
<div class="box-header small-margin-bottom small-margin-left"><?php
echo BOX_HEADING_CUSTOMER_ORDERS;
?>
</div>
<?php
foreach ($history->rows as $products) {
// changes the cust_order into a buy_now action
$customer_orders_string .= ' ' . ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a>' . ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'cPath', 'products_id')) . 'action=buy_now&products_id=' . $products['products_id'] . '&cPath=' . tep_get_product_path($products['products_id'])) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a>' . ' ';
}
echo '<div style="margin-left:5px">' . $customer_orders_string . '</div>';
?>
<script>
$('.box-product-categories-ul-top').addClass('list-unstyled list-indent-large');
$('.box-product-categories-ul').addClass('list-unstyled list-indent-large');
</script>
</div>
<!-- order_history_eof //-->
<?php
}
示例6: array
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS);
new contentBoxHeading($info_box_contents);
$row = 0;
$col = 0;
$info_box_contents = array();
while ($xsell = tep_db_fetch_array($xsell_query)) {
$pf->loadProduct($xsell['products_id'], $languages_id);
$xsell_price = $pf->getPriceStringShort();
$s_buy_now = '';
$hide_add_to_cart = hide_add_to_cart();
if ($hide_add_to_cart == 'false' && group_hide_show_prices() == 'true') {
$s_buy_now = '<br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action', 'cPath', 'products_id')) . 'action=buy_now&products_id=' . $xsell['products_id'] . '&cPath=' . tep_get_product_path($xsell['products_id']), 'NONSSL') . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>';
}
$info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<center><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] . '</a><br>' . cre_products_blurb($xsell['products_id']) . $xsell_price . $s_buy_now . '</center>');
$col++;
if ($col > 2) {
$col = 0;
$row++;
}
}
// Modify to avoid display if no X-Sells Defined - courtesy Halbert DMG
// halbert mod - Don't show heading if no cross-sell items
if ($num_products_xsell >= MIN_DISPLAY_XSELL && $num_products_xsell > 0) {
new contentBox($info_box_contents, true, true);
if (TEMPLATE_INCLUDE_CONTENT_FOOTER == 'true') {
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left', 'text' => tep_draw_separator('pixel_trans.gif', '100%', '1'));
示例7: tep_href_link
$col++;
?>
<td><table class="linkListing" width="100%" border="0" cellspacing="0" cellpadding="6">
<tr>
<td width="20%" valign="top" align="center" class="smallText">
<a href="<?php
echo tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL');
?>
"><?php
echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
?>
</a>
</td>
<td valign="top" align="left" class="smallText">
<b><a href="<?php
echo tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL');
?>
"><?php
echo $products['products_name'];
?>
</a></b>
<?php
// Begin Wish List Code w/Attributes
$attributes_addon_price = 0;
// Now get and populate product attributes
if ($_SESSION['customer_id'] > 0) {
$wishlist_products_attributes_query = tep_db_query("select products_options_id as po, products_options_value_id as pov from " . TABLE_WISHLIST_ATTRIBUTES . " where customers_id='" . $_SESSION['customer_id'] . "' and products_id = '" . $products['products_id'] . "'");
while ($wishlist_products_attributes = tep_db_fetch_array($wishlist_products_attributes_query)) {
$data1 = $wishlist_products_attributes['pov'];
$data = unserialize(str_replace("\\", '', $data1));
if (array_key_exists('c', $data)) {
示例8: tep_href_link
} else {
if ($link_vars_get == '' && $link_vars_post != '') {
$return_link_vars = $link_vars_post;
}
}
}
$nav_link = '<div class="margin-top large-margin-bottom pull-right"><a href="' . tep_href_link($navigation->path[$back]['page'], $return_link_vars, $navigation->path[$back]['mode']) . '"> <button class="btn btn-lg btn-success disabled" type="button">' . IMAGE_BUTTON_CONTINUE_SHOPPING . '</button></a></div>';
//$nav_link = '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>';
/***** fix end ****/
}
} else {
if (RETURN_CART == 'C' || isset($_SERVER['HTTP_REFERER']) && stristr($_SERVER['HTTP_REFERER'], 'wishlist')) {
if (!stristr($_SERVER['HTTP_REFERER'], 'wishlist')) {
$products = $cart->get_products();
$products = array_reverse($products);
$cat = tep_get_product_path($products[0]['id']);
$cat1 = 'cPath=' . $cat;
if ($products == '') {
$back = sizeof($navigation->path) - 2;
if (isset($navigation->path[$back])) {
$nav_link = '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>';
}
} else {
$nav_link = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cat1) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>';
}
} else {
$nav_link = '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>';
}
} else {
if (RETURN_CART == 'P') {
$products = $cart->get_products();
示例9: tep_href_link
<td class="main" align="left">
<?php
if (BASKET_CART == 'cart') {
echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART, 'action=clear_cart', 'SSL') . '" onClick="var x=confirm(\'' . CLEAR_CART . '\'); if (x==false) { return false; }">' . tep_image_button('button_clear_cart.gif', IMAGE_CLEAR_CART);
} else {
echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART, 'action=clear_cart', 'SSL') . '" onClick="var x=confirm(\'' . CLEAR_CART . '\'); if (x==false) { return false; }">' . tep_image_button('button_clear_basket.gif', IMAGE_CLEAR_BASKET);
}
?>
</a></td>
<?php
//BOF Bugfix #384
$back = sizeof($navigation->path) - 2;
$count = count($products);
if (isset($products[$count - 1]['id'])) {
$continueButtonId = tep_get_product_path(str_replace(strstr($products[$count - 1]['id'], '{'), '', $products[$count - 1]['id']));
}
if (isset($continueButtonId)) {
?>
<td align="center" class="main"><?php
echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $continueButtonId) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>';
?>
</td>
<?php
// if (isset($navigation->path[$back])) {
} elseif (isset($navigation->path[$back])) {
//
?>
<td align="center" class="main"><?php
echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>';
?>
示例10: tep_get_url_data
function tep_get_url_data()
{
global $_SERVER, $REQUEST_TYPE, $_GET, $languages_id, $cPath;
$url_data = array();
if ($REQUEST_TYPE == 'SSL') {
$comparison_array = explode('/', HTTPS_SERVER . DIR_WS_HTTPS_CATALOG, 4);
} else {
$comparison_array = explode('/', HTTP_SERVER . DIR_WS_HTTP_CATALOG, 4);
}
$comparison = $comparison_array[3];
$parts = explode('?', str_replace($comparison, '', $_SERVER['REQUEST_URI']), 2);
if (sizeof($parts) == 2) {
$parameters = explode('&', $parts[1]);
foreach ($parameters as $pair) {
$pieces = explode('=', $pair);
$_GET[$pieces[0]] = $pieces[1];
$url_data['get'][$pieces[0]] = $pieces[1];
}
}
$get_seo_item_query = tep_db_query("select categories_id, products_id, manufacturers_id, infopages_id from seo_urls where url = '" . $parts[0] . "' AND language_id = '" . (int) $languages_id . "'");
if (tep_db_num_rows($get_seo_item_query) > 0) {
$get_seo_item = tep_db_fetch_array($get_seo_item_query);
if ((int) $get_seo_item['categories_id'] > 0) {
//categorie
$category_query = tep_db_query("select categories_id, parent_id from categories where categories_id='" . $get_seo_item['categories_id'] . "'");
$category_array = tep_db_fetch_array($category_query);
$cPath = tep_get_full_cpath($category_array['categories_id']);
$current_category_id = $category_array['categories_id'];
$url_data['get']['cPath'] = $cPath;
$url_data['page'] = FILENAME_DEFAULT;
} else {
if ((int) $get_seo_item['products_id'] > 0) {
//product
$product_query = tep_db_query("select pd.products_id, pd.products_name from products_description pd, products_to_categories p2c, products p where p.products_id = pd.products_id and p.products_status = '1' and pd.products_id=p2c.products_id and pd.products_id='" . $get_seo_item['products_id'] . "'" . $parent_where_string);
$product_array = tep_db_fetch_array($product_query);
$cPath = tep_get_product_path($product_array['products_id']);
$url_data['get']['products_id'] = $product_array['products_id'];
$url_data['page'] = FILENAME_PRODUCT_INFO;
} else {
if ((int) $get_seo_item['manufacturers_id'] > 0) {
//manufacturer
if (strstr($get_seo_item['manufacturers_id'], '_')) {
$seo_item_ids = explode('_', $get_seo_item['manufacturers_id']);
$manufacturers_id = $seo_item_ids[0];
} else {
$manufacturers_id = $get_seo_item['manufacturers_id'];
}
$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from manufacturers where manufacturers_id='" . $manufacturers_id . "'");
$manufacturers_array = tep_db_fetch_array($manufacturers_query);
if (isset($seo_item_ids[1])) {
$filter_query = tep_db_query('SELECT categories_name FROM categories_description WHERE categories_id = "' . (int) $seo_item_ids[1] . '" AND language_id = "' . (int) $languages_id . '"');
$filter = tep_db_fetch_array($filter_query);
$_GET['filter_id'] = $seo_item_ids[1];
}
$url_data['get']['manufacturers_id'] = $manufacturers_array['manufacturers_id'];
$url_data['page'] = FILENAME_DEFAULT;
} else {
if ((int) $get_seo_item['infopages_id'] > 0) {
$test_query = tep_db_query("select it.infopages_id from infopages i, infopages_text it where i.infopages_id = it.infopages_id AND i.infopages_id = '" . $get_seo_item['infopages_id'] . "'");
$infopages_array = tep_db_fetch_array($test_query);
$url_data['get']['page'] = $infopages_array['infopages_id'];
$url_data['page'] = FILENAME_INFOPAGE;
}
}
}
}
}
return $url_data;
}
示例11: tep_get_product_style
$item_class .= ' lastofrow';
}
if ($display_class == 'grid') {
$product_width = 100 / PRODUCT_LISTING_GRID_COLUMNS;
$extra_style = ' style="width:' . $product_width . '%;' . tep_get_product_style($listing['products_id']) . '"';
} else {
if (tep_get_product_style($listing['products_id']) != '') {
$extra_style = ' style="' . tep_get_product_style($listing['products_id']) . '"';
} else {
$extra_style = '';
}
}
//DISCOUNT
if (USE_PRICES_TO_QTY == 'false' && PRICE_BOOK == 'true') {
//added here so this can be used add the whole page
$cPath = tep_get_product_path($listing['products_id']);
$discount_price = tep_get_discountprice($listing['products_price'], $customer_id, $customer_group, $listing['products_id'], $cPath, $listing['manufacturers_id']);
$discount = false;
if (PRICE_BOOK_STAR_PRODUCT_LISTING == 'true') {
if ($discount_price['lowest']['discount'] > 0 && $listing['specials_new_products_price'] > $discount_price['lowest']['price']) {
$discount = $discount_price['lowest']['discount'];
}
}
}
//END DISCOUNT
?>
<div class="product<?php
echo $item_class;
?>
"<?php
echo $extra_style;
示例12: tep_db_query
$new10 = tep_db_query("select distinct \r\n p.products_id,\r\n pd.products_name, \r\n if (isnull(pg.customers_group_price), p.products_price, pg.customers_group_price) as products_price,\r\n p.products_image \r\n from (" . TABLE_PRODUCTS . " p \r\n left join " . TABLE_PRODUCTS_GROUPS . " pg on p.products_id = pg.products_id and pg.customers_group_id = '" . $customer_group_id . "'),\r\n " . TABLE_SPECIALS . " s,\r\n " . TABLE_PRODUCTS_DESCRIPTION . " pd\r\n where \r\n p.products_status = '1'\r\n and p.products_id = s.products_id\r\n and pd.products_id = p.products_id\r\n and pd.language_id = '" . $languages_id . "' \r\n and s.status = '1' \r\n and p.products_group_access like '%" . $customer_group_id . "%'\r\n order by rand(), s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS);
//Eversun mod end for sppc and qty price breaks
$row = 0;
$col = 0;
$num = 0;
$buyitnow = '';
while ($default_specials_1a = tep_db_fetch_array($new10)) {
$num++;
if ($num == 1) {
new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_SPECIALS));
}
$pf->loadProduct($default_specials_1a['products_id'], $languages_id);
$products_price_s = $pf->getPriceStringShort();
$hide_add_to_cart = hide_add_to_cart();
if ($hide_add_to_cart == 'false' && group_hide_show_prices() == 'true') {
$buyitnow = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'cPath', 'products_id')) . 'action=buy_now&products_id=' . $default_specials_1a['products_id'] . '&cPath=' . tep_get_product_path($default_specials_1a['products_id'])) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
}
$info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials_1a['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $default_specials_1a['products_image'], $default_specials_1a['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials_1a['products_id']) . '">' . $default_specials_1a['products_name'] . '</a><br>' . cre_products_blurb($default_specials_1a['products_id']) . $products_price_s . '<br>' . $buyitnow);
$col++;
if ($col > 2) {
$col = 0;
$row++;
}
}
if ($num) {
new contentBox($info_box_contents, true, true);
if (TEMPLATE_INCLUDE_CONTENT_FOOTER == 'true') {
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left', 'text' => tep_draw_separator('pixel_trans.gif', '100%', '1'));
new contentBoxFooter($info_box_contents);
}
示例13: calculate_credit
function calculate_credit($amount)
{
global $customer_id, $order, $cc_id;
$od_amount = 0;
if (isset($cc_id)) {
$coupon_query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'");
if (tep_db_num_rows($coupon_query) != 0) {
$coupon_result = tep_db_fetch_array($coupon_query);
$this->coupon_code = $coupon_result['coupon_code'];
$coupon_get = tep_db_query("select coupon_amount, coupon_minimum_order, restrict_to_products, restrict_to_categories, coupon_type from " . TABLE_COUPONS . " where coupon_code = '" . $coupon_result['coupon_code'] . "'");
$get_result = tep_db_fetch_array($coupon_get);
$c_deduct = $get_result['coupon_amount'];
if ($get_result['coupon_type'] == 'S') {
$c_deduct = $order->info['shipping_cost'];
}
if ($get_result['coupon_minimum_order'] <= $this->get_order_total()) {
if ($get_result['restrict_to_products'] || $get_result['restrict_to_categories']) {
for ($i = 0; $i < sizeof($order->products); $i++) {
if ($get_result['restrict_to_products']) {
$pr_ids = preg_split("[,]", $get_result['restrict_to_products']);
for ($ii = 0; $ii < count($pr_ids); $ii++) {
if ($pr_ids[$ii] == tep_get_prid($order->products[$i]['id'])) {
if ($get_result['coupon_type'] == 'P') {
$pr_c = $this->product_price($order->products[$i]['id']);
$pod_amount = round($pr_c * 10) / 10 * $c_deduct / 100;
$od_amount = $od_amount + $pod_amount;
} else {
$od_amount = $c_deduct;
}
}
}
} else {
$cat_ids = preg_split("[,]", $get_result['restrict_to_categories']);
for ($i = 0; $i < sizeof($order->products); $i++) {
$my_path = tep_get_product_path(tep_get_prid($order->products[$i]['id']));
$sub_cat_ids = preg_split("[_]", $my_path);
for ($iii = 0; $iii < count($sub_cat_ids); $iii++) {
for ($ii = 0; $ii < count($cat_ids); $ii++) {
if ($sub_cat_ids[$iii] == $cat_ids[$ii]) {
if ($get_result['coupon_type'] == 'P') {
$pr_c = $this->product_price($order->products[$i]['id']);
$pod_amount = round($pr_c * 10) / 10 * $c_deduct / 100;
$od_amount = $od_amount + $pod_amount;
} else {
$od_amount = $c_deduct;
}
}
}
}
}
}
}
} else {
if ($get_result['coupon_type'] != 'P') {
$od_amount = $c_deduct;
} else {
$od_amount = $amount * $get_result['coupon_amount'] / 100;
}
}
}
}
if ($od_amount > $amount) {
$od_amount = $amount;
}
}
return $od_amount;
}
示例14: tep_href_link
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true)
{
global $request_type, $session_started, $SID, $spider_flag;
if (!tep_not_null($page)) {
$page = FILENAME_DEFAULT;
}
$link = '';
$redirect_url = '';
$categories_id = '';
$products_id = '';
$categories_parameters = '';
$sections_id = '';
$information_id = '';
$sections_parameters = '';
$news_id = '';
$news_parameters = '';
$cname = '';
$sname = '';
$nname = '';
$rname = '';
$mname = '';
$product_type_id = 0;
if (basename($page) == FILENAME_CATEGORIES) {
$params = explode("&", $parameters);
reset($params);
while (list(, $param) = each($params)) {
list($param_name, $param_value) = explode('=', $param);
if ($param_name == 'cPath') {
$categories_id = $param_value;
} elseif ($param_name == 'categories_id') {
$categories_id = $param_value;
} elseif ($param_name == 'products_id') {
$products_id = $param_value;
} elseif ($param_name == 'tPath') {
$product_type_id = $param_value;
} else {
$categories_parameters .= (tep_not_null($categories_parameters) ? '&' : '') . $param;
}
if ($param_name == 'cName') {
$cname = $param_value;
# if (substr($cname, -1)=='/') $cname = substr($cname, 0, -1);
# if (substr($cname, 0, 1)=='/') $cname = substr($cname, 1);
}
}
if (tep_not_null($products_id) && empty($categories_id)) {
$categories_id = tep_get_product_path($products_id);
}
$current_category_id = 0;
if (tep_not_null($categories_id)) {
$last_id = end(explode('_', $categories_id));
$parent_categories = array($last_id);
tep_get_parents($parent_categories, $last_id);
$parent_categories = array_reverse($parent_categories);
reset($parent_categories);
while (list(, $category_id) = each($parent_categories)) {
$categories_path_query = tep_db_query("select categories_path, products_types_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int) $category_id . "' limit 1");
if (tep_db_num_rows($categories_path_query) > 0) {
$categories_path = tep_db_fetch_array($categories_path_query);
if (tep_not_null($categories_path['categories_path'])) {
$link .= $categories_path['categories_path'] . '/';
} else {
$link .= $category_id . '/';
}
$current_category_id = $category_id;
$product_type_id = $categories_path['products_types_id'];
}
}
}
if (empty($categories_id) && empty($products_id) && tep_not_null($cname)) {
$link .= $cname;
}
$parameters = $categories_parameters;
} elseif (basename($page) == FILENAME_PRODUCT_INFO) {
$params = explode("&", $parameters);
reset($params);
while (list(, $param) = each($params)) {
list($param_name, $param_value) = explode('=', $param);
if ($param_name == 'products_id') {
$products_id = $param_value;
} else {
$categories_parameters .= (tep_not_null($categories_parameters) ? '&' : '') . $param;
}
}
if (tep_not_null($products_id)) {
$link .= $products_id . '.html';
}
$parameters = $categories_parameters;
} elseif (basename($page) == FILENAME_SPECIALS) {
$params = explode("&", $parameters);
$year = '';
$month = '';
$week = '';
reset($params);
while (list(, $param) = each($params)) {
list($param_name, $param_value) = explode('=', $param);
if ($param_name == 'tPath') {
$tpath = $param_value;
} elseif ($param_name == 'year') {
$year = (int) $param_value;
} elseif ($param_name == 'month') {
//.........这里部分代码省略.........
示例15: popupWindowWishlist
<div class="well">
<div class="box-header small-margin-bottom small-margin-left"><?php
echo BOX_HEADING_WISHLIST;
?>
</div>
<script type="text/javascript"><!--
function popupWindowWishlist(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=425,height=475,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
<?php
if (count($wishlist->rows) < 1) {
foreach ($wishlist->rows as $product_id) {
$products = $pf->loadProduct($product_id, $languages_id);
echo '' . "\n" . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a>' . "\n" . '' . "\n" . '' . "\n" . '<b><a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action', 'cPath', 'products_id')) . 'action=buy_now&products_id=' . $products['products_id'] . '&cPath=' . tep_get_product_path($products['products_id']), 'NONSSL') . '">' . BOX_TEXT_MOVE_TO_CART . '</a> |' . "\n" . '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b>' . "\n" . tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '' . '' . "\n";
}
} else {
echo BOX_WISHLIST_EMPTY . "\n";
}
echo '<a href="' . tep_href_link(FILENAME_WISHLIST, '', 'NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a>' . "\n";
echo '<br><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '', 'NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST_HELP . '</u> [?]</a>' . "\n";
// Normal link
echo $customer_wishlist_string;
?>
</div>
<?php
}
?>
<!-- wishlist eof//-->