?>
 
</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')));
Exemple #2
0
$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:
Exemple #3
0
<?php

/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2011 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_featured.php 18698 2011-05-04 14:50:06Z wilt $
 */
$content = "";
$content .= '<div class="sideBoxContent centeredContent">';
$featured_box_counter = 0;
while (!$random_featured_product->EOF) {
    $featured_box_counter++;
    $featured_box_price = zen_get_products_display_price($random_featured_product->fields['products_id']);
    $content .= "\n" . '  <div class="sideBoxContentItem">';
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $content .= '<br />' . $random_featured_product->fields['products_name'] . '</a>';
    $content .= '<div>' . $featured_box_price . '</div>';
    $content .= '</div>';
    $random_featured_product->MoveNextRandom();
}
$content .= '</div>' . "\n";
Exemple #4
0
$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>';
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';
    }
}
 * @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;
                    <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>
        $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
Exemple #9
0
<?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';
    }
}
 $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>';
 }
Exemple #11
0
<?php

/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2011 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_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";
Exemple #12
0
<?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';
    }
}
Exemple #13
0
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;
}
     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;
         }
Exemple #15
0
$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;
    }
}
Exemple #16
0
<?php

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

/**
 * Electronics Template designed by zen-cart-power.com
 * zen-cart-power.com - Zen Cart templates and modules
 * Power your Zen Cart!
 * 
 * 
 * @copyright Copyright 2008-2009 Zen-Cart-Power.com
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */
$content = "";
$specials_box_counter = 0;
while (!$random_specials_sidebox_product->EOF) {
    $specials_box_counter++;
    $specials_box_price = zen_get_products_display_price($random_specials_sidebox_product->fields['products_id']);
    $content .= '<div class="sideBoxContent centeredContent">';
    $content .= '<a 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"]) . '">' . zen_image(DIR_WS_IMAGES . $random_specials_sidebox_product->fields['products_image'], $random_specials_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
    $content .= '<a class="sidebox-products" 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"]) . '">';
    $content .= $random_specials_sidebox_product->fields['products_name'] . '</a>';
    $content .= '<div>' . $specials_box_price . '</div>';
    $content .= '</div>';
    $random_specials_sidebox_product->MoveNextRandom();
}
    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 
	
		<!--</div>-->
		
		<?php 
        $display_qty = $flag_show_product_info_in_cart_qty == 1 ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . '1' . '</p>' : '';
        if ($products_qty_box_status == 0 or $products_quantity_order_max == 1) {
            // hide the quantity box and default to 1
            $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', $products->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        } else {
            // show the quantity box
            $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . zen_get_buy_now_qty($products->fields['products_id']) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display($products->fields['products_id']) . '<br />' . zen_draw_hidden_field('products_id', $products->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        }
        $display_button = zen_get_buy_now_button($products->fields['products_id'], $the_button);
        $products_description = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION);
        $products_description = ltrim(substr($products_description, 0, 250) . '');
        $moreinfo = '<a class="more_info_text" href="' . zen_href_link(zen_get_info_page($products->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products->fields['master_categories_id']) . '&products_id=' . $products->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
        ?>
 
		
		
		
		
		
		<!-- product data -->
        <div class="product-listview list-view">
        	<div class="row product-list-row">
                <div class="col col-lg-2 col-md-3 col-sm-3 col-xs-12">
                    <a href="<?php 
        echo zen_href_link(zen_get_info_page($products->fields['products_id']), 'products_id=' . $products->fields['products_id']);
        ?>
">
<?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();
    }
}
/**
 * pre-calculate the category path
 * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
 *
 * @package initSystem
 * @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: init_category_path.php 4769 2006-10-17 02:59:21Z drbyte $
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
$show_welcome = false;
if (isset($_GET['cPath'])) {
    $cPath = zen_get_generated_category_path_rev($_GET['cPath']);
    //ModiFy By showq
    //For breadcrumb is full
    //print_r($cPath); is trace
} elseif (isset($_GET['products_id']) && !zen_check_url_get_terms()) {
    $cPath = zen_get_product_path($_GET['products_id']);
} else {
    if (SHOW_CATEGORIES_ALWAYS == '1' && !zen_check_url_get_terms()) {
        $show_welcome = true;
        $cPath = defined('CATEGORIES_START_MAIN') ? CATEGORIES_START_MAIN : '';
    } else {
        $show_welcome = false;
        $cPath = '';
    }
}
if (zen_not_null($cPath)) {
Exemple #23
0
        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
Exemple #24
0
<?php

/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2011 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_featured.php 18698 2011-05-04 14:50:06Z wilt $
 */
$content = "";
$content .= '<div class="sideBoxContent centeredContent">';
$featured_box_counter = 0;
while (!$random_featured_product->EOF) {
    $featured_name = $random_featured_product->fields['products_name'];
    $featured_name = ltrim(substr($featured_name, 0, 20));
    $featured_box_counter++;
    $featured_box_price = zen_get_products_display_price($random_featured_product->fields['products_id']);
    $content .= "\n" . '  <div class="sideBoxContentItem">';
    $content .= '<div class="sidebox_content"><div class="product_sideboximage">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $featured_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</div>';
    $content .= '<div class="product_sideboxname"><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"]) . '">' . $featured_name . '</a>';
    $content .= '<div class="sidebox_price">' . $featured_box_price . '</div></div></div>';
    $content .= '</div>';
    $random_featured_product->MoveNextRandom();
}
$content .= '</div>' . "\n";
             $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;
<?php

// -----
// Scrolling "what's new" sidebox, based on the whats_new.php sidebox that's built into Zen Cart!
//
// Copyright (c) 2014, Vinos de Frutas Tropicales (lat9)
// Copyright 2003-2011 Zen Cart Development Team
// Copyright 2003 osCommerce
// License: http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
//
$content = '<div class="sideBoxContent centeredContent">';
while (!$whats_new_scrolling->EOF) {
    $whats_new_price = zen_get_products_display_price($whats_new_scrolling->fields['products_id']);
    $content .= "\n" . '  <div class="sideBoxContentItem hiddenField whatsNewScroller">';
    $content .= '<a href="' . zen_href_link(zen_get_info_page($whats_new_scrolling->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($whats_new_scrolling->fields['master_categories_id']) . '&products_id=' . $whats_new_scrolling->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $whats_new_scrolling->fields['products_image'], $whats_new_scrolling->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $content .= '<br />' . $whats_new_scrolling->fields['products_name'] . '</a>';
    $content .= '<div>' . $whats_new_price . '</div>';
    $content .= '</div>';
    $whats_new_scrolling->MoveNextRandom();
}
$content .= '</div><script type="text/javascript">$("div.whatsNewScroller").cycle(10000);</script>' . "\n";
 /**
  * Method to handle cart Action - multiple add products
  *
  * @param string forward destination
  * @param url parameters
  * @todo change while loop to a foreach
  */
 function actionMultipleAddProduct($goto, $parameters)
 {
     global $messageStack;
     if ($this->display_debug_messages) {
         $messageStack->add_session('header', 'FUNCTION ' . __FUNCTION__, 'caution');
     }
     $addCount = 0;
     if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
         //echo '<pre>'; echo var_dump($_POST['products_id']); echo '</pre>';
         while (list($key, $val) = each($_POST['products_id'])) {
             $prodId = preg_replace('/[^0-9a-f:.]/', '', $key);
             if (is_numeric($val) && $val > 0) {
                 $adjust_max = false;
                 $qty = $val;
                 $add_max = zen_get_products_quantity_order_max($prodId);
                 $cart_qty = $this->in_cart_mixed($prodId);
                 $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart');
                 // bof: adjust new quantity to be same as current in stock
                 $chk_current_qty = zen_get_products_stock($prodId);
                 if (STOCK_ALLOW_CHECKOUT == 'false' && $new_qty > $chk_current_qty) {
                     $new_qty = $chk_current_qty;
                     $messageStack->add_session('shopping_cart', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . WARNING_PRODUCT_QUANTITY_ADJUSTED . zen_get_products_name($prodId), 'caution');
                 }
                 // eof: adjust new quantity to be same as current in stock
                 if ($add_max == 1 and $cart_qty == 1) {
                     // do not add
                     $adjust_max = 'true';
                 } else {
                     // bof: adjust new quantity to be same as current in stock
                     if (STOCK_ALLOW_CHECKOUT == 'false' && $new_qty + $cart_qty > $chk_current_qty) {
                         $adjust_new_qty = 'true';
                         $alter_qty = $chk_current_qty - $cart_qty;
                         $new_qty = $alter_qty > 0 ? $alter_qty : 0;
                         $messageStack->add_session('shopping_cart', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . WARNING_PRODUCT_QUANTITY_ADJUSTED . zen_get_products_name($prodId), 'caution');
                     }
                     // eof: adjust new quantity to be same as current in stock
                     // adjust quantity if needed
                     if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
                         $adjust_max = 'true';
                         $new_qty = $add_max - $cart_qty;
                     }
                     $this->add_cart($prodId, $this->get_quantity($prodId) + $new_qty);
                     $addCount++;
                 }
                 if ($adjust_max == 'true') {
                     if ($this->display_debug_messages) {
                         $messageStack->add_session('header', 'FUNCTION ' . __FUNCTION__ . '<br>' . ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution');
                     }
                     $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution');
                 }
             }
             if (!is_numeric($val) || $val < 0) {
                 // adjust quantity when not a value
                 $chk_link = '<a href="' . zen_href_link(zen_get_info_page($prodId), 'cPath=' . zen_get_generated_category_path_rev(zen_get_products_category_id($prodId)) . '&products_id=' . $prodId) . '">' . zen_get_products_name($prodId) . '</a>';
                 $messageStack->add_session('header', ERROR_CORRECTIONS_HEADING . ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART . $chk_link . ' ' . PRODUCTS_ORDER_QTY_TEXT . zen_output_string_protected($val), 'caution');
                 $val = 0;
             }
         }
         // display message if all is good and not on shopping_cart page
         if ($addCount && 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)));
     }
 }
                    $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
                }
            }
            $the_button = $link;
            $products_link = '<span class="more-info"><a href="' . 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']) . '">' . MORE_INFO_TEXT . '</a></span>';
            $display_products_button = zen_get_buy_now_button($products_all->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_BUY_NOW, 3, 1));
        } else {
            $link = '<span class="more-info"><a href="' . 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']) . '">' . MORE_INFO_TEXT . '</a></span>';
            $the_button = $link;
            $products_link = '<span class="more-info"><a href="' . 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']) . '">' . MORE_INFO_TEXT . '</a></span>';
            $display_products_button = zen_get_buy_now_button($products_all->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_BUY_NOW, 3, 1));
        }
        if (PRODUCT_ALL_LIST_DESCRIPTION > '0') {
            $disp_text = zen_get_products_description($products_all->fields['products_id']);
            $disp_text = zen_clean_html($disp_text);
            $display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_ALL_LIST_DESCRIPTION, '...<br /><span class="more-info float-right"><a href="' . 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']) . '">' . MORE_INFO_TEXT . '</a></span>'));
        } else {
            $display_products_description = '';
        }
        ?>
          <tr class="<?php 
        echo (int) ($row_counter / 2) == $row_counter / 2 ? 'productListing-even' : 'productListing-odd';
        ?>
">
		  <td>
		 	<table class="table-product-attributes" border="0" width="100%" cellspacing="2" cellpadding="2">
			<tr>
            <td width="<?php 
        echo IMAGE_PRODUCT_ALL_LISTING_WIDTH + 10;
        ?>
" valign="top" class="listing-img main" align="center">
             $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
         }
     }
     $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;
 ?>
             break;
         case 'PRODUCT_LIST_WEIGHT':
             $lc_align = 'right';
             if ($listing->fields['products_weight'] != '') {
                 $trg_extra_val .= '<div class="product-weight">' . TABLE_HEADING_WEIGHT . ' : ' . $listing->fields['products_weight'] . '</div>';
             }
             //$lst_lc_text = '<div class="product-weight">'.$listing->fields['products_weight'].'</div>';
             break;
         case 'PRODUCT_LIST_IMAGE':
             $lc_align = 'center';
             if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
                 $lc_text = '';
                 $lst_lc_text = '';
             } else {
                 if (isset($_GET['manufacturers_id'])) {
                     $product_img_link = 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']);
                     $product_img_src = mb_getbaseimg_effects($listing->fields['products_image']);
                     $second_img_src = mb_gethoverimg_effects($listing->fields['products_image']);
                     $product_img = zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $products_name, IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT);
                 } else {
                     $product_img_src = mb_getbaseimg_effects($listing->fields['products_image']);
                     $second_img_src = mb_gethoverimg_effects($listing->fields['products_image']);
                     $product_img = zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $products_name, IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT);
                 }
             }
             break;
     }
     $product_contents[] = $lc_text;
     // Used For Column Layout (Grid Layout) Option
     $listview_product_contents[] = $lst_lc_text;
 }