// ==UserScript== // @name Tokopedia Cetak Sekaligus Non Gold Merchant // @author Rendi Wahyudi Muliawan // @namespace http://www.tokopedia.com/celleven // @source https://github.com/rendy1287/tokopedia-cetak-sekaligus // @version 0.04 // @description Untuk mencetak label alamat pada Tokopedia bagi pengguna Non / Bukan Gold Merchant. // @license MIT License. // @icon https://ecs7.tokopedia.net/img/favicon.ico // @match https://www.tokopedia.com/myshop_order_process.pl* // @match https://tokopedia.com/myshop_order_process.pl* // @include https://www.tokopedia.com/myshop_order_process.pl* // @include https://tokopedia.com/myshop_order_process.pl* // @run-at document-end // @downloadURL none // ==/UserScript== // //***************** PENGATURAN *************************************// // // @logotoko URL logo toko jika kamu ingin cantumkan logo // isikan url image kamu, bisa upload ke image hosting // logo recommended size: 115x25 pixel // // @ekspedisi menampilkan logo ekspedisi, isikan true jika // ingin menampilkan atau false jika tidak // // @invoice menampilkan nomor invoice, isikan true jika // ingin menampilkan atau false jika tidak // // @fontsize ukuran font untuk label // //******************************************************************// const logotoko = 'https://ecs7.tokopedia.net/img/logo-tokopedia-32.png'; const ekspedisi = false; const invoice = false; const fontsize = '12px'; // Template Label bisa kamu ganti pada @require di atas // Template Label saat ini hanya tersedia 1 sampai 3 // Ubah 1.js menjadi 2.js atau 3.js dan seterusnya // Untuk mengubah template label // Untuk melihat semua template yang tersedia silakan buka // https://github.com/rendy1287/tokopedia-cetak-sekaligus/template/ //*****************************************************************// // // SCRIPT DI BAWAH INI JANGAN DIUBAH JIKA TIDAK MENGERTI // //*****************************************************************// let label = `
{{ekspedisi}}
Nomor Invoice
{{invoice}}
Administrasi
{{administrasi}}
Asuransi
{{asuransi}}
Ongkir
{{ongkir}}
Berat
{{berat}}
Kepada
{{nama_penerima}} - {{telepon_penerima}}
{{alamat_penerima}}
Dari
{{nama_pengirim}} - {{telepon_pengirim}}
{{alamat_pengirim}}
{{foreach_item}}
`; // foreach_item menggunakan template ini let item = `
{{jumlah_produk}}
{{nama_produk}}
Keterangan: {{keterangan_produk}}
`; let css = ` `; (function() { 'use strict'; var btncetak = '' + ''; $(btncetak).insertAfter('button.confirm-multiple'); $('button.t-c-s').click(function() { var html = ''; var id = ''; var labelid = []; $('input.order_checkbox').each(function () { var checked = (this.checked ? $(this).val() : ''); id += checked; if (checked != '') { labelid.push($(this).parent().parent().prop('id').replace('order-', '')); } }); if (id == '') { var message_error = tokopedia.render_message('error', tokopedia.loc('ERROR_CHOOSE_ORDER')); tokopedia.alert($(this).text(), message_error); return false; } html += 'Cetak Slip Alamat'; html += css; html += '
Cetak