관리-도구
편집 파일: kkart-product-import.min.js
!function(t,r){var i=function(t){this.$form=t,this.xhr=!1,this.mapping=kkart_product_import_params.mapping,this.position=0,this.file=kkart_product_import_params.file,this.update_existing=kkart_product_import_params.update_existing,this.delimiter=kkart_product_import_params.delimiter,this.security=kkart_product_import_params.import_nonce,this.imported=0,this.failed=0,this.updated=0,this.skipped=0,this.$form.find(".kkart-importer-progress").val(0),this.run_import=this.run_import.bind(this),this.run_import()};i.prototype.run_import=function(){var p=this;t.ajax({type:"POST",url:ajaxurl,data:{action:"kkart_do_ajax_product_import",position:p.position,mapping:p.mapping,file:p.file,update_existing:p.update_existing,delimiter:p.delimiter,security:p.security},dataType:"json",success:function(t){var i;t.success&&(p.position=t.data.position,p.imported+=t.data.imported,p.failed+=t.data.failed,p.updated+=t.data.updated,p.skipped+=t.data.skipped,p.$form.find(".kkart-importer-progress").val(t.data.percentage),"done"===t.data.position?(i=kkart_product_import_params.file.split("/").pop(),r.location=t.data.url+"&products-imported="+parseInt(p.imported,10)+"&products-failed="+parseInt(p.failed,10)+"&products-updated="+parseInt(p.updated,10)+"&products-skipped="+parseInt(p.skipped,10)+"&file-name="+i):p.run_import())}}).fail(function(t){r.console.log(t)})},t.fn.kkart_product_importer=function(){return new i(this),this},t(".kkart-importer").kkart_product_importer()}(jQuery,window);