diff --git a/modules/nproduct/nproduct.class.php b/modules/nproduct/nproduct.class.php
index 2e834e9..774fcfe 100644
--- a/modules/nproduct/nproduct.class.php
+++ b/modules/nproduct/nproduct.class.php
@@ -101,6 +101,11 @@ function checkUpdate()
return true;
}
+ if(!$oDB->isColumnExists('nproduct_options', 'type'))
+ {
+ return true;
+ }
+
return false;
}
@@ -253,6 +258,11 @@ function moduleUpdate()
$oDB->addColumn('nproduct_items', 'minimum_order_quantity', 'number', '11', '0', TRUE);
}
+ if(!$oDB->isColumnExists('nproduct_options', 'type'))
+ {
+ $oDB->addColumn('nproduct_options', 'type', 'varchar', '11');
+ }
+
return new Object(0, 'success_updated');
}
diff --git a/modules/nproduct/nproduct.controller.php b/modules/nproduct/nproduct.controller.php
index 5ffefd6..858b16e 100644
--- a/modules/nproduct/nproduct.controller.php
+++ b/modules/nproduct/nproduct.controller.php
@@ -1167,6 +1167,7 @@ function procNproductInsertOptions()
$option_srls = Context::get('option_srls');
$options_title = Context::get('options_title');
$options_price = Context::get('options_price');
+ $options_type = Context::get('type');
$existing_options = $oNproductModel->getOptions($item_srl);
@@ -1185,6 +1186,7 @@ function procNproductInsertOptions()
$args->list_order = $args->option_srl * -1;
$args->title = $val;
$args->price = $options_price[$key];
+ $args->type = $options_type[$key];
$output = executeQuery('nproduct.insertOption', $args);
if(!$output->toBool())
{
@@ -1197,6 +1199,7 @@ function procNproductInsertOptions()
$args->list_order = $args->option_srl * -1;
$args->title = $val;
$args->price = $options_price[$key];
+ $args->type = $options_type[$key];
$output = executeQuery('nproduct.updateOption', $args);
if(!$output->toBool())
{
@@ -1206,6 +1209,7 @@ function procNproductInsertOptions()
}
}
+
if(count($existing_options))
{
$args = new stdClass();
diff --git a/modules/nproduct/nproduct.item.php b/modules/nproduct/nproduct.item.php
index e889205..7311ea1 100644
--- a/modules/nproduct/nproduct.item.php
+++ b/modules/nproduct/nproduct.item.php
@@ -58,6 +58,7 @@ function nproductItem($info, $currency="KRW", $as_sign="N", $decimals=0)
if(is_object($extra_vars) || is_array($extra_vars))
{
+ $this->extra_var_objs = new stdClass();
foreach ($extra_vars as $key => $val)
{
$this->extra_var_objs->{$val->column_name} = $val;
diff --git a/modules/nproduct/nproduct.model.php b/modules/nproduct/nproduct.model.php
index f1d81e2..9f749c6 100644
--- a/modules/nproduct/nproduct.model.php
+++ b/modules/nproduct/nproduct.model.php
@@ -32,6 +32,10 @@ function getModuleConfig()
{
$oModuleModel = getModel('module');
$config = $oModuleModel->getModuleConfig('nproduct');
+ if(!$config)
+ {
+ $config = new stdClass();
+ }
if(!$config->cart_thumbnail_width)
{
$config->cart_thumbnail_width = 100;
@@ -119,7 +123,7 @@ function getItemExtraFormList($module_srl, $filter_response = false)
$join_form_list = array($join_form_list);
}
$join_form_count = count($join_form_list);
-
+ $lang->extend_vars = array();
for($i = 0; $i < $join_form_count; $i++)
{
$join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name);
@@ -361,6 +365,7 @@ function getCombineItemExtras(&$item_info)
*/
function getCategoryInfo($node_id)
{
+ $args = new stdClass();
$args->node_id = $node_id;
$output = executeQuery('nproduct.getCategoryInfo', $args);
if(!$output->toBool())
@@ -417,6 +422,7 @@ function getAllCategories()
function getItemInfo($item_srl)
{
$config = $this->getModuleConfig();
+ $args = new stdClass();
$args->item_srl = $item_srl;
$output = executeQuery('nproduct.getItemInfo', $args);
if(!$output->toBool())
@@ -470,6 +476,7 @@ function getItemNames(&$itemList)
function getItemList($item_srl, $list_count = 20, $sort_index = 'list_order')
{
$config = $this->getModuleConfig();
+ $args = new stdClass();
$args->item_srl = $item_srl;
$args->list_count = $list_count;
$args->sort_index = $sort_index;
@@ -835,6 +842,7 @@ function getDiscount(&$item_info)
*/
function getGroupDiscount(&$item_info, $group_list)
{
+ $args = new stdClass();
$args->item_srl = $item_info->item_srl;
$output = executeQueryArray('nproduct.getGroupDiscount', $args);
if(!$output->toBool())
@@ -887,6 +895,7 @@ function getGroupDiscount(&$item_info, $group_list)
*/
function getGlobalGroupDiscount($module_srl, &$item_info, $group_list)
{
+ $args = new stdClass();
$args->module_srl = $module_srl;
$output = executeQueryArray('nproduct.getGlobalGroupDiscount', $args);
if(!$output->toBool())
@@ -952,6 +961,7 @@ function getQuantityDiscount(&$item_info, $logged_info)
$purchase_count = $oNcartModel->getPurchaseCount($logged_info->member_srl, $item_info->item_srl);
}
+ $args = new stdClass();
$args->item_srl = $item_info->item_srl;
// check
@@ -1005,6 +1015,7 @@ function getMemberDiscount(&$item_info, $logged_info)
return new Object();
}
+ $args = new stdClass();
$args->member_srl = $logged_info->member_srl;
// check
@@ -1118,6 +1129,7 @@ function discountItems(&$item_list, $group_list = array(), $width = 50, $height
$config = $oNcartModel->getModuleConfig();
+ $ret_obj = new stdClass();
$ret_obj->total_price = 0;
$ret_obj->sum_price = 0;
$ret_obj->delivery_fee = 0;
@@ -1166,12 +1178,18 @@ function discountItems(&$item_list, $group_list = array(), $width = 50, $height
}
if($option)
{
- // 단가
- $item_list[$key]->price = $val->price + ($option->price);
- // 할인가 합계
- $item_list[$key]->sum_discounted_price += ($option->price * $val->quantity);
- // 판매가(원가격)
- $item_list[$key]->sum_price += ($option->price * $val->quantity);
+ if($option->type == 'Y')
+ {
+ $item_list[$key]->price = $option->price;
+ $item_list[$key]->sum_discounted_price = ($option->price * $val->quantity);
+ $item_list[$key]->sum_price = ($option->price * $val->quantity);
+ }
+ else
+ {
+ $item_list[$key]->price = $val->price + ($option->price);
+ $item_list[$key]->sum_discounted_price += ($option->price * $val->quantity);
+ $item_list[$key]->sum_price += ($option->price * $val->quantity);
+ }
}
$ret_obj->total_discounted_price += $item_list[$key]->sum_discounted_price;
@@ -1237,6 +1255,7 @@ function getFrontDisplayItems($module_srl, $category_srl = null, $num_columns =
$oFileModel = getModel('file');
// display categories
+ $args = new stdClass();
$args->module_srl = $module_srl;
if($category_srl)
{
@@ -1328,6 +1347,7 @@ function getDisplayItems($module_srls, $category_srl, $maxsize)
for($i = $nr_length - 1; $i >= 0; $i--)
{
+ $args = new stdClass();
$args->module_srl = $module_srls;
$args->node_route = $this->getNodeRoute($node_route, $i);
$args->list_count = $maxsize;
@@ -1423,6 +1443,7 @@ function getReviews(&$item_info)
*/
function getOptions($item_srl)
{
+ $args = new stdClass();
$args->item_srl = $item_srl;
$output = executeQueryArray('nproduct.getOptions', $args);
$options = array();
@@ -1581,6 +1602,7 @@ function getNproductExtraVars($module_name = null, $item_srl = null)
if($item_srl)
{
+ $args = new stdClass();
$args->item_srl = $item_srl;
$output = executeQueryArray("nproduct.getNproductExtraVars", $args);
if(!$output->toBool())
@@ -1743,6 +1765,7 @@ function getNproductInputExtraVars($extra_info)
*/
function getItemExtraVarList($item_srl)
{
+ $args = new stdClass();
$args->item_srl = $item_srl;
$output = executeQueryArray("nproduct.getNproductExtraVars", $args);
if(!$output->toBool())
@@ -1822,7 +1845,7 @@ function getProcModules()
$output = ModuleHandler::triggerCall('nproduct.getProcModules', 'before', $module_list);
if(!$output->toBool())
{
- debugPrint($output);
+
}
return $module_list;
}
diff --git a/modules/nproduct/queries/insertOption.xml b/modules/nproduct/queries/insertOption.xml
index 115edc2..99be07c 100644
--- a/modules/nproduct/queries/insertOption.xml
+++ b/modules/nproduct/queries/insertOption.xml
@@ -8,6 +8,7 @@
+
diff --git a/modules/nproduct/queries/updateOption.xml b/modules/nproduct/queries/updateOption.xml
index 5203b89..96a715e 100644
--- a/modules/nproduct/queries/updateOption.xml
+++ b/modules/nproduct/queries/updateOption.xml
@@ -5,6 +5,7 @@
+
diff --git a/modules/nproduct/schemas/nproduct_options.xml b/modules/nproduct/schemas/nproduct_options.xml
index d9b7e64..f0edf98 100644
--- a/modules/nproduct/schemas/nproduct_options.xml
+++ b/modules/nproduct/schemas/nproduct_options.xml
@@ -3,6 +3,7 @@
+
diff --git a/modules/nproduct/skins/book/itemdetail.html b/modules/nproduct/skins/book/itemdetail.html
index 1077b0b..386e3ad 100644
--- a/modules/nproduct/skins/book/itemdetail.html
+++ b/modules/nproduct/skins/book/itemdetail.html
@@ -80,7 +80,7 @@