| | All rights reserved. | +-----------------------------------------------------------------------------+ | PLEASE READ THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" | | FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE | | AT THE FOLLOWING URL: http://www.x-cart.com/license.php | | | | THIS AGREEMENT EXPRESSES THE TERMS AND CONDITIONS ON WHICH YOU MAY USE | | THIS SOFTWARE PROGRAM AND ASSOCIATED DOCUMENTATION THAT RUSLAN R. | | FAZLIEV (hereinafter referred to as "THE AUTHOR") IS FURNISHING OR MAKING | | AVAILABLE TO YOU WITH THIS AGREEMENT (COLLECTIVELY, THE "SOFTWARE"). | | PLEASE REVIEW THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT | | CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE. BY INSTALLING, | | COPYING OR OTHERWISE USING THE SOFTWARE, YOU AND YOUR COMPANY | | (COLLECTIVELY, "YOU") ARE ACCEPTING AND AGREEING TO THE TERMS OF THIS | | LICENSE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THIS | | AGREEMENT, DO NOT INSTALL OR USE THE SOFTWARE. VARIOUS COPYRIGHTS AND | | OTHER INTELLECTUAL PROPERTY RIGHTS PROTECT THE SOFTWARE. THIS | | AGREEMENT IS A LICENSE AGREEMENT THAT GIVES YOU LIMITED RIGHTS TO USE | | THE SOFTWARE AND NOT AN AGREEMENT FOR SALE OR FOR TRANSFER OF TITLE.| | THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT. | | | | The Initial Developer of the Original Code is Ruslan R. Fazliev | | Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2009 | | Ruslan R. Fazliev. All Rights Reserved. | +-----------------------------------------------------------------------------+ \*****************************************************************************/ # # $Id: product.php,v 1.28.2.6 2009/05/25 10:53:41 avg Exp $ # define('OFFERS_DONT_SHOW_NEW',1); require "./auth.php"; if (isset($productid) && !empty($productid) && $config['SEO']['clean_urls_enabled'] == 'Y' && !defined("DISPATCHED_REQUEST")) { func_clean_url_permanent_redirect('P', intval($productid)); } x_load('product'); # # Put all product info into $product array # $product_info = func_select_product($productid, @$user_account['membershipid'], true, false, false, false); $is_product_cat = func_query_first_cell("SELECT productid FROM $sql_tbl[products_categories] WHERE productid='$productid' AND categoryid='$cat' LIMIT 1"); if (intval($cat) == 0 || empty($is_product_cat)) { $cat = $product_info["categoryid"]; } $main = "product"; $smarty->assign("main",$main); if (!empty($product_info["productid"])) { $product_info['appearance'] = func_get_appearance_data($product_info); } include $xcart_dir.DIR_CUSTOMER."/send_to_friend.php"; if (!empty($send_to_friend_info)) { $smarty->assign("send_to_friend_info", $send_to_friend_info); if (!empty($active_modules['Image_Verification'])) { $smarty->assign("antibot_friend_err", $send_to_friend_info['antibot_err']); } x_session_unregister("send_to_friend_info"); } if (!empty($active_modules["Detailed_Product_Images"])) include $xcart_dir."/modules/Detailed_Product_Images/product_images.php"; if (!empty($active_modules["Magnifier"])) include $xcart_dir."/modules/Magnifier/product_magnifier.php"; if (!empty($active_modules["Product_Options"])) include $xcart_dir."/modules/Product_Options/customer_options.php"; if (!empty($active_modules["Upselling_Products"])) include $xcart_dir."/modules/Upselling_Products/related_products.php"; if (!empty($active_modules["Advanced_Statistics"]) && !defined("IS_ROBOT")) include $xcart_dir."/modules/Advanced_Statistics/prod_viewed.php"; if ($active_modules["Manufacturers"]) include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php"; if ($product_info["product_type"] != "C") { # # If this product is not configurable # if ($config["General"]["disable_outofstock_products"] == "Y" && empty($product_info['distribution'])) { $is_avail = true; if ($product_info['avail'] <= 0 && empty($variants)) { $is_avail = false; } elseif(!empty($variants)) { $is_avail = false; foreach($variants as $v) { if ($v['avail'] > 0) { $is_avail = true; break; } } } if (!empty($cart['products']) && !$is_avail) { foreach($cart['products'] as $v) { if($product_info['productid'] == $v['productid']) { $is_avail = true; break; } } } if (!$is_avail) { func_403(44); } } if(!empty($active_modules["Extra_Fields"])) { $extra_fields_provider=$product_info["provider"]; include $xcart_dir."/modules/Extra_Fields/extra_fields.php"; } if(!empty($active_modules["Subscriptions"])) { $_products = $products; $products = array($product_info); include_once $xcart_dir."/modules/Subscriptions/subscription.php"; $products = $_products; } if(!empty($active_modules["Feature_Comparison"])) include $xcart_dir."/modules/Feature_Comparison/product.php"; if (!empty($active_modules["Wholesale_Trading"]) && empty($product_info['variantid'])) include $xcart_dir."/modules/Wholesale_Trading/product.php"; if (!empty($active_modules['Product_Configurator']) && !empty($_GET['pconf'])) include $xcart_dir."/modules/Product_Configurator/slot_product.php"; } if (!empty($product_info['images']) && is_array($product_info['images'])) { if (empty($product_info['images']['P']['is_default'])) { $product_image_x = $product_info['images']['P']['x']; $product_image_y = $product_info['images']['P']['y']; } elseif (empty($product_info['images']['T']['is_default'])) { $product_image_x = $product_info['images']['T']['x']; $product_image_y = $product_info['images']['T']['y']; } else { list($product_image_x, $product_image_y) = getimagesize("http://".$xcart_http_host.$product_info['images']['T']['url']); $def_image = true; } list($product_image_width, $product_image_height) = func_crop_dimensions($product_image_x, $product_image_y, $config['Appearance']['image_width'], $config['Appearance']['image_height']); } if (!empty($variants) && is_array($variants)) { $max_var_image_x = 0; $max_var_image_y = 0; foreach ($variants as $k => $v) { if (!empty($v['is_image'])) { list($var_image_x, $var_image_y) = func_crop_dimensions($v['image_W_x'], $v['image_W_y'], $config['Appearance']['image_width'], $config['Appearance']['image_height']); $max_var_image_x = max($var_image_x, $max_var_image_x); $max_var_image_y = max($var_image_y, $max_var_image_y); } else { $max_var_image_x = max($product_image_width, $max_var_image_x); $max_var_image_y = max($product_image_height, $max_var_image_y); } } $product_image_width = !empty($max_var_image_x) ? $max_var_image_x : $product_image_width; $product_image_height = !empty($max_var_image_y) ? $max_var_image_y : $product_image_height; } elseif (!empty($def_image)) { $product_info['image_x'] = $product_image_width; $product_info['image_y'] = $product_image_height; } $smarty->assign("max_image_width", max($product_image_width, $max_det_image_x)); $smarty->assign("max_image_height", max($product_image_height, $max_det_image_y)); if (!empty($active_modules["Recommended_Products"])) include "./recommends.php"; if (!empty($active_modules["SnS_connector"])) include $xcart_dir."/modules/SnS_connector/product.php"; if (!empty($active_modules['Customer_Reviews'])) include $xcart_dir."/modules/Customer_Reviews/vote.php"; require $xcart_dir."/include/categories.php"; if (!empty($current_category) and is_array($current_category["category_location"])) { foreach ($current_category["category_location"] as $k=>$v) $location[] = $v; } if (!empty($product_info)) $location[] = array($product_info["product"],""); if (!empty($active_modules["Special_Offers"])) { include $xcart_dir."/modules/Special_Offers/product_offers.php"; } if ($product_info['avail'] > $config['Appearance']['quantity_select_box_limit']) $product_info['quantity_input_box_enabled'] = true; else $product_info['quantity_input_box_enabled'] = false; $smarty->assign("product",$product_info); if ($active_modules["Bestsellers"]) include $xcart_dir."/modules/Bestsellers/bestsellers.php"; # Deleting the previously saved user information received from PayPal (Is performed when the user exits the checkout process) if (x_session_is_registered("paypal_token") || x_session_is_registered("paypal_express_details")) { x_session_unregister('paypal_token'); x_session_unregister("paypal_express_details"); } $smarty->assign("meta_page_type", "P"); $smarty->assign("meta_page_id", $product_info['productid']); # Assign the current location line $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); ?>