영카트 5.4 버전 내용 적용
This commit is contained in:
5
js/jquery-1.12.4.min.js
vendored
Normal file
5
js/jquery-1.12.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
js/jquery-migrate-1.4.1.min.js
vendored
Normal file
2
js/jquery-migrate-1.4.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
186
js/owlcarousel/owl.carousel.css
Normal file
186
js/owlcarousel/owl.carousel.css
Normal file
@ -0,0 +1,186 @@
|
||||
/**
|
||||
* Owl Carousel v2.3.4
|
||||
* Copyright 2013-2018 David Deutsch
|
||||
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
|
||||
*/
|
||||
/*
|
||||
* Owl Carousel - Core
|
||||
*/
|
||||
.owl-carousel {
|
||||
display: none;
|
||||
width: 100%;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
/* position relative and z-index fix webkit rendering fonts issue */
|
||||
position: relative;
|
||||
z-index: 1; }
|
||||
.owl-carousel .owl-stage {
|
||||
position: relative;
|
||||
-ms-touch-action: pan-Y;
|
||||
touch-action: manipulation;
|
||||
-moz-backface-visibility: hidden;
|
||||
/* fix firefox animation glitch */ }
|
||||
.owl-carousel .owl-stage:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
line-height: 0;
|
||||
height: 0; }
|
||||
.owl-carousel .owl-stage-outer {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
/* fix for flashing background */
|
||||
-webkit-transform: translate3d(0px, 0px, 0px); }
|
||||
.owl-carousel .owl-wrapper,
|
||||
.owl-carousel .owl-item {
|
||||
-webkit-backface-visibility: hidden;
|
||||
-moz-backface-visibility: hidden;
|
||||
-ms-backface-visibility: hidden;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
-moz-transform: translate3d(0, 0, 0);
|
||||
-ms-transform: translate3d(0, 0, 0); }
|
||||
.owl-carousel .owl-item {
|
||||
position: relative;
|
||||
min-height: 1px;
|
||||
float: left;
|
||||
-webkit-backface-visibility: hidden;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-touch-callout: none; }
|
||||
.owl-carousel .owl-item img {
|
||||
display: block;
|
||||
width: 100%; }
|
||||
.owl-carousel .owl-nav.disabled,
|
||||
.owl-carousel .owl-dots.disabled {
|
||||
display: none; }
|
||||
.owl-carousel .owl-nav .owl-prev,
|
||||
.owl-carousel .owl-nav .owl-next,
|
||||
.owl-carousel .owl-dot {
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
.owl-carousel .owl-nav button.owl-prev,
|
||||
.owl-carousel .owl-nav button.owl-next,
|
||||
.owl-carousel button.owl-dot {
|
||||
background: none;
|
||||
color: inherit;
|
||||
border: none;
|
||||
padding: 0 !important;
|
||||
font: inherit; }
|
||||
.owl-carousel.owl-loaded {
|
||||
display: block; }
|
||||
.owl-carousel.owl-loading {
|
||||
opacity: 0;
|
||||
display: block; }
|
||||
.owl-carousel.owl-hidden {
|
||||
opacity: 0; }
|
||||
.owl-carousel.owl-refresh .owl-item {
|
||||
visibility: hidden; }
|
||||
.owl-carousel.owl-drag .owl-item {
|
||||
-ms-touch-action: pan-y;
|
||||
touch-action: pan-y;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
.owl-carousel.owl-grab {
|
||||
cursor: move;
|
||||
cursor: grab; }
|
||||
.owl-carousel.owl-rtl {
|
||||
direction: rtl; }
|
||||
.owl-carousel.owl-rtl .owl-item {
|
||||
float: right; }
|
||||
|
||||
/* No Js */
|
||||
.no-js .owl-carousel {
|
||||
display: block; }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Animate Plugin
|
||||
*/
|
||||
.owl-carousel .animated {
|
||||
animation-duration: 1000ms;
|
||||
animation-fill-mode: both; }
|
||||
|
||||
.owl-carousel .owl-animated-in {
|
||||
z-index: 0; }
|
||||
|
||||
.owl-carousel .owl-animated-out {
|
||||
z-index: 1; }
|
||||
|
||||
.owl-carousel .fadeOut {
|
||||
animation-name: fadeOut; }
|
||||
|
||||
@keyframes fadeOut {
|
||||
0% {
|
||||
opacity: 1; }
|
||||
100% {
|
||||
opacity: 0; } }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Auto Height Plugin
|
||||
*/
|
||||
.owl-height {
|
||||
transition: height 500ms ease-in-out; }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Lazy Load Plugin
|
||||
*/
|
||||
.owl-carousel .owl-item {
|
||||
/**
|
||||
This is introduced due to a bug in IE11 where lazy loading combined with autoheight plugin causes a wrong
|
||||
calculation of the height of the owl-item that breaks page layouts
|
||||
*/ }
|
||||
.owl-carousel .owl-item .owl-lazy {
|
||||
opacity: 0;
|
||||
transition: opacity 400ms ease; }
|
||||
.owl-carousel .owl-item .owl-lazy[src^=""], .owl-carousel .owl-item .owl-lazy:not([src]) {
|
||||
max-height: 0; }
|
||||
.owl-carousel .owl-item img.owl-lazy {
|
||||
transform-style: preserve-3d; }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Video Plugin
|
||||
*/
|
||||
.owl-carousel .owl-video-wrapper {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
background: #000; }
|
||||
|
||||
.owl-carousel .owl-video-play-icon {
|
||||
position: absolute;
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -40px;
|
||||
margin-top: -40px;
|
||||
background: url("owl.video.play.png") no-repeat;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
-webkit-backface-visibility: hidden;
|
||||
transition: transform 100ms ease; }
|
||||
|
||||
.owl-carousel .owl-video-play-icon:hover {
|
||||
-ms-transform: scale(1.3, 1.3);
|
||||
transform: scale(1.3, 1.3); }
|
||||
|
||||
.owl-carousel .owl-video-playing .owl-video-tn,
|
||||
.owl-carousel .owl-video-playing .owl-video-play-icon {
|
||||
display: none; }
|
||||
|
||||
.owl-carousel .owl-video-tn {
|
||||
opacity: 0;
|
||||
height: 100%;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
transition: opacity 400ms ease; }
|
||||
|
||||
.owl-carousel .owl-video-frame {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: 100%;
|
||||
width: 100%; }
|
||||
3448
js/owlcarousel/owl.carousel.js
Normal file
3448
js/owlcarousel/owl.carousel.js
Normal file
File diff suppressed because it is too large
Load Diff
6
js/owlcarousel/owl.carousel.min.css
vendored
Normal file
6
js/owlcarousel/owl.carousel.min.css
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Owl Carousel v2.3.4
|
||||
* Copyright 2013-2018 David Deutsch
|
||||
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
|
||||
*/
|
||||
.owl-carousel,.owl-carousel .owl-item{-webkit-tap-highlight-color:transparent;position:relative}.owl-carousel{display:none;width:100%;z-index:1}.owl-carousel .owl-stage{position:relative;-ms-touch-action:pan-Y;touch-action:manipulation;-moz-backface-visibility:hidden}.owl-carousel .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.owl-carousel .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0,0,0)}.owl-carousel .owl-item,.owl-carousel .owl-wrapper{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.owl-carousel .owl-item{min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-touch-callout:none}.owl-carousel .owl-item img{display:block;width:100%}.owl-carousel .owl-dots.disabled,.owl-carousel .owl-nav.disabled{display:none}.no-js .owl-carousel,.owl-carousel.owl-loaded{display:block}.owl-carousel .owl-dot,.owl-carousel .owl-nav .owl-next,.owl-carousel .owl-nav .owl-prev{cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel .owl-nav button.owl-next,.owl-carousel .owl-nav button.owl-prev,.owl-carousel button.owl-dot{background:0 0;color:inherit;border:none;padding:0!important;font:inherit}.owl-carousel.owl-loading{opacity:0;display:block}.owl-carousel.owl-hidden{opacity:0}.owl-carousel.owl-refresh .owl-item{visibility:hidden}.owl-carousel.owl-drag .owl-item{-ms-touch-action:pan-y;touch-action:pan-y;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-grab{cursor:move;cursor:grab}.owl-carousel.owl-rtl{direction:rtl}.owl-carousel.owl-rtl .owl-item{float:right}.owl-carousel .animated{animation-duration:1s;animation-fill-mode:both}.owl-carousel .owl-animated-in{z-index:0}.owl-carousel .owl-animated-out{z-index:1}.owl-carousel .fadeOut{animation-name:fadeOut}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{transition:height .5s ease-in-out}.owl-carousel .owl-item .owl-lazy{opacity:0;transition:opacity .4s ease}.owl-carousel .owl-item .owl-lazy:not([src]),.owl-carousel .owl-item .owl-lazy[src^=""]{max-height:0}.owl-carousel .owl-item img.owl-lazy{transform-style:preserve-3d}.owl-carousel .owl-video-wrapper{position:relative;height:100%;background:#000}.owl-carousel .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url(owl.video.play.png) no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;transition:transform .1s ease}.owl-carousel .owl-video-play-icon:hover{-ms-transform:scale(1.3,1.3);transform:scale(1.3,1.3)}.owl-carousel .owl-video-playing .owl-video-play-icon,.owl-carousel .owl-video-playing .owl-video-tn{display:none}.owl-carousel .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;background-size:contain;transition:opacity .4s ease}.owl-carousel .owl-video-frame{position:relative;z-index:1;height:100%;width:100%}
|
||||
7
js/owlcarousel/owl.carousel.min.js
vendored
Normal file
7
js/owlcarousel/owl.carousel.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
80
js/shop.category.navigation.js
Normal file
80
js/shop.category.navigation.js
Normal file
@ -0,0 +1,80 @@
|
||||
jQuery(function($){
|
||||
|
||||
$.fn.shop_select_to_html = function(option) {
|
||||
|
||||
var defaults = {
|
||||
menu_down_icon : '<i class="fa fa-chevron-circle-down" aria-hidden="true"></i>'
|
||||
}
|
||||
|
||||
if (typeof option == 'string') {
|
||||
} else if(typeof option == 'object'){
|
||||
defaults = $.extend({}, defaults, option);
|
||||
}
|
||||
|
||||
// Hide native select
|
||||
this.hide();
|
||||
|
||||
this.each(function() {
|
||||
var $select = $(this);
|
||||
|
||||
if (!$select.next().hasClass('shop_select_to_html')) {
|
||||
create_html_select($select);
|
||||
}
|
||||
});
|
||||
|
||||
function create_html_select($select) {
|
||||
|
||||
$select.after($('<div></div>')
|
||||
.addClass('shop_select_to_html')
|
||||
.addClass($select.attr('class') || '')
|
||||
.addClass($select.attr('disabled') ? 'disabled' : '')
|
||||
// .attr('tabindex', $select.attr('disabled') ? null : '0')
|
||||
.html('<span class="category_title current"></span><div class="menulist"></div>')
|
||||
);
|
||||
|
||||
var $dropdown = $select.next(),
|
||||
$options = $select.find('option'),
|
||||
$selected = $select.find('option:selected'),
|
||||
list_next_num = 8,
|
||||
menuhtmls = [];
|
||||
|
||||
$dropdown.find('.current').html($selected.data('display') || $selected.text()+defaults.menu_down_icon);
|
||||
|
||||
var $ul_el = $('<ul></ul>'),
|
||||
options_length = $options.length;
|
||||
|
||||
if( options_length > list_next_num ){
|
||||
$ul_el.addClass("wide");
|
||||
}
|
||||
|
||||
$options.each(function(i) {
|
||||
var $option = $(this),
|
||||
display = $option.data('display'),
|
||||
data_url = $(this).attr("data-url");
|
||||
|
||||
$ul_el.append($('<li></li>')
|
||||
.attr('data-value', $option.val())
|
||||
.attr('data-display', (display || null))
|
||||
.addClass('option' +
|
||||
($option.is(':selected') ? ' selected' : '') +
|
||||
($option.is(':disabled') ? ' disabled' : ''))
|
||||
.html('<a href="'+data_url+'">'+$option.text()+'</a>')
|
||||
);
|
||||
|
||||
if( i && (i % list_next_num === 0) ){
|
||||
menuhtmls.push($ul_el[0].outerHTML);
|
||||
$ul_el = $('<ul></ul>').addClass("wide left-border");
|
||||
}
|
||||
|
||||
if( i == ($options.length - 1) ){
|
||||
menuhtmls.push($ul_el[0].outerHTML);
|
||||
}
|
||||
});
|
||||
|
||||
$dropdown.find('.menulist').html(menuhtmls.join(''));
|
||||
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
});
|
||||
51
js/shop.js
51
js/shop.js
@ -52,10 +52,13 @@ $(function() {
|
||||
}
|
||||
|
||||
$(document).on("change", "select.it_option", function() {
|
||||
var sel_count = $("select.it_option").size();
|
||||
var idx = $("select.it_option").index($(this));
|
||||
var val = $(this).val();
|
||||
var it_id = $("input[name='it_id[]']").val();
|
||||
var sel_count = $("select.it_option").size(),
|
||||
idx = $("select.it_option").index($(this)),
|
||||
val = $(this).val(),
|
||||
it_id = $("input[name='it_id[]']").val(),
|
||||
post_url = (typeof g5_shop_url !== "undefined") ? g5_shop_url+"/itemoption.php" : "./itemoption.php",
|
||||
$this = $(this),
|
||||
op_0_title = $this.find("option:eq(0)").text();
|
||||
|
||||
// 선택값이 없을 경우 하위 옵션은 disabled
|
||||
if(val == "") {
|
||||
@ -63,6 +66,8 @@ $(function() {
|
||||
return;
|
||||
}
|
||||
|
||||
$this.trigger("select_it_option_change", [$this]);
|
||||
|
||||
// 하위선택옵션로드
|
||||
if(sel_count > 1 && (idx + 1) < sel_count) {
|
||||
var opt_id = "";
|
||||
@ -82,8 +87,8 @@ $(function() {
|
||||
}
|
||||
|
||||
$.post(
|
||||
"./itemoption.php",
|
||||
{ it_id: it_id, opt_id: opt_id, idx: idx, sel_count: sel_count },
|
||||
post_url,
|
||||
{ it_id: it_id, opt_id: opt_id, idx: idx, sel_count: sel_count, op_title : op_0_title },
|
||||
function(data) {
|
||||
$("select.it_option").eq(idx+1).empty().html(data).attr("disabled", false);
|
||||
|
||||
@ -92,6 +97,8 @@ $(function() {
|
||||
var idx2 = idx + 1;
|
||||
$("select.it_option:gt("+idx2+")").val("").attr("disabled", true);
|
||||
}
|
||||
|
||||
$this.trigger("select_it_option_post", [$this, idx, sel_count, data]);
|
||||
}
|
||||
);
|
||||
} else if((idx + 1) == sel_count) { // 선택옵션처리
|
||||
@ -168,10 +175,11 @@ $(function() {
|
||||
|
||||
// 수량변경 및 삭제
|
||||
$(document).on("click", "#sit_sel_option li button", function() {
|
||||
var mode = $(this).text();
|
||||
var this_qty, max_qty = 9999, min_qty = 1;
|
||||
var $el_qty = $(this).closest("li").find("input[name^=ct_qty]");
|
||||
var stock = parseInt($(this).closest("li").find("input.io_stock").val());
|
||||
var $this = $(this),
|
||||
mode = $this.text(),
|
||||
this_qty, max_qty = 9999, min_qty = 1,
|
||||
$el_qty = $(this).closest("li").find("input[name^=ct_qty]"),
|
||||
stock = parseInt($(this).closest("li").find("input.io_stock").val());
|
||||
|
||||
switch(mode) {
|
||||
case "증가":
|
||||
@ -187,6 +195,7 @@ $(function() {
|
||||
}
|
||||
|
||||
$el_qty.val(this_qty);
|
||||
$this.trigger("sit_sel_option_success", [$this, mode, this_qty]);
|
||||
price_calculate();
|
||||
break;
|
||||
|
||||
@ -197,6 +206,7 @@ $(function() {
|
||||
alert("최소 구매수량은 "+number_format(String(min_qty))+" 입니다.");
|
||||
}
|
||||
$el_qty.val(this_qty);
|
||||
$this.trigger("sit_sel_option_success", [$this, mode, this_qty]);
|
||||
price_calculate();
|
||||
break;
|
||||
|
||||
@ -214,6 +224,8 @@ $(function() {
|
||||
}
|
||||
|
||||
if(del_exec) {
|
||||
// 지우기전에 호출해야 trigger 를 호출해야 합니다.
|
||||
$this.trigger("sit_sel_option_success", [$this, mode, ""]);
|
||||
$el.closest("li").remove();
|
||||
price_calculate();
|
||||
} else {
|
||||
@ -231,25 +243,32 @@ $(function() {
|
||||
|
||||
// 수량직접입력
|
||||
$(document).on("keyup", "input[name^=ct_qty]", function() {
|
||||
var val= $(this).val();
|
||||
var $this = $(this),
|
||||
val= $this.val(),
|
||||
force_val = 0;
|
||||
|
||||
if(val != "") {
|
||||
if(val.replace(/[0-9]/g, "").length > 0) {
|
||||
alert("수량은 숫자만 입력해 주십시오.");
|
||||
$(this).val(1);
|
||||
force_val = 1;
|
||||
$(this).val(force_val);
|
||||
} else {
|
||||
var d_val = parseInt(val);
|
||||
if(d_val < 1 || d_val > 9999) {
|
||||
alert("수량은 1에서 9999 사이의 값으로 입력해 주십시오.");
|
||||
$(this).val(1);
|
||||
force_val = 1;
|
||||
$(this).val(force_val);
|
||||
} else {
|
||||
var stock = parseInt($(this).closest("li").find("input.io_stock").val());
|
||||
if(d_val > stock) {
|
||||
alert("재고수량 보다 많은 수량을 구매할 수 없습니다.");
|
||||
$(this).val(stock);
|
||||
force_val = stock;
|
||||
$(this).val(force_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this.trigger("change_option_qty", [$this, val, force_val]);
|
||||
|
||||
price_calculate();
|
||||
}
|
||||
@ -415,6 +434,8 @@ function add_sel_option(type, id, option, price, stock)
|
||||
}
|
||||
|
||||
price_calculate();
|
||||
|
||||
$("#sit_sel_option").trigger("add_sit_sel_option", [opt]);
|
||||
}
|
||||
|
||||
// 동일선택옵션있는지
|
||||
@ -460,6 +481,8 @@ function price_calculate()
|
||||
});
|
||||
|
||||
$("#sit_tot_price").empty().html("<span>총 금액 :</span> "+number_format(String(total))+"원");
|
||||
|
||||
$("#sit_tot_price").trigger("price_calculate", [total]);
|
||||
}
|
||||
|
||||
// php chr() 대응
|
||||
|
||||
319
js/shop.list.action.js
Normal file
319
js/shop.list.action.js
Normal file
@ -0,0 +1,319 @@
|
||||
var mainCart = mainCart || {};
|
||||
|
||||
mainCart.chr = function(code){
|
||||
return String.fromCharCode(code);
|
||||
}
|
||||
|
||||
jQuery(function ($) {
|
||||
|
||||
var select_option_el = "select.it_option",
|
||||
overclass = "overlay",
|
||||
cartclass = "sct_cartop",
|
||||
cart_btn_class = "sct_btn";
|
||||
|
||||
mainCart.add_wishitem = function(el) {
|
||||
|
||||
var $el = $(el),
|
||||
it_id = $el.data("it_id");
|
||||
|
||||
if(!it_id) {
|
||||
alert("상품코드가 올바르지 않습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$.post(
|
||||
g5_shop_url + "/ajax.action.php",
|
||||
{ it_id: it_id, action : "wish_update" },
|
||||
function(error) {
|
||||
if(error != "OK") {
|
||||
alert(error.replace(/\\n/g, "\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
mainCart.update_wish_side();
|
||||
alert("상품을 위시리스트에 담았습니다.");
|
||||
return;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
mainCart.add_cart = function(frm) {
|
||||
|
||||
var $frm = $(frm);
|
||||
var $sel = $frm.find(select_option_el);
|
||||
var it_name = $frm.find("input[name^=it_name]").val();
|
||||
var it_price = parseInt($frm.find("input[name^=it_price]").val());
|
||||
var id = "";
|
||||
var value, info, sel_opt, item, price, stock, run_error = false;
|
||||
var option = sep = "";
|
||||
var count = $sel.size();
|
||||
|
||||
if(count > 0) {
|
||||
$sel.each(function(index) {
|
||||
value = $(this).val();
|
||||
item = $(this).prev("label").text();
|
||||
|
||||
if(!value) {
|
||||
run_error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// 옵션선택정보
|
||||
sel_opt = value.split(",")[0];
|
||||
|
||||
if(id == "") {
|
||||
id = sel_opt;
|
||||
} else {
|
||||
id += mainCart.chr(30)+sel_opt;
|
||||
sep = " / ";
|
||||
}
|
||||
|
||||
option += sep + item + ":" + sel_opt;
|
||||
});
|
||||
|
||||
if(run_error) {
|
||||
alert(it_name+"의 "+item+"을(를) 선택해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
price = value[1];
|
||||
stock = value[2];
|
||||
} else {
|
||||
price = 0;
|
||||
stock = $frm.find("input[name^=it_stock]").val();
|
||||
option = it_name;
|
||||
}
|
||||
|
||||
// 금액 음수 체크
|
||||
if(it_price + parseInt(price) < 0) {
|
||||
alert("구매금액이 음수인 상품은 구매할 수 없습니다.");
|
||||
mainCart.add_cart_after();
|
||||
return false;
|
||||
}
|
||||
|
||||
// 옵션 선택정보 적용
|
||||
$frm.find("input[name^=io_id]").val(id);
|
||||
$frm.find("input[name^=io_value]").val(option);
|
||||
$frm.find("input[name^=io_price]").val(price);
|
||||
|
||||
$.ajax({
|
||||
url: $(frm).attr("action"),
|
||||
type: "POST",
|
||||
data: $(frm).serialize(),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
cache: false,
|
||||
success: function(data, textStatus) {
|
||||
|
||||
mainCart.add_cart_after(frm);
|
||||
|
||||
if(data.error != "") {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
mainCart.update_cart_side();
|
||||
|
||||
alert("상품을 장바구니에 담았습니다.");
|
||||
},
|
||||
error : function(request, status, error){
|
||||
mainCart.add_cart_after(frm);
|
||||
alert('false ajax :'+request.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// 5.4 버전의 기본테마의 사이드바의 장바구니를 새로고침합니다.
|
||||
mainCart.update_cart_side = function(){
|
||||
var ajax_url = g5_shop_url || g5_shop_url;
|
||||
|
||||
$.ajax({
|
||||
url: ajax_url + "/ajax.action.php",
|
||||
type: "GET",
|
||||
data: {"action":"refresh_cart"},
|
||||
dataType: "html",
|
||||
async: true,
|
||||
cache: false,
|
||||
success: function(data, textStatus) {
|
||||
var inner_html = $(data).filter(".sbsk").html(),
|
||||
cart_count = $(data).find(".cart-count").text();
|
||||
|
||||
$(".qk_con_wr .sbsk").html(inner_html);
|
||||
$(".hd_login .shop_cart .count").text(cart_count);
|
||||
},
|
||||
error : function(request, status, error){
|
||||
alert("false ajax :"+request.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
mainCart.update_wish_side = function(){
|
||||
var ajax_url = g5_shop_url || g5_shop_url;
|
||||
|
||||
if (typeof g5_is_member == "undefined" || ! g5_is_member) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: ajax_url + "/ajax.action.php",
|
||||
type: "GET",
|
||||
data: {"action":"refresh_wish"},
|
||||
dataType: "html",
|
||||
async: true,
|
||||
cache: false,
|
||||
success: function(data, textStatus) {
|
||||
var inner_html = $(data).filter(".side-wish").html();
|
||||
|
||||
$(".qk_con_wr .side-wish").html(inner_html);
|
||||
},
|
||||
error : function(request, status, error){
|
||||
alert("false ajax :"+request.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
mainCart.add_cart_after = function(frm){
|
||||
var $over_rayers = $("."+overclass),
|
||||
$cart_rayers = $("."+cartclass);
|
||||
|
||||
$over_rayers.each(function(i) {
|
||||
$(this).removeClass(overclass);
|
||||
});
|
||||
|
||||
$cart_rayers.each(function(i) {
|
||||
if( !(frm && $(this).find("select").length) ){
|
||||
$(this).html("").removeClass(cartclass);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on("click", ".btn_cart", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $this = $(this),
|
||||
it_id = $this.data("it_id"),
|
||||
$sct_li = $this.closest("li.sct_li"),
|
||||
$opt = $sct_li.find(".cart-layer"),
|
||||
$btn = $sct_li.find("."+cart_btn_class);
|
||||
|
||||
$(".cart-layer").not($opt).removeClass(cartclass).html('');
|
||||
$("li.sct_li").not($sct_li).removeClass(overclass);
|
||||
|
||||
$.ajax({
|
||||
url: g5_shop_url+"/ajax.action.php",
|
||||
type: "POST",
|
||||
data: {
|
||||
"it_id" : it_id,
|
||||
"action" : "get_item_option"
|
||||
},
|
||||
dataType: "json",
|
||||
async: true,
|
||||
cache: false,
|
||||
success: function(data, textStatus) {
|
||||
if(data.error != "") {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
$sct_li.addClass(overclass);
|
||||
$opt.addClass(cartclass).html(data.html);
|
||||
|
||||
if(!data.option) {
|
||||
mainCart.add_cart($opt.find("form").get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
//$btn.css("display","none");
|
||||
//$opt.css("display","block");
|
||||
},
|
||||
error : function(request, status, error){
|
||||
alert('false ajax :'+request.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on("change", "select.it_option", function() {
|
||||
var $frm = $(this).closest("form");
|
||||
var $sel = $frm.find("select.it_option");
|
||||
var sel_count = $sel.size();
|
||||
var idx = $sel.index($(this));
|
||||
var val = $(this).val();
|
||||
var it_id = $frm.find("input[name='it_id[]']").val();
|
||||
|
||||
// 선택값이 없을 경우 하위 옵션은 disabled
|
||||
if(val == "") {
|
||||
$frm.find("select.it_option:gt("+idx+")").val("").attr("disabled", true);
|
||||
return;
|
||||
}
|
||||
|
||||
// 하위선택옵션로드
|
||||
if(sel_count > 1 && (idx + 1) < sel_count) {
|
||||
var opt_id = "";
|
||||
|
||||
// 상위 옵션의 값을 읽어 옵션id 만듬
|
||||
if(idx > 0) {
|
||||
$frm.find("select.it_option:lt("+idx+")").each(function() {
|
||||
if(!opt_id)
|
||||
opt_id = $(this).val();
|
||||
else
|
||||
opt_id += mainCart.chr(30)+$(this).val();
|
||||
});
|
||||
|
||||
opt_id += mainCart.chr(30)+val;
|
||||
} else if(idx == 0) {
|
||||
opt_id = val;
|
||||
}
|
||||
|
||||
$.post(
|
||||
g5_shop_url + "/itemoption.php",
|
||||
{ it_id: it_id, opt_id: opt_id, idx: idx, sel_count: sel_count },
|
||||
function(data) {
|
||||
$sel.eq(idx+1).empty().html(data).attr("disabled", false);
|
||||
|
||||
// select의 옵션이 변경됐을 경우 하위 옵션 disabled
|
||||
if(idx+1 < sel_count) {
|
||||
var idx2 = idx + 1;
|
||||
$frm.find("select.it_option:gt("+idx2+")").val("").attr("disabled", true);
|
||||
}
|
||||
}
|
||||
);
|
||||
} else if((idx + 1) == sel_count) { // 선택옵션처리
|
||||
if(val == "")
|
||||
return;
|
||||
|
||||
var info = val.split(",");
|
||||
// 재고체크
|
||||
if(parseInt(info[2]) < 1) {
|
||||
alert("선택하신 선택옵션상품은 재고가 부족하여 구매할 수 없습니다.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", ".cartopt_cart_btn", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
mainCart.add_cart(this.form);
|
||||
});
|
||||
|
||||
$(document).on("click", ".cartopt_close_btn", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
mainCart.add_cart_after();
|
||||
|
||||
//$(this).closest(".sct_cartop").css("display","none");
|
||||
//$(this).closest("li.sct_li").find(".sct_btn").css("display", "");
|
||||
});
|
||||
|
||||
$(document).on("click", ".btn_wish", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
mainCart.add_wishitem(this);
|
||||
});
|
||||
});
|
||||
@ -59,15 +59,17 @@ $.fn.listType = function(type)
|
||||
list_left_pad = img_width + 20;
|
||||
list_width = list_real_width - list_right_pad - list_left_pad;
|
||||
list_height = img_height +2;
|
||||
|
||||
$(this).css({
|
||||
paddingTop : list_top_pad+"px",
|
||||
paddingRight: list_right_pad+"px",
|
||||
paddingBottom: list_bottom_pad+"px",
|
||||
paddingLeft: list_left_pad+"px",
|
||||
//width: list_width+"px",
|
||||
height: list_height+"px"
|
||||
});
|
||||
|
||||
if( $(this).attr("data-css") !== "nocss" ){
|
||||
$(this).css({
|
||||
paddingTop : list_top_pad+"px",
|
||||
paddingRight: list_right_pad+"px",
|
||||
paddingBottom: list_bottom_pad+"px",
|
||||
paddingLeft: list_left_pad+"px",
|
||||
//width: list_width+"px",
|
||||
height: list_height+"px"
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("button.sct_lst_list span").addClass("sct_lst_on").html("<b class=\"sound_only\"> 선택됨</b>");
|
||||
|
||||
@ -117,6 +117,8 @@ jQuery(function($){
|
||||
|
||||
price_calculate();
|
||||
|
||||
$("#sit_sel_option").trigger("add_sit_sel_option", [opt]);
|
||||
|
||||
} else {
|
||||
|
||||
cached_function.apply(this, arguments); // use .apply() to call it
|
||||
@ -158,7 +160,8 @@ jQuery(function($){
|
||||
});
|
||||
|
||||
$("#sit_tot_price").empty().html("<span>총 금액 </span><strong>"+number_format(String(total))+"</strong> 원");
|
||||
|
||||
|
||||
$("#sit_tot_price").trigger("price_calculate", [total]);
|
||||
} else {
|
||||
cached_function.apply(this, arguments); // use .apply() to call it
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user