Usunięcie zbędnych plików .DS_Store oraz dodanie skryptu do automatycznego wyboru opcji płatności

This commit is contained in:
2025-10-15 12:57:44 +02:00
parent 9de1ac9d1f
commit 95b6ff255c
31 changed files with 251 additions and 8 deletions

View File

@@ -67,14 +67,153 @@
"lmtime": 0,
"modified": false
},
"classes": {},
"classes": {
"controller": {
"AdminController.php": {
"type": "-",
"size": 198215,
"lmtime": 0,
"modified": false
},
"Controller.php": {
"type": "-",
"size": 22505,
"lmtime": 0,
"modified": false
},
"FrontController.php": {
"type": "-",
"size": 74586,
"lmtime": 0,
"modified": false
},
"index.php": {
"type": "-",
"size": 1375,
"lmtime": 0,
"modified": false
},
"ModuleAdminController.php": {
"type": "-",
"size": 2886,
"lmtime": 0,
"modified": false
},
"ModuleFrontController.php": {
"type": "-",
"size": 3779,
"lmtime": 0,
"modified": false
},
"ProductListingFrontController.php": {
"type": "-",
"size": 21788,
"lmtime": 1754599660788,
"modified": false
},
"ProductPresentingFrontController.php": {
"type": "-",
"size": 1529,
"lmtime": 0,
"modified": false
}
}
},
"composer.lock": {
"type": "-",
"size": 429111,
"lmtime": 0,
"modified": false
},
"config": {},
"config": {
"alias.php": {
"type": "-",
"size": 2121,
"lmtime": 0,
"modified": false
},
"autoload.php": {
"type": "-",
"size": 1372,
"lmtime": 0,
"modified": false
},
"bootstrap.php": {
"type": "-",
"size": 6171,
"lmtime": 0,
"modified": false
},
"config.inc.php": {
"type": "-",
"size": 12008,
"lmtime": 0,
"modified": false
},
"db_slave_server.inc.php": {
"type": "-",
"size": 1371,
"lmtime": 0,
"modified": false
},
"defines.inc.php": {
"type": "-",
"size": 8124,
"lmtime": 1754598461356,
"modified": false
},
"defines_uri.inc.php": {
"type": "-",
"size": 3313,
"lmtime": 0,
"modified": false
},
".htaccess": {
"type": "-",
"size": 180,
"lmtime": 0,
"modified": false
},
"index.php": {
"type": "-",
"size": 1404,
"lmtime": 0,
"modified": false
},
"services": {},
"settings.inc.php": {
"type": "-",
"size": 24,
"lmtime": 0,
"modified": false
},
"smartyadmin.config.inc.php": {
"type": "-",
"size": 6085,
"lmtime": 0,
"modified": false
},
"smarty.config.inc.php": {
"type": "-",
"size": 6751,
"lmtime": 0,
"modified": false
},
"smartyfront.config.inc.php": {
"type": "-",
"size": 9140,
"lmtime": 0,
"modified": false
},
"smartyfront.config.inc.php.before_pagecache_widget_block": {
"type": "-",
"size": 8755,
"lmtime": 0,
"modified": false
},
"themes": {},
"xml": {}
},
"controllers": {},
"cron-estella.php": {
"type": "-",
@@ -116,21 +255,21 @@
},
"google-merchant_id-1.xml": {
"type": "-",
"size": 62307727,
"size": 62336674,
"lmtime": 0,
"modified": true
},
"google-merchant_id-2.xml": {
"type": "-",
"size": 2722428,
"size": 2705675,
"lmtime": 0,
"modified": true
},
".htaccess": {
"type": "-",
"size": 12165,
"lmtime": 0,
"modified": true
"size": 15363,
"lmtime": 1754603412258,
"modified": false
},
".htaccess.2025-05-22-1747946142": {
"type": "-",
@@ -156,6 +295,18 @@
"lmtime": 0,
"modified": false
},
".htaccess.2025-08-11-1754894433": {
"type": "-",
"size": 15363,
"lmtime": 0,
"modified": false
},
".htaccess.2025-08-11-1754915017": {
"type": "-",
"size": 15364,
"lmtime": 0,
"modified": false
},
"iadmin": {},
"image_log.json": {
"type": "-",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -1053,4 +1053,96 @@ $(document).ready(function () {
localStorage.removeItem('selectedSize')
}
})
});
(() => {
// Ustaw na true, jeśli Twój motyw/moduł wymaga faktycznego submitu "Wybierz"
const FORCE_SUBMIT_TO_SELECT = false;
const isVisible = (el) => {
if (!el) return false;
const s = getComputedStyle(el);
if (s.display === 'none' || s.visibility === 'hidden') return false;
const r = el.getBoundingClientRect();
return !!(r.width || r.height || el.getClientRects().length);
};
const getContainer = () =>
document.querySelector('#checkout-payment-step .payment-options, .payment-options');
const getRows = () => {
const c = getContainer();
if (!c) return [];
return [...c.querySelectorAll('.payment-option')].filter(isVisible);
};
const fireAll = (el) => {
// Maksymalnie „głośno”: click + input + change (bubbles)
el.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }));
el.dispatchEvent(new Event('input', { bubbles: true }));
el.dispatchEvent(new Event('change', { bubbles: true }));
};
const pickRow = (row) => {
if (!row) return false;
const radio = row.querySelector('input[name="payment-option"][type="radio"]');
if (!radio) return false;
// 1) „Fizyczny” klik w radio
radio.focus();
radio.click(); // często wystarcza
radio.checked = true; // twardo ustaw
fireAll(radio); // wyślij eventy
// 2) Dopnij .active, jeśli motyw nie zrobił tego sam
row.classList.add('active');
// 3) (opcjonalnie) wyślij ukryty "Wybierz"
if (FORCE_SUBMIT_TO_SELECT) {
const btn = row.querySelector('button[name="select_payment_option"]');
if (btn && isVisible(btn) || btn) {
btn.click(); // UWAGA: może przeładować sekcję / stronę wg motywu
}
}
return true;
};
const run = () => {
const rows = getRows();
if (!rows.length) return;
// Jeśli jest tylko jedna wybierz ją
if (rows.length === 1) {
pickRow(rows[0]);
return;
}
// Jeśli jakaś ma już .active dopilnuj, że radio naprawdę zaznaczone
const active = rows.find(r => r.classList.contains('active')) || null;
if (active) {
const radio = active.querySelector('input[name="payment-option"][type="radio"]');
if (radio && !radio.checked) pickRow(active);
}
};
// start + kilka retry (czasem bindingi dochodzą z opóźnieniem)
run();
setTimeout(run, 80);
setTimeout(run, 200);
setTimeout(run, 450);
// Obserwator przebudów sekcji płatności
const target = document.querySelector('#checkout-payment-step') || document.body;
let t;
const obs = new MutationObserver((muts) => {
if (muts.some(m =>
m.target?.closest?.('#checkout-payment-step') ||
[...m.addedNodes].some(n => n.nodeType === 1 && (n.id === 'checkout-payment-step' || n.querySelector?.('.payment-options')))
)) {
clearTimeout(t);
t = setTimeout(run, 60);
}
});
obs.observe(target, { childList: true, subtree: true, attributes: true, attributeFilter: ['class','style'] });
})();