<?php
session_start();
/*
asaancart - easy shopping cart solution
---------------------------------------
Copyright 2009 Nasir Ahmad Khan
Email: hide@address.com
This file is part of asaancart - open source easy shopping cart solution.
asaancart is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
asaancart is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with asaancart. If not, see <http://www.gnu.org/licenses/>.
*/
include("../config/config.php");
include("classes/functions.php");
if (session_id() == "") session_start();
$session_id = session_id();
include("includes/global_settings.php");
$product_name = $_GET['product_name'];
$product_id = $_GET['product_id'];
$smarty->assign('productData',getProductById($product_id));
$smarty->assign('productDataImages',getImagesByProductId($product_id));
$smarty->assign('relatedProducts',getRelatedProducts($product_id));
$smarty->assign('crossSellingProducts',getCrossSellingProducts($product_id));
$smarty->assign('totalRelatedProducts',getTotalRelatedProducts($product_id));
$smarty->assign('totalCrossSellingProducts',getTotalCrossSellingProducts($product_id));
//get variants
//$smarty->assign('productsVariants',getProductVariants($product_id));
//$smarty->assign('totalProductVariants',getTotalProductVariants($product_id));
//end variants
$smarty->assign('productTag','');
$smarty->assign('imgCnt',0);
$smarty->assign('title',getProductColumnById('product_name',$product_id));
$smarty->assign('product_price',getProductColumnById('product_price',$product_id));
$smarty->assign('product_deal_price',getProductColumnById('product_deal_price',$product_id));
$smarty->assign('product_qty',getProductColumnById('product_qty',$product_id));
$smarty->assign('variant_level_stock',getProductColumnById('variant_level_stock',$product_id));
//get product variants
$smarty->assign('productVariants',getProductVariants($product_id));
$smarty->assign('variantGroups',getVariantGroups());
$smarty->assign('productVariantGroups',getProductVariantGroups($product_id));
//get Total Qty
if(getProductColumnById('variant_level_stock',$product_id)=="no"){
$smarty->assign('totalProductQty',getProductColumnById('product_qty',$product_id));
}elseif(getProductColumnById('variant_level_stock',$product_id)=="yes"){
$smarty->assign('totalProductQty',getProductTotalQtyByVariants($product_id));
}
$smarty->assign('availability',getProductColumnById('availability',$product_id));
$smarty->assign('stock_options',getProductColumnById('stock_options',$product_id));
$smarty->assign('variant_level_stock',getProductColumnById('variant_level_stock',$product_id));
$smarty->assign('stock_variant_group_id',getProductColumnById('stock_variant_group_id',$product_id));
if(getProductColumnById('availability',$product_id)=="in_stock"){
$smarty->assign('availability', "In Stock");
}
$smarty->assign('product_id',$product_id);
$smarty->assign('product_name',$product_name);
$smarty->assign('template','product');
$smarty->display('shop/site_index.tpl');
?>