PageSourceSearch

https://friendskazan.ru/assets/checkout_offline_success-ThQQSCq.js

js friendskazan.ru collected 2026-10-07 18:06:30 UTC 1,637 bytes, 45 lines download raw bytes

1/**
2 * Cash / card-on-delivery success: show the real order on #fix-result.
3 * Does not navigate and does not touch the online-payment return path.
4 */
5export function openOfflineSuccess(doc, { order, typeform, finalsum, promoCode, promoDiscount }) {
6    doc.getElementById('checkout')?.classList.remove('active');
7    doc.getElementById('cart')?.classList.remove('active');
8    const result = doc.getElementById('fix-result');
9    result?.classList.add('active');
10    doc.querySelector('.fix-bg')?.classList.add('active');
11
12    const title = result?.querySelector('.checkout__title');
13    if (title) {
14        title.textContent = 'Заказ № ' + (order?.orderid ?? '');
15    }
16
17    const summ = doc.getElementById(`${typeform}-summ`);
18    if (summ) {
19        summ.textContent = String(finalsum ?? '');
20    }
21
22    fillPromoResultFields(doc, typeform, {
23        code: promoCode || order?.promocode_code || '',
24        discount: promoDiscount ?? order?.promocode_discount ?? 0,
25    });
26}
27
28/**
29 * Fill success-screen promocode rows (code + discount amount).
30 */
31export function fillPromoResultFields(doc, typeform, { code, discount } = {}) {
32    const promo = doc.getElementById(`${typeform}-promocode-applied`);
33    const promoDisc = doc.getElementById(`${typeform}-promocode-discount`);
34    const codeText = String(code || '').trim();
35    const amount = Math.max(0, Math.round(Number(discount) || 0));
36
37    if (promo) {
38        promo.textContent = codeText || '—';
39    }
40    if (promoDisc) {
41        promoDisc.textContent = codeText && amount > 0
42            ? `−${amount.toLocaleString('ru-RU')} ₽`
43            : '—';
44    }
45}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.