/**
* @KAL Group ¿É¼Ç ¼±Åýà °¡°Ý º¯µ¿ ó¸®
*/
$(function() {
// Trigger·Î Ãʱ⠰¡°Ý ¼³Á¤µÇµµ·Ï ÇؾßÇϳª?
$("select[name*=gd_selectOptions]").trigger("change");
});
// ¿É¼Ç¸í¿¡ ¼ýÀÚ·Î º¸¾Æ ¿©·¯°³ÀÇ ¿É¼ÇÀÌ ¿Ã ¼ö ÀÖ´Â °ÍÀ¸·Î º¸ÀÓ
var origin_price = parseInt($("input[name=dcprice]").val());
var option_count = $("select[name*=gd_selectOptions], input[name*=gd_checkOptions], input[name*=gd_radioOptions]").length;
for(var i=0; i 1) eval( 'option_price_' + optionIndexed + ' = ' + parseInt(option_split[1].replace(/[^0-9]/g,'')) );
else eval( 'option_price_' + optionIndexed + ' = 0' );
totalSum($("input[name=num]").val());
});
});
// ¶óµð¿À ¹× üũ¹Ú½º üũ½Ã
$("input[name*=gd_checkOptions]").bind('click', function(e) {
//option_price_0 = 0; // ÃʱâÈ
//option_price_1 = 0;
var optionIndexed = $("select[name*=gd_selectOptions], input[name*=gd_checkOptions], input[name*=gd_radioOptions]").index($(this));
$(this).parent().children().each(function() {
if ($(this).prop("checked")) {
var option_split = $(this).next("font").text().split(' : ');
if (option_split.length > 1) eval( 'option_price_' + optionIndexed + ' = ' + parseInt(option_split[1].replace(/[^0-9]/g,'')) );
else eval( 'option_price_' + optionIndexed + ' = 0' );
totalSum($("input[name=num]").val());
}
});
});
$("input[name*=gd_radioOptions]").bind('click', function(e) {
//option_price_0 = 0; // ÃʱâÈ
//option_price_1 = 0;
var optionIndexed = $("select[name*=gd_selectOptions], input[name*=gd_checkOptions], input[name*=gd_radioOptions]").index($(this));
$(this).parent().children().each(function() {
if ($(this).prop("checked")) {
var option_split = $(this).next("font").text().split(' : ');
if (option_split.length > 1) eval( 'option_price_' + optionIndexed + ' = ' + parseInt(option_split[1].replace(/[^0-9]/g,'')) );
else eval( 'option_price_' + optionIndexed + ' = 0' );
totalSum($("input[name=num]").val());
}
});
});
var sale_price = '6,800,000'.replace(/,/gi,'');
$(function(){
$("[name=gd_radioOptions0]").click(function(){
var addPrice = $(this).attr("price");
$("#sale_price").text((parseInt(addPrice) + parseInt(sale_price)).format());
});
//°¡°Ý¹®ÀÇ ¼³Á¤ ¹× ¹öÆ° ¾Èº¸ÀÌ°Ô Ã³¸®.
if(sale_price=="0"){
$("#td_price").html("°¡°Ý¹®ÀÇ ");
$("#btnDirect").hide();
$("#btnCart").hide();
}
});
$("input[name=num]").on("keyup", function() {
$(this).val( $(this).val().replace(/[^0-9]/g,"") );
if ($.isNumeric($(this).val()))
totalSum($(this).val());
});
function totalSum(no) {
var sum_option_price = function() {
};
var sum_option_price = 0;
for(var i=0; i 1) f.value = parseInt(oldNum - 1);
totalSum(f.value);
}
// ÁÖ¹®¼ö·®ÀÌ 1ÀÌ»óÀÏ °æ¿ì ÃÖÁ¾°¡°ÝÀÌ 1ÀÌ»ó¿¡ °¡°ÝÀ¸·Î ½ÃÀ۵ǰÔÇÏ´Â ¼Ò½º.
$(function() {
var ea = document.forms['cartPost'].elements['num'].value;
ea = parseInt(ea);
if( ea ) {
totalSum(ea);
}
});
// ¼ýÀÚ Å¸ÀÔ¿¡¼ ¾µ ¼ö ÀÖµµ·Ï format() ÇÔ¼ö Ãß°¡
Number.prototype.format = function(){
if(this==0) return 0;
var reg = /(^[+-]?\d+)(\d{3})/;
var n = (this + '');
while (reg.test(n)) n = n.replace(reg, '$1' + ',' + '$2');
return n;
};
// ¹®ÀÚ¿ ŸÀÔ¿¡¼ ¾µ ¼ö ÀÖµµ·Ï format() ÇÔ¼ö Ãß°¡
String.prototype.format = function(){
var num = parseFloat(this);
if( isNaN(num) ) return "0";
return num.format();
};
var is_main = "{DIS_PRICE_INFO}";
var gd_price = "6,800,000".replace(/,/gi,"");
var gd_point_per = "1";
var gd_point = "68,000";
var gd_point_unit = "¿ø";
var name_arr = new Array();
var price_arr = new Array();
//////////////////////////////////////////////////////////////////////////////////////////
//¿É¼Ç ¼±ÅÃó¸® ¹æ½Ä
//////////////////////////////////////////////////////////////////////////////////////////
var option_type = "";
var option_cnt = $("[name=options_cnt]").length;
if($("[name=options_cnt]").eq(0).val()=="S"){
option_type = "select";
}else if($("[name=options_cnt]").eq(0).val()=="R"){
option_type = "radio";
}else if($("[name=options_cnt]").eq(0).val()=="C"){
option_type = "check";
}
if(option_cnt==0){
$("[name=opt_type]").val("");
}else{
$("[name=opt_type]").val("opt_list");
$("#tr_number").hide();
}
//»êÃâÃß°¡.//, input[name*=gd_checkOptions], input[name*=gd_radioOptions]
$("select[name*=gd_selectOptions],input[name*=gd_radioOptions]").change(function(){
var selectedValue = $(this).val(); // ¼±ÅÃµÈ °ª °¡Á®¿À±â COS-231023
var extractedValue = selectedValue.split('^')[0];
var title = "";
var code = "";
var price = "";
price = parseInt(gd_price) + parseInt(price);
if(title=="Çʼö¼±ÅÃ")return false;
//°°Àº¿É¼ÇÀÌ ÀÖÀ»°æ¿ì Ãß°¡ ¾ÈµÇ°Ô ¸·´Â´Ù.
for(var iCnt=0;iCnt < $("#div_cart_list ul li").length;iCnt++){
var temp_code = $("#div_cart_list ul li").eq(iCnt).find("[name=cart_code]").val();
if(extractedValue == temp_code){
alert("ÀÌ¹Ì Ãß°¡µÈ ¿É¼ÇÀÌ ÀÖ½À´Ï´Ù.");
return false;
}
}
var opt_cnt = 0;
var opt_length = option_cnt;
for(var icnt=0;icnt < opt_length;icnt++){
if(option_type=="select"){
if($("select[name*=gd_selectOptions]").eq(icnt).val() !=""){
opt_cnt++;
var arr = $("select[name*=gd_selectOptions]").eq(icnt).find("option:selected").val();
if(title==""){
title = $("select[name*=gd_selectOptions]").eq(icnt).find("option:selected").text();
code = arr.split("^")[0];
price = Number(arr.split("^")[1]);
}else{
title = title + "," + $("select[name*=gd_selectOptions]").eq(icnt).find("option:selected").text();
code = code + "," + arr.split("^")[0];
price = price + Number(arr.split("^")[1]);
}
}
}else if(option_type=="radio"){
if($("input[name=gd_radioOptions"+icnt+"]:checked").val() !=""){
opt_cnt++;
var arr = $("input[name=gd_radioOptions"+icnt+"]:checked").val();
var eq = $("input[name^=gd_radioOptions]").index($("input[name=gd_radioOptions"+icnt+"]:checked"));
if(title==""){
title = $("[name=radio_title]").eq(eq).text();
code = arr.split("^")[0];
price = Number(arr.split("^")[1]);
}else{
title = title + "," + $("[name=radio_title]").eq(eq).text();
code = code + "," + arr.split("^")[0];
price = price + Number(arr.split("^")[1]);
}
//alert(title);
}
}else if(option_type=="check"){
if($("input[name*=gd_checkOptions]").eq(icnt).val() !=""){
opt_cnt++;
var arr = $("input[name*=gd_checkOptions]").val();
if(title==""){
title = $("input[name*=gd_checkOptions]").text();
code = arr.split("^")[0];
price = Number(arr.split("^")[1]);
}else{
title = title + "," + $("input[name*=gd_checkOptions]").text();
code = code + "," + arr.split("^")[0];
price = price + Number(arr.split("^")[1]);
}
}
}
}
price = parseInt(gd_price) + price;
if(opt_cnt!=option_cnt){return false;}
var temp_li = "";
temp_li += "";
temp_li += "";
temp_li += "" + title + "";
temp_li += "";
temp_li += ""+price.format()+"¿ø";
temp_li += "¡¿";
temp_li += "";
$("#div_cart_list ul").append(temp_li);
totalSum();
$("#tr_optlist").show();
if(option_type=="select"){
for(var icnt=0;icnt < $("select[name*=gd_selectOptions]").length;icnt++){
$("select[name*=gd_selectOptions]").eq(icnt).val("");
}
}else if(option_type=="radio"){
for(var icnt=0;icnt < $("input[name^=gd_radioOptions]").length;icnt++){
$("input[name^=gd_radioOptions]").eq(icnt).prop("checked",false);
}
}
});
$(document).on("keyup","[name=cart_num]",function(){
totalSum();
});
$(document).on("click","[name=btnCartDown]",function(){
var num = $(this).parents(".number").find("[name=cart_num]").val();
if(num==1)return false;
$(this).parents(".number").find("[name=cart_num]").val((parseInt(num) - 1));
totalSum();
});
$(document).on("click","[name=btnCartUp]",function(){
var num = $(this).parents(".number").find("[name=cart_num]").val();
if(num==999)return false;
$(this).parents(".number").find("[name=cart_num]").val((parseInt(num) + 1));
totalSum();
});
$(document).on("click","[name=btnCartDelete]",function(){
$(this).parent().remove();
totalSum();
if($("#div_cart_list ul li").length == 0){
$("#tr_optlist").hide();
}
});
$("#btnCart").click(function(){
if($("[name=opt_type]").val() == "opt_list"){
if($("#div_cart_list ul li").length == 0){
alert("¿É¼ÇÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
return false;
}
for(var iCnt=0;iCnt < $("#div_cart_list ul li").length;iCnt++){
var code = $("#div_cart_list ul li").eq(iCnt).find("[name=cart_code]").val();
var text = $("#div_cart_list ul li").eq(iCnt).find(".tit").html();
var num = $("#div_cart_list ul li").eq(iCnt).find("[name=cart_num]").val();
$("[name=opt_value]").val(code);
$("[name=num]").val(num);
var formData = $("#cartPost").serialize();
formData = decodeURIComponent((formData + '').replace(/\+/g,'%20'));
for(var jCnt=0;jCnt < option_cnt;jCnt++){
$("[name=gd_options"+jCnt+"]").val();
}
$.ajax({
type: "GET",
url: "/m/eshop/cart_post_db.ajax.html?newWin=&skin=&user_skin=&user_order=&user_desc=&user_npp=&searchKey=&searchValue=&price1=&price2=&price3=&view_status=&cgCode=28&gdCode=A-0043&view_status=",
async: false,
cache : false,
data: formData,
dataType: "html",
success: function (result) {
if( result == 'ok' ) {
location.href="/m/eshop/cart.html";
}
else {
alert(result);
}
}
});
}
}else{
var formData = $("#cartPost").serialize();
formData = decodeURIComponent((formData + '').replace(/\+/g,'%20'));
$.ajax({
type: "GET",
url: "/m/eshop/cart_post_db.ajax.html?newWin=&skin=&user_skin=&user_order=&user_desc=&user_npp=&searchKey=&searchValue=&price1=&price2=&price3=&view_status=&cgCode=28&gdCode=A-0043&view_status=",
async: false,
data: formData,
dataType: "html",
success: function (result) {
if( result == 'ok' ) {
location.href="/m/eshop/cart.html";
}
else {
alert(result);
}
}
});
}
});
$("#btnDirect").click(function(){
if($("[name=opt_type]").val() == "opt_list"){
if($("#div_cart_list ul li").length == 0){
alert("¿É¼ÇÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
return false;
}
for(var iCnt=0;iCnt < $("#div_cart_list ul li").length;iCnt++){
var code = $("#div_cart_list ul li").eq(iCnt).find("[name=cart_code]").val();
var text = $("#div_cart_list ul li").eq(iCnt).find(".tit").html();
var num = $("#div_cart_list ul li").eq(iCnt).find("[name=cart_num]").val();
$("[name=opt_value]").val(code);
$("[name=num]").val(num);
$("[name=direct]").val("1");
if(iCnt==0){
$("[name=direct_clear]").val("Y");
}else{
$("[name=direct_clear]").val("N");
}
var formData = $("#cartPost").serialize();
formData = decodeURIComponent((formData + '').replace(/\+/g,'%20'));
for(var jCnt=0;jCnt < option_cnt;jCnt++){
$("[name=gd_options"+jCnt+"]").val();
}
$.ajax({
type: "GET",
url: "/m/eshop/cart_post_db.ajax.html?newWin=&skin=&user_skin=&user_order=&user_desc=&user_npp=&searchKey=&searchValue=&price1=&price2=&price3=&view_status=&cgCode=28&gdCode=A-0043&view_status=",
async: false,
cache : false,
data: formData,
dataType: "html",
success: function (result) {
if( result == 'ok' ) {
location.href="/m/eshop/order_get_info.html";
}
else {
alert(result);
}
}
});
}
}else{
$("[name=direct]").val("1");
$("[name=direct_clear]").val("Y");
var formData = $("#cartPost").serialize();
formData = decodeURIComponent((formData + '').replace(/\+/g,'%20'));
$.ajax({
type: "GET",
url: "/m/eshop/cart_post_db.ajax.html?newWin=&skin=&user_skin=&user_order=&user_desc=&user_npp=&searchKey=&searchValue=&price1=&price2=&price3=&view_status=&cgCode=28&gdCode=A-0043&view_status=",
async: false,
data: formData,
dataType: "html",
success: function (result) {
if( result == 'ok' ) {
location.href="/m/eshop/order_get_info.html";
}
else {
alert(result);
}
}
});
}
});
function listSum(){
for(var iCnt=0;iCnt < $("#div_cart_list ul li").length;iCnt++){
var price = $("#div_cart_list ul li").eq(iCnt).find("[name=cart_price]").val();
var num = $("#div_cart_list ul li").eq(iCnt).find("[name=cart_num]").val();
$("#div_cart_list ul li").eq(iCnt).find(".price").html((parseInt(price) * parseInt(num)).format() + "¿ø");
}
}
function totalSum() {
if($("[name=opt_type]").val() == "opt_list"){
listSum();
var totalSum = 0;
for(var iCnt=0;iCnt < $("#div_cart_list ul li").length;iCnt++){
var price = $("#div_cart_list ul li").eq(iCnt).find("[name=cart_price]").val();
var num = $("#div_cart_list ul li").eq(iCnt).find("[name=cart_num]").val();
totalSum = totalSum + (parseInt(price) * parseInt(num));
}
$("#prd_total_price").html(totalSum.format());
if(gd_point_per!="0"){
var point = Math.round(totalSum*(gd_point_per/100));
$("#td_point").html(point.format() + gd_point_unit);
}
}else{
var num = $("[name=num]").val();
var total = gd_price * num;
$("#prd_total_price").html(total.format());
if(gd_point_per!="0"){
var point = Math.round(total*(gd_point_per/100));
$("#td_point").html(point.format() + gd_point_unit);
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////
¢Ã A/S ¹× ¹ÝÇ°Á¤º¸
±³È¯ ¹× ¹ÝÇ°ÀÌ °¡´ÉÇÑ °æ¿ì - »óÇ°À» °ø±Þ ¹ÞÀ¸½Å ³¯·ÎºÎÅÍ 7ÀÏÀ̳» ´Ü, °¡ÀüÁ¦Ç°ÀÇ °æ¿ì Æ÷ÀåÀ» °³ºÀÇÏ¿´°Å³ª Æ÷ÀåÀÌ ÈÑ¼ÕµÇ¾î »óÇ°°¡Ä¡°¡ »ó½ÇµÈ °æ¿ì¿¡´Â ±³È¯/¹ÝÇ°ÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù. - °ø±Þ¹ÞÀ¸½Å »óÇ° ¹× ¿ë¿ªÀÇ ³»¿ëÀÌ Ç¥½Ã.±¤°í ³»¿ë°ú ´Ù¸£°Å³ª ´Ù¸£°Ô ÀÌÇàµÈ °æ¿ì¿¡´Â °ø±Þ¹ÞÀº ³¯·ÎºÎÅÍ 3¿ùÀ̳», ±×»ç½ÇÀ» ¾Ë°Ô µÈ ³¯·ÎºÎÅÍ 30ÀÏÀ̳»
±³È¯ ¹× ¹ÝÇ°ÀÌ ºÒ°¡´ÉÇÑ °æ¿ì - °í°´´ÔÀÇ Ã¥ÀÓ ÀÖ´Â »çÀ¯·Î »óÇ°µîÀÌ ¸ê½Ç ¶Ç´Â ÈÑ¼ÕµÈ °æ¿ì. ´Ü, »óÇ°ÀÇ ³»¿ëÀ» È®ÀÎÇϱâ À§ÇÏ¿© Æ÷Àå µîÀ» ÈѼÕÇÑ °æ¿ì´Â Á¦¿Ü - Æ÷ÀåÀ» °³ºÀÇÏ¿´°Å³ª Æ÷ÀåÀÌ ÈÑ¼ÕµÇ¾î »óÇ°°¡Ä¡°¡ »ó½ÇµÈ °æ¿ì - °í°´´ÔÀÇ »ç¿ë ¶Ç´Â ÀϺΠ¼Òºñ¿¡ ÀÇÇÏ¿© »óÇ°ÀÇ °¡Ä¡°¡ ÇöÀúÈ÷ °¨¼ÒÇÑ °æ¿ì - ½Ã°£ÀÇ °æ°ú¿¡ ÀÇÇÏ¿© ÀçÆǸŰ¡ °ï¶õÇÒ Á¤µµ·Î »óÇ°µîÀÇ °¡Ä¡°¡ ÇöÀúÈ÷ °¨¼ÒÇÑ °æ¿ì - º¹Á¦°¡ °¡´ÉÇÑ »óÇ°µîÀÇ Æ÷ÀåÀ» ÈѼÕÇÑ °æ¿ì
¡Ø °í°´´ÔÀÇ ¸¶À½ÀÌ ¹Ù²î¾î ±³È¯, ¹ÝÇ°À» ÇÏ½Ç °æ¿ì »óÇ°¹Ý¼Û ºñ¿ëÀº °í°´´Ô²²¼ ºÎ´ãÇÏ¼Å¾ß ÇÕ´Ï´Ù.
¢Ã ¹è¼Û¾È³»
* ¹è¼Û ¹æ¹ý : Åùè * ¹è¼Û Áö¿ª : Àü±¹ Áö¿ª * ¹è¼Û ºñ¿ë : ½Çºñ ( ¿À¶ô±â ¹è¼Ûºñ´Â ÂøºÒÀÔ´Ï´Ù) * ¹è¼Û ±â°£ : 7ÀÏÀ̳» * ¹è¼Û ¾È³» »ê°£º®Áö³ª µµ¼Áö¹æÀº º°µµÀÇ Ãß°¡±Ý¾×À» ÁöºÒÇÏ¼Å¾ß ÇÏ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. °í°´´Ô²²¼ ÁÖ¹®ÇϽŠ»óÇ°Àº ÀÔ±Ý È®ÀÎÈÄ ¹è¼ÛÇØ µå¸³´Ï´Ù. ´Ù¸¸, »óÇ°Á¾·ù¿¡ µû¶ó¼ »óÇ°ÀÇ ¹è¼ÛÀÌ ´Ù¼Ò Áö¿¬µÉ ¼ö ÀÖ½À´Ï´Ù.
¢Ã û¾àöȸ
¡¸ÀüÀÚ»ó°Å·¡¹ý Á¦17Á¶ Á¦1Çס¹ ¿¡ ÀÇ°ÅÇÏ¿© ¼ÒºñÀÚÀÇ ´Ü¼øº¯½ÉÀ¸·Îµµ 7ÀÏ À̳» û¾àöȸ°¡ °¡´ÉÇÕ´Ï´Ù.
»óÇ°ÆòÀ» µî·ÏÇÏ½Ã¸é ¼ÒÁ¤ÀÇ Æ÷ÀÎÆ®¸¦ Áö±ÞÇÏ¿© µå¸³´Ï´Ù.
µî·ÏµÈ »ç¿ëÈıⰡ ¾ø½À´Ï´Ù.
|