Exemple #1
0
    for ($i = 0; $i < count($_REQUEST['product_id']); $i++) {
        if ($_REQUEST['quantity'][$i] != '') {

           $query = "INSERT INTO sohorepro_product_master SET product_id     = '" . $_REQUEST['product_id'][$i] . "', product_price = '" . $_REQUEST['price'][$i] . "', product_quantity = '" . $_REQUEST['quantity'][$i] . "', product_name = '".$_REQUEST['product_name'][$i]."', order_id = '" .$order_id_pro. "'";
           mysql_query($query);
           
        }
    }
    $result = "success";
    }  else {
    $result = "failure";   
    }
}
    

$special_pricelist=get_special_price($_SESSION['sohorepro_companyid']);

//print_r($special_pricelist);
$sprice_product=array();
$sprice_dprice=array();
foreach($special_pricelist as $newprice)
{
    $sprice_product[]=$newprice['sp_product_id'];
    $sprice_dprice[$newprice['sp_product_id']]=$newprice['sp_special_price'];
}

?>

 
<?php
if ($result == "success") {
<?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();
    }
}
Exemple #3
0
<?php
include './config.php';
$Super = getSuperCategory();
$cumpony_id = $_POST['company_id'];
$special_pricelist=get_special_price($cumpony_id);                                                                                                                                                     
$sprice_product=array();
$sprice_dprice=array();                                                                            
foreach($special_pricelist as $newprice)
{
    $sprice_product[]=$newprice['sp_product_id'];
    $sprice_dprice[$newprice['sp_product_id']]=array();
    $sprice_dprice[$newprice['sp_product_id']][]=$newprice['sp_special_price'];                                                                                
    $sprice_dprice[$newprice['sp_product_id']][]=$newprice['sp_discount'];
    $sprice_dprice[$newprice['sp_product_id']][]=$newprice['sp_list_price']; 
    $sprice_dprice[$newprice['sp_product_id']][]=$newprice['sp_id']; 
}
foreach($Super as $super){ 
$c_id = $super['id'];
$Category = getCategoryU($c_id); 
?>
<div class="super_cat" style="clear:both;" id="acc"><h1  title="Super Category" alt="Super Category"><?php echo $super['category_name']; ?></h1></div>
<ul class="acc sub_cat" id="acc" style="display:none;">
<?php
foreach ($Category as $Cat) {
$s_id = $Cat['id'];
$SubCategory = getSubCategoryU($s_id);
?>
<li class="parent"> 
<h2><div style="width:25px; margin-left:45px; float:left;"></div><div id="title_name" class="main_catg"><h2  title="Category" alt="Category"><?php echo $Cat['category_name']; ?></h2></div>                                                                           
</h2>
 * @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;
<?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';
}
Exemple #6
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';
    }
}
}
$col = 0;
$tpl_products = array('title' => '', 'products' => array());
$num_products_count = $new_products_query == '' ? 0 : $new_products->RecordCount();
// show only when 1 or more
if ($num_products_count > 0) {
    $title = '';
    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) {
        $the_categories_name_query = "select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id= '" . $new_products->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'][$new_products->fields['products_id']] = array('id' => $new_products->fields['products_id'], 'name' => zen_get_products_name($new_products->fields['products_id']), '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']), 'display_price' => zen_get_products_display_price($new_products->fields['products_id']), 'image' => $new_products->fields['products_image'] == '' && PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0 ? '' : $new_products->fields['products_image'], 'tax_class_id' => $new_products->fields['products_tax_class_id'], 'date_added' => $new_products->fields['products_date_added'], 'type' => $new_products->fields['products_type'], 'categories_id' => $new_products->fields['master_categories_id'], 'categories_name' => $the_categories_name->fields['categories_name'], 'categories_href' => zen_href_link(FILENAME_DEFAULT, 'cPath=' . $new_products->fields['master_categories_id']), 'is_call' => $new_products->fields['product_is_call'] ? true : false, 'is_free' => $new_products->fields['product_is_free'] == '1' ? true : false, 'display_normal_price' => get_normal_price($new_products->fields['products_id']), 'display_special_price' => get_special_price($new_products->fields['products_id']), 'display_sale_price' => get_sale_discount_price($new_products->fields['products_id']), 'content' => $new_products->fields['products_description']);
        $new_products->MoveNext();
    }
    if (!empty($show_select_product_id)) {
        //sort
        $show_select_product_id = explode(',', $show_select_product_id);
        $tpl_tmp_product = $tpl_products['products'];
        $tpl_products['products'] = array();
        foreach ($show_select_product_id as $tmp_id) {
            $tpl_products['products'][$tmp_id] = $tpl_tmp_product[$tmp_id];
        }
        unset($tpl_tmp_product, $tmp_id);
    }
    if ($new_products->RecordCount() > 0) {
        if (isset($new_products_category_id) && $new_products_category_id != 0) {
            $tpl_products['title'] = zen_get_categories_name((int) $new_products_category_id);
$products_date_added = $product_info->fields['products_date_added'];
$products_manufacturer = $manufacturers_name;
$products_weight = $product_info->fields['products_weight'];
$products_quantity = $product_info->fields['products_quantity'];
$products_qty_box_status = $product_info->fields['products_qty_box_status'];
$products_quantity_order_max = $product_info->fields['products_quantity_order_max'];
$products_base_price = $currencies->display_price(zen_get_products_base_price((int) $_GET['products_id']), zen_get_tax_rate($product_info->fields['products_tax_class_id']));
$product_is_free = $product_info->fields['product_is_free'];
$products_tax_class_id = $product_info->fields['products_tax_class_id'];
$module_show_categories = PRODUCT_INFO_CATEGORIES;
$module_next_previous = PRODUCT_INFO_PREVIOUS_NEXT;
$products_id_current = (int) $_GET['products_id'];
$products_discount_type = $product_info->fields['products_discount_type'];
$products_discount_type_from = $product_info->fields['products_discount_type_from'];
$display_normal_price = get_normal_price($product_info->fields['products_id']);
$display_special_price = get_special_price($product_info->fields['products_id']);
$display_sale_price = get_sale_discount_price($product_info->fields['products_id']);
$display_is_free = false;
if ($product_is_free == '1') {
    $display_is_free = true;
}
$display_is_call = get_product_is_call($product_info->fields['products_id']);
/**
 * Load product-type-specific main_template_vars
 */
$prod_type_specific_vars_info = DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars_product_type.php';
if (file_exists($prod_type_specific_vars_info)) {
    include_once $prod_type_specific_vars_info;
}
$zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_PRODUCT_TYPE_VARS_PRODUCT_INFO');
/**
<?php

/**
 * @author QQ46231996
 * @create 2015/6/1
 * @modify 2015/6/1
 */
$tpl_banner_product = array();
$banner_product_result = $db->Execute('SELECT p.`products_id`, p.`products_image`, pd.`products_name` FROM ' . TABLE_PRODUCTS . ' p 
	JOIN ' . TABLE_PRODUCTS_DESCRIPTION . ' pd ON (p.products_id=pd.products_id)
	WHERE p.`shop_id`=' . (int) $_SESSION['shop_id'] . ' ORDER BY RAND() ', 8, true, 43200);
while (!$banner_product_result->EOF) {
    $tpl_banner_product[$banner_product_result->fields['products_id']] = array('id' => $banner_product_result->fields['products_id'], 'image' => DIR_WS_IMAGES . $banner_product_result->fields['products_image'], 'href' => zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $banner_product_result->fields['products_id']), 'title' => $banner_product_result->fields['products_name'], 'display_price' => zen_get_products_display_price($banner_product_result->fields['products_id']), 'is_free' => $banner_product_result->fields['product_is_free'] == '1' ? true : false, 'display_normal_price' => get_normal_price($banner_product_result->fields['products_id']), 'display_special_price' => get_special_price($banner_product_result->fields['products_id']), 'display_sale_price' => get_sale_discount_price($banner_product_result->fields['products_id']));
    $banner_product_result->MoveNext();
}
unset($banner_product_result);