Goodyear Pop up.jpg (102 KB)
Toplam 1 ürün görüntüleniyor.
0, "transaction_count": MEMBER_INFO.TRANSACTION_COUNT, "name": MEMBER_INFO.FIRST_NAME, "surname": MEMBER_INFO.LAST_NAME, "email": MEMBER_INFO.MAIL, "language": insider_language, }; if (MEMBER_INFO.ID != 0) { user['uuid'] = MEMBER_INFO.ID.toString(); user['gender'] = MEMBER_INFO.GENDER == "E" ? "M" : "F"; if(typeof MEMBER_INFO.MEMBER_COUNTRY !=='undefined'){ user['country'] = MEMBER_INFO.MEMBER_COUNTRY.toUpperCase() } if (INSIDER_APP.no_password_hash == 1) { user['phone_number'] = MEMBER_INFO.PHONE } else { user['phone_number'] = MEMBER_INFO.PHONE_HASH_SHA } } if (typeof MEMBER_INFO.MAIL_PERMISSION != 'undefined') { user['gdpr_optin'] = true; user['email_optin'] = MEMBER_INFO.MAIL_PERMISSION; if (INSIDER_APP.contact_id.trim() != '') { user['list_id'] = parseInt(INSIDER_APP.contact_id) || []; } } user['sms_optin'] = false if('SMS_PERMISSION' in MEMBER_INFO){ user['sms_optin'] = MEMBER_INFO.SMS_PERMISSION } return user; }, getProduct: function (index) { if (typeof PRODUCT_DATA[index].category_path !== 'undefined') { var categories = PRODUCT_DATA[index].category_path.split(' > '); } else { var categories = []; } categories = categories.filter(function (item) { if (item !== null && item !== '') { return item; } }); categories.push(PRODUCT_DATA[index].category); return { "id": INSIDER_APP.sku_type === 'code' ? PRODUCT_DATA[index].code : PRODUCT_DATA[index].id, "name": PRODUCT_DATA[index].name, "taxonomy": categories, "currency": window.CURRENCY === 'TL' ? 'TRY' : window.CURRENCY, "unit_price": PRODUCT_DATA[index].total_base_price, "unit_sale_price": PRODUCT_DATA[index].total_sale_price, "url": window.location.protocol + '//' + window.location.hostname + '/' + PRODUCT_DATA[index].url, "stock": PRODUCT_DATA[index].quantity, "product_image_url": PRODUCT_DATA[index].image } }, getListing: function () { var items = []; var length = PRODUCT_DATA.length > 15 ? 15 : PRODUCT_DATA.length; for (var i = 0; i < length; i++) { items.push(this.getProduct(i)); } return { 'items': items, }; }, getVatIncluded: function (price, vat) { price = parseFloat(price); var r = price * (1 + vat / 100); return parseFloat(r.toFixed(2)); }, getBasket: function () { $.ajax({ url: '/srv/service/cart/load', dataType: 'json', async: false, success: function (data) { if (data.PRODUCTS.length <= 0) { window.insider_object['basket'] = {}; return false; } var productArr = []; for (var i = 0; i < data.PRODUCTS.length; i++) { var taxonomy = data.PRODUCTS[i].CATEGORY_PATH.split(' > '); taxonomy = taxonomy.filter(function (item) { if (item !== null && item !== '') { return item; } }); taxonomy.push(data.PRODUCTS[i].CATEGORY_NAME); productArr[i] = { "product": { "id": INSIDER_APP.sku_type === 'code' ? data.PRODUCTS[i].PRODUCT_CODE : data.PRODUCTS[i].ID, "name": data.PRODUCTS[i].TITLE, "taxonomy": taxonomy, "currency": data.PRODUCTS[i].TARGET_CURRENCY === 'TL' ? 'TRY' : data.PRODUCTS[i].TARGET_CURRENCY, "unit_price": INSIDER_APP.getVatIncluded(data.PRODUCTS[i].PRICE_NOT_DISCOUNTED, data.PRODUCTS[i].VAT), "unit_sale_price": INSIDER_APP.getVatIncluded(data.PRODUCTS[i].PRICE_SELL, data.PRODUCTS[i].VAT), "url": window.location.protocol + '//' + window.location.hostname + '/' + data.PRODUCTS[i].URL, "stock": parseInt(data.PRODUCTS[i].STOCK), "product_image_url": data.PRODUCTS[i].IMAGE.MEDIUM }, "quantity": data.PRODUCTS[i].COUNT, "subtotal": parseFloat(data.PRODUCTS[i].PRICE_TOTAL.toFixed(2)) }; } window.insider_object['basket'] = { "currency": (data.TARGET_CURRENCY === 'TL' ? 'TRY' : data.TARGET_CURRENCY), "total": parseFloat(data.PRICE_GENERAL.toFixed(2)), "line_items": productArr, "vouchers": [data.COUPON_CODE], "shipping_cost": parseFloat(data.PRICE_CARGO) }; } }); }, getTransaction: function () { var line_items = []; for (var i = 0; i < approveOrderData.products.length; i++) { var taxonomy = approveOrderData.products[i].category_path.split(' > '); taxonomy = taxonomy.filter(function (item) { if (item !== null && item !== '') { return item; } }); taxonomy.push(approveOrderData.products[i].category_name); line_items[i] = { "product": { "id": INSIDER_APP.sku_type === 'code' ? approveOrderData.products[i].code : approveOrderData.products[i].identifier, "name": approveOrderData.products[i].name, "currency": approveOrderData.currency == 'TL' ? 'TRY' : approveOrderData.currency, "unit_price": parseFloat(approveOrderData.products[i].total_base_amount.toFixed(2)), "unit_sale_price": parseFloat(approveOrderData.products[i].total_amount.toFixed(2)), "product_image_url": window.location.protocol + '//' + window.location.hostname + '/Data/O/' + approveOrderData.products[i].image, "taxonomy": taxonomy, "url": window.location.protocol + '//' + window.location.hostname + '/' + approveOrderData.products[i].url, }, "quantity": parseFloat(approveOrderData.products[i].quantity), "subtotal": parseFloat((approveOrderData.products[i].quantity * approveOrderData.products[i].total_base_amount).toFixed(2)) } } return { "order_id": approveOrderData.transaction, "currency": approveOrderData.currency == 'TL' ? 'TRY' : approveOrderData.currency, "total": parseFloat(approveOrderData.amount.toFixed(2)), "payment_type": approveOrderData.payment_name, "vouchers": [approveOrderData.coupon], "shipping_cost": approveOrderData.cargo_price, "delivery": { "country": approveOrderData.country == 'Türkiye' ? "TR" : approveOrderData.country, "city": approveOrderData.city, "district": approveOrderData.province }, "line_items": line_items } } }; document.addEventListener('DOMContentLoaded', function (e) { window.insider_object = { 'page': { 'type': INSIDER_APP.getPage() }, 'user': INSIDER_APP.getUser(), }; switch (PAGE_TYPE) { case 'product': window.insider_object['product'] = INSIDER_APP.getProduct(0); break; case 'category': window.insider_object['listing'] = INSIDER_APP.getListing(); break; case 'approve': window.insider_object['transaction'] = INSIDER_APP.getTransaction(); break; } if (PAGE_TYPE !== 'approve') { INSIDER_APP.getBasket(); } }); Cart.callback.add.push(function () { INSIDER_APP.getBasket(); }); Cart.callback.delete = function () { INSIDER_APP.getBasket(); }; Cart.callback.update = function () { INSIDER_APP.getBasket(); }; if (PAGE_TYPE === 'approve') { window.insider_object = { 'page': { 'type': INSIDER_APP.getPage() }, 'user': INSIDER_APP.getUser(), }; window.insider_object['transaction'] = INSIDER_APP.getTransaction(); }
T-Soft E-Ticaret Sistemleriyle Hazırlanmıştır.