'); } if(jdata.items!=null){ for(var i=0;i]+>/g,""); var photostr = ''; if(nowitem['photo']!=''){ photostr = " background-image: url("+nowitem['photo']+");"; } var carkey = nowitem['carkey']; var multikey = nowitem['multikey']; var choiceamount = nowitem['choiceamount']; var uni_price_tmp = nowitem['uni_price']; var bulid_string = '
  • '+ '
    '+ ''+_txtString+''+ '
    '+ '
    '+ ''+ '
    '+nowitem['standInfo']+'
    '; bulid_string+='
    '; bulid_string+=""; var oneprice = uni_price_tmp * nowitem['amount']; bulid_string+='
    '+'
    '; bulid_string+='
    '+nowitem['price']; bulid_string+='
    '+ '
    '+nowitem['inventory_msg']+ '
    '+ '
    '+ '
    '+ '
    '+ '
  • '; $("#m_RWDBASE_PAT01_41_1 #top_shopping_car_list").append(bulid_string); if(nowitem['plusbuycars'] && nowitem['plusbuycars'].length >0){ // console.log('有加購品'+nowitem['plusbuycars'].length); for(var plusbuyidx = 0; plusbuyidx < nowitem['plusbuycars'].length;plusbuyidx++){ var plusitem = nowitem['plusbuycars'][plusbuyidx]; var plus_price = plusitem['info']['plusPrice']; var maxAmount = plusitem['maxAmount']; var plusamount = plusitem['plusamount']; var pluscarkey = plusitem['pluscarkey'];// 取代 carkey var plusbuy_key = plusitem['plusbuy_key'];// //{bulid var string_pdname = plusitem['info']['productName'].replace(/<[^>]+>/g,""); bulid_string = '
  • '+ '
    '+ ''+string_pdname+''+ '
    '+ '
    '+ '
    '+ ''+ '
    '+plusitem['info']['standName']+'
    '; bulid_string+='
    '; bulid_string+=""; var oneprice = plus_price * plusamount; bulid_string+='
    '+'
    '; bulid_string+='
    '+plusitem['price']; bulid_string+='
    '+ '
    '+nowitem['inventory_msg']+ '
    '+ '
    '+ '
    '+ '
    '+ '
  • '; $("#m_RWDBASE_PAT01_41_1 #top_shopping_car_list").append(bulid_string); //}bulid }// end for } } $('#m_RWDBASE_PAT01_41_1 .qtyminus').click(function(){ var carkey = $(this).attr('carkey'); var nnum = parseInt( $("#quantity"+carkey).val()); var max = parseInt( $("#quantity"+carkey).attr('max')); if(isNaN(nnum) || nnum <=0){ nnum = 1; }else{ nnum--; } if(nnum <=0) nnum =1; $("#quantity"+carkey).val(nnum); if(typeof($(this).attr('plusbuy_key'))=='undefined'){ modifyCarAmount( $("#quantity"+carkey).attr('attr-multikey') ,nnum,carkey,$("#quantity"+carkey)); }else{ var input_tmp = $("#quantity"+carkey); modifyPlusBuyCarAmount( $(this).attr('plusbuy_key') ,input_tmp.val(),carkey,$("#quantity"+carkey).attr('now-qty'),$("#quantity"+carkey).attr('uni-price'),$("#quantity"+carkey)); } }); $('#m_RWDBASE_PAT01_41_1 .qtyplus').click(function(){ var carkey = $(this).attr('carkey'); var nnum = parseInt( $("#quantity"+carkey).val()); var max = parseInt( $("#quantity"+carkey).attr('max')); if(isNaN(nnum) || nnum <=0){ nnum = 1; }else{ nnum++; } if(nnum > max) nnum = max; //if(nnum <=0) nnum =1; $("#quantity"+carkey).val(nnum); if(typeof($(this).attr('plusbuy_key'))=='undefined'){ modifyCarAmount($("#quantity"+carkey).attr('attr-multikey'),nnum,carkey,$("#quantity"+carkey)); }else{ var input_tmp = $("#quantity"+carkey); modifyPlusBuyCarAmount( $(this).attr('plusbuy_key') ,input_tmp.val(),carkey,$("#quantity"+carkey).attr('now-qty'),$("#quantity"+carkey).attr('uni-price'),$("#quantity"+carkey)); } }); $("#m_RWDBASE_PAT01_41_1 #top_shopping_car_list .qty").on('change', function() { if(typeof($(this).attr('plusbuy_key'))=='undefined'){ modifyCarAmount( $(this).attr('attr-multikey') ,$(this).val(),$(this).attr('carkey'),$(this)); }else{ var carkey = $(this).attr('carkey'); modifyPlusBuyCarAmount( $(this).attr('plusbuy_key') , $(this).val(), carkey, $(this).attr('now-qty'), $(this).attr('uni-price'), $(this) ); } }); var m_RWDBASE_PAT01_41_1_delxhr = null; $("#m_RWDBASE_PAT01_41_1 .item_del").click(function(){ if(m_RWDBASE_PAT01_41_1_delxhr!=null) return false; var carkey = $(this).attr('carkey'); if(typeof($(this).attr('plusbuy_key'))=='undefined'){ var dataparams = "type=delcar&lang=en&carkey="+carkey; }else{ var plusbuy_key = $(this).attr('plusbuy_key'); var dataparams = "type=delplusbuycar&lang=en&multikey="+plusbuy_key; } m_RWDBASE_PAT01_41_1_delxhr = $.ajax({ type: "POST", url: "https://www.makerhart.com/include/shopping_process.php", contentType:"application/x-www-form-urlencoded; charset=utf-8", data: dataparams, dataType: "json", success: function(jdata){ m_RWDBASE_PAT01_41_1_delxhr = null; if(jdata.success=='0'){ alert(jdata.message); }else{ $("#car_"+carkey).fadeOut(function(){ $("#car_"+carkey).remove(); $("#m_RWDBASE_PAT01_41_1 .val-shopnum").html($(".caritem").size()); }); alert("Selected merchandise already deleted"); } loadShoppingCar(true, 'refresh'); } }); }); } // 如果電商後台有設定加入購物車後要跳彈窗提示 if( _action!='refresh' && false){ open = false; Swal.fire({ icon: 'success', title: 'Product added to shopping cart', showConfirmButton: false, timer: 1500 }) } if(open){ open_car_list(); } } }); } function modifyPlusBuyCarAmount(multikey,amount,carkey,pre_amount,uni_price,obj){ var nnum = parseInt( obj.val()); var max = parseInt( obj.attr('max')); if(isNaN(nnum) || nnum <=0){ nnum = 1; } if(nnum > max) nnum = max; if(obj.val()!=nnum){ obj.val(nnum); } amount = nnum; // console.log('=>'+amount); if(pre_amount==amount) return false; $.ajax({ type: "POST", url: "https://www.makerhart.com/include/shopping_process.php", contentType:"application/x-www-form-urlencoded; charset=utf-8", data: "type=modifyonepluspuy&lang=en&plusbuymultikey="+multikey+'&amount='+amount, dataType: "json", success: function(jdata){ if(jdata.message!='' && jdata.message!= null){ $("#quantity"+carkey).val(pre_amount); alert(jdata.message); }else{ if(amount==0){ $("#car_"+carkey).fadeOut(function(){ $("#car_"+carkey).remove(); $("#m_RWDBASE_PAT01_41_1 .val-shopnum").html($(".caritem").size()); }); }else{ $("#quantity"+carkey).val(jdata.amount); $("#quantity"+carkey).attr("now-qty",jdata.amount); $("#car_"+carkey+' .price').html(jdata.price); } } needreloadcar = true; } }); }

    Maker hart Industry Corp.

    TEL:886-3-211-5268
    FAX:886-3-396-0153
    ADD:2F.,No.3,Ln.263,ChongYang Rd.,Nangang Dist.,Taipei City 11573,Taiwan
    ADD:No.32.Keji 1st Rd.,Guishan Township,Taoyuan County 33383 Taiwan

    FBIGTWITTER
    Copyright © webtech. All Rights Reserved.