<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="lap" th:with="imgGoodsUrl=${@environment.getProperty('upload.goods.view')}, uxImgUrl=${@environment.getProperty('domain.uximage')}, imgUrl=${@environment.getProperty('upload.image.view')}">
	<div class="popup_close">카테고리닫기</div>
	<div class="popup_head">
		<h2>배송비 SAVE 상품</h2>
	</div>
	<div class="popup_con">
		<div class="part_goods">
			<ul>
				<li th:each="goods, status : ${goodsList}">
					<div class="goods_detail">
						<div class="thumb_box">
							<a th:href="|javascript:fnGoToGoodsDetail('${goods.goodsCd}')|">
								<img th:src="${imgGoodsUrl} + '/' + ${goods.sysImgNm} + '?RS=150'" src="/" width="100%" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/images/pc/thumb/bg_item_none.png'}+'\';'"  th:alt="${goods.sysImgNm}" alt="">
							</a>
						</div>
						<div class="info_box">
							<div class="od_name">
								<div class="brand">
									<span th:text="${goods.brandNm}"></span>
								</div>
								<div class="name"><a th:href="|javascript:fnGoToGoodsDetail('${goods.goodsCd}')|" th:text="${goods.goodsNm}"></a></div>
							</div>
							<div class="od_calc">
								<p class="price">
									<span class="selling_price"><em th:text="${#numbers.formatInteger(goods.currPrice, 1, 'COMMA')}"></em>원</span>
									<th:block th:if="${goods.listPrice != goods.currPrice}">
										<span class="sale_price"><del><em th:text="${#numbers.formatInteger(goods.listPrice, 1, 'COMMA')}"></em>원</del></span>
										<span class="sale_percent" th:text="${#numbers.formatInteger(goods.dcRate, 0, 'COMMA') + '%'}"></span>
									</th:block>
								</p>
							</div>
							<div class="od_shoppingbag">
								<button type="button" class="btn btn_primary_line" th:onclick="fnAddCartDelvFeeSaveGoods([[${goods.goodsCd}]], [[${goods.optCd}]])"><span>쇼핑백 담기</span></button>
							</div>
						</div>
					</div>
				</li>
			</ul>
		</div>
	</div>
</div>

<script th:inline="javascript">
	$(document).ready(function() {
		var goodsListCnt = [[${goodsList.size()}]];
		if(goodsListCnt < 1) {
			mcxDialog.alert("배송비 SAVE 상품이 없습니다.");
			$(".popup_close").trigger("click");
		} else {
			$('#dlvrSavePop').show().addClass("active");
			$("body").css({"overflow":"hidden"});
		}
	});

	function fnAddCartDelvFeeSaveGoods(goodsCd, optCd) {
		let compsList = [];
		let temp 			= new Object;
		temp.goodsCd 		= goodsCd;
		temp.optCd 			= optCd;
		temp.goodsQty 		= 1;
		temp.goodsType 		= "G056_N";
		temp.cartGb 		= "C";
		temp.popupYn		= "Y";
		compsList.push(temp);

		cfnAddCart(compsList);
	};
</script>
<!-- //다다익선 상품보기 팝업 -->
</html>