2026, 새로운 도약을 시작합니다.

총금액 옆에 총수량을 넣을수 있을까요? 채택완료

3024375308_1692002220.565.jpg

블럭친것처럼 총금액이 나오는 좌측으로 총수량(총구매갯수) 갯수를 노출할려면 어떻게 해야 할까요?

선택옵션의 경우와 옵션없는 단일 상품 모두 총금액 옆에 추가로 총수량을 노출하고 싶은데 어디를 봐야할지 못찾겠네요...

답변 3개

채택된 답변
+20 포인트

이건 var $el_qty = $("input[name^=ct_qty]"); 이부분을 합산해서 보여주는 소스를 추가해야 할듯 하다

어디까지 바라는 거냐? 어디를 봐야 할지 모른다고 해서 위치를 찾아 줬으면 알아서 해라

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

추가 피해자 방지 https://sir.kr/conflictconsultation/245

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

글쓴이의 의도는 이해는 하지만 이런식의 댓글은 제가 원한 댓글이 아닙니다

댓글을 작성하려면 로그인이 필요합니다.

shop.js 최 하단함수를 수정하면 될듯합니다.

function price_calculate()
{
    var it_price = parseInt($("input#it_price").val());

    if(isNaN(it_price))
        return;

    var $el_prc = $("input.io_price");
    var $el_qty = $("input[name^=ct_qty]");
    var $el_type = $("input[name^=io_type]");
    var price, type, qty, total = 0;

    $el_prc.each(function(index) {
        price = parseInt($(this).val());
        qty = parseInt($el_qty.eq(index).val());
        type = $el_type.eq(index).val();

        if(type == "0") { // 선택옵션
            total += (it_price + price) * qty;
        } else { // 추가옵션
            total += price * qty;
        }
    });

    $("#sit_tot_price").empty().html("<span>총 금액 :</span> "+number_format(String(total))+"원");
}

또는 shop.overide.js

하단에

    if (typeof price_calculate === "function") {
        price_calculate = (function() {
            var cached_function = price_calculate;

            return function() {
                
                if( $(".2017_renewal_itemform").length ){

                    var it_price = parseInt($("input#it_price").val());

                    if(isNaN(it_price))
                        return;

                    var $el_prc = $("input.io_price");
                    var $el_qty = $("input[name^=ct_qty]");
                    var $el_type = $("input[name^=io_type]");
                    var price, type, qty, total = 0;

                    $el_prc.each(function(index) {
                        price = parseInt($(this).val());
                        qty = parseInt($el_qty.eq(index).val());
                        type = $el_type.eq(index).val();

                        if(type == "0") { // 선택옵션
                            total += (it_price + price) * qty;
                        } else { // 추가옵션
                            total += price * qty;
                        }
                    });

                    $("#sit_tot_price").empty().html("<span>총 금액 </span><strong>"+number_format(String(total))+"</strong> 원");

                } else {
                    cached_function.apply(this, arguments); // use .apply() to call it
                }
                
            };
        }());
    }   //end if check function

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

반갑습니다. 형님^^
답변은요?

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고