Merge branch 'main' of http://91.189.216.43:3000/jacek.pyziak/wyczarujprezent.pl
This commit is contained in:
6993
.vscode/ftp-kr.sync.cache.json
vendored
6993
.vscode/ftp-kr.sync.cache.json
vendored
File diff suppressed because it is too large
Load Diff
@@ -46,4 +46,39 @@ class CategoryController extends CategoryControllerCore
|
|||||||
public function getTemplateVarSubCategoriesPublic() {
|
public function getTemplateVarSubCategoriesPublic() {
|
||||||
return $this->getTemplateVarSubCategories();
|
return $this->getTemplateVarSubCategories();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Override na tytuł kategorii z podstronami
|
||||||
|
* date: 21.07.2025
|
||||||
|
* author: Tomasz Załucki <info@innhouse.pl>
|
||||||
|
*/
|
||||||
|
public function getTemplateVarPage()
|
||||||
|
{
|
||||||
|
$page = parent::getTemplateVarPage();
|
||||||
|
if (Validate::isLoadedObject($this->category) && $this->category->active) {
|
||||||
|
|
||||||
|
// Pobierz oryginalny tytuł kategorii i ustaw go jako meta title
|
||||||
|
// Domyślnie tytuł pobierany jest z presentera i pokazuje w nawiasie numer podstrony
|
||||||
|
$categoryTitle = $this->category->name;
|
||||||
|
$shopName = Configuration::get('PS_SHOP_NAME');
|
||||||
|
$currentPage = (int) Tools::getValue('page', 1);
|
||||||
|
$newMetaTitle = $categoryTitle . ' - ' . trim($shopName);
|
||||||
|
|
||||||
|
|
||||||
|
if ($currentPage > 1) {
|
||||||
|
$newMetaTitle .= ' - Strona ' . $currentPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
$page['meta']['title'] = $newMetaTitle;
|
||||||
|
|
||||||
|
$metaTitle = trim($this->category->meta_title);
|
||||||
|
if ($metaTitle !== '') {
|
||||||
|
$page['meta']['seo_title'] = $metaTitle;
|
||||||
|
} else {
|
||||||
|
$page['meta']['seo_title'] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $page;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -427,3 +427,7 @@ body#product {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-control.alert {
|
||||||
|
border: 1px solid #cc0000 !important;
|
||||||
|
}
|
||||||
57
themes/charme/assets/js/custom_js.js
Normal file
57
themes/charme/assets/js/custom_js.js
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
const phoneInput = document.querySelector('input[name="phone"]');
|
||||||
|
const confirmBtn = document.getElementById('confirm_order');
|
||||||
|
if (!phoneInput || !confirmBtn) return;
|
||||||
|
|
||||||
|
const STATE = { internalChange: false, activated: false };
|
||||||
|
|
||||||
|
function normalizePhone(val) {
|
||||||
|
let v = (val || '').replace(/\D+/g, '');
|
||||||
|
if (v.length > 9) v = v.slice(0, 9);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValidPhone() {
|
||||||
|
return normalizePhone(phoneInput.value).length === 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setBtnDisabled(disabled) {
|
||||||
|
if (confirmBtn.disabled !== disabled) {
|
||||||
|
STATE.internalChange = true; // znacznik: to nasza zmiana
|
||||||
|
confirmBtn.disabled = disabled;
|
||||||
|
STATE.internalChange = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyPhoneValidation() {
|
||||||
|
const normalized = normalizePhone(phoneInput.value);
|
||||||
|
if (phoneInput.value !== normalized) phoneInput.value = normalized;
|
||||||
|
|
||||||
|
if (isValidPhone()) {
|
||||||
|
phoneInput.classList.remove('alert');
|
||||||
|
setBtnDisabled(false);
|
||||||
|
} else {
|
||||||
|
phoneInput.classList.add('alert');
|
||||||
|
setBtnDisabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Aktywacja dopiero przy pierwszym focusie
|
||||||
|
phoneInput.addEventListener('focus', function onFirstFocus() {
|
||||||
|
if (STATE.activated) return;
|
||||||
|
STATE.activated = true;
|
||||||
|
|
||||||
|
phoneInput.addEventListener('input', applyPhoneValidation, { passive: true });
|
||||||
|
// pierwsze sprawdzenie – bez emitowania zdarzeń, by nie triggerować cudzych handlerów
|
||||||
|
applyPhoneValidation();
|
||||||
|
|
||||||
|
// Pilnowanie przycisku, gdy inny skrypt zmieni jego stan
|
||||||
|
const observer = new MutationObserver(function (mutations) {
|
||||||
|
if (STATE.internalChange) return; // ignoruj nasze własne zmiany
|
||||||
|
// Tylko jeśli numer niepoprawny – wymuś blokadę
|
||||||
|
if (!isValidPhone()) setBtnDisabled(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(confirmBtn, { attributes: true, attributeFilter: ['disabled'] });
|
||||||
|
}, { once: true });
|
||||||
|
});
|
||||||
@@ -66,3 +66,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script type="text/javascript" src="https://wyczarujprezent.pl/themes/charme/assets/js/custom_js.js?ver=1.003"></script>
|
||||||
@@ -29,7 +29,11 @@
|
|||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
{/block}
|
{/block}
|
||||||
{block name='head_seo'}
|
{block name='head_seo'}
|
||||||
<title>{block name='head_seo_title'}{$page.meta.title}{/block}</title>
|
<title>
|
||||||
|
{block name='head_seo_title'}
|
||||||
|
{if isset($page.meta.seo_title) && $page.meta.seo_title|trim != ''}{$page.meta.seo_title}{else}{$page.meta.title}{/if}
|
||||||
|
{/block}
|
||||||
|
</title>
|
||||||
{hook h="displayAfterTitleTag"}
|
{hook h="displayAfterTitleTag"}
|
||||||
<meta name="description" content="{block name='head_seo_description'}{$page.meta.description}{/block}">
|
<meta name="description" content="{block name='head_seo_description'}{$page.meta.description}{/block}">
|
||||||
<meta name="keywords" content="{block name='head_seo_keywords'}{$page.meta.keywords}{/block}">
|
<meta name="keywords" content="{block name='head_seo_keywords'}{$page.meta.keywords}{/block}">
|
||||||
@@ -53,8 +57,7 @@
|
|||||||
{block name='stylesheets'}
|
{block name='stylesheets'}
|
||||||
{include file="_partials/stylesheets.tpl" stylesheets=$stylesheets}
|
{include file="_partials/stylesheets.tpl" stylesheets=$stylesheets}
|
||||||
{/block}
|
{/block}
|
||||||
|
<link rel="stylesheet" href="/themes/charme/assets/css/custom.css?ver=1.10030">
|
||||||
<link rel="stylesheet" href="/themes/charme/assets/css/custom.css?ver=1.10028">
|
|
||||||
|
|
||||||
{block name='javascript_head'}
|
{block name='javascript_head'}
|
||||||
{include file="_partials/javascript.tpl" javascript=$javascript.head vars=$js_custom_vars}
|
{include file="_partials/javascript.tpl" javascript=$javascript.head vars=$js_custom_vars}
|
||||||
@@ -66,8 +69,7 @@
|
|||||||
|
|
||||||
{block name='hook_extra'}{/block}
|
{block name='hook_extra'}{/block}
|
||||||
{literal}
|
{literal}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
console.log('test');
|
|
||||||
(function waitForElement() {
|
(function waitForElement() {
|
||||||
const targetSelector = '.remaining-amount-to-free-shipping-container';
|
const targetSelector = '.remaining-amount-to-free-shipping-container';
|
||||||
const destinationSelector = '#tc-container';
|
const destinationSelector = '#tc-container';
|
||||||
@@ -81,7 +83,7 @@ console.log('test');
|
|||||||
// Czekaj i sprawdź ponownie za 200 ms
|
// Czekaj i sprawdź ponownie za 200 ms
|
||||||
setTimeout(waitForElement, 200);
|
setTimeout(waitForElement, 200);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="c8f25b0f-e05a-4f87-8ab6-1ea1ad1853b0" data-blockingmode="auto" type="text/javascript"></script>
|
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="c8f25b0f-e05a-4f87-8ab6-1ea1ad1853b0" data-blockingmode="auto" type="text/javascript"></script>
|
||||||
{/literal}
|
{/literal}
|
||||||
Reference in New Issue
Block a user