3 Commits

Author SHA1 Message Date
a128906dc0 fix(falcon-PS9): prevent 500 error on AJAX filtering by normalizing data
Resolved a Fatal Error occurring during AJAX product listing requests (e.g., price slider).

- Issue: In PHP 8.2+, accessing properties of a 'CategoryLazyArray' object
  using array syntax (dot notation) triggers a Fatal Error.
- Cause: The Faceted Search module returns a LazyArray object during
  XHR requests, whereas standard page loads provide a native array.
- Solution: Implemented a normalization block using JSON serialization
  to flatten the object into a standard associative array. This ensures
  template syntax compatibility regardless of the request type or
  property visibility (protected vs public).
2026-01-09 10:52:21 +01:00
ddec414409 fix(falcon-PS9): Auto-format postcode
This removes the annoying error when you type in 8011XD instead of 8011 XD
2026-01-09 10:17:29 +01:00
48e776d80d feat(falcon-PS9): Add custom.scss file to follow 7-in-1 structure 2025-12-31 16:19:02 +01:00
5 changed files with 60 additions and 9 deletions

View File

@ -5,3 +5,4 @@
@import "layout/index"; @import "layout/index";
@import "components/index"; @import "components/index";
@import "custom/custom";

View File

@ -0,0 +1,22 @@
/* This is the main custom SCSS file for the Falcon theme.
I am loosely following the 7 in 1 structure for better organization of the styles. Learn more here:
https://medium.com/@diyorbekjuraev77/be-a-master-at-creating-the-7-1-sass-pattern-776fdfb5a3b1
NOTE: All bootstrap overrides have been configured under themes/falcon/_dev/css/abstracts/variables/bootstrap */
//Abstracts: Things used throughout the site such as utility classes and generic overrides.
//@import "abstracts/mixins";
// Components: parts of the theme itself that are not associated with a module.
//@import "components/buttons";
// Modules: Styling for specific modules.
//@import "modules/";
//Layouts: Parts of a page, such as the header, footer, etc.
//@import "layout/footer";
//@import "layout/header";
// Pages
//@import "pages/home";

View File

@ -79,4 +79,19 @@ $(() => {
$(".js-select-link").on("change", ({ target }) => { $(".js-select-link").on("change", ({ target }) => {
window.location.href = $(target).val(); window.location.href = $(target).val();
}); });
// Postcode input formatting
const $postCodeInput = $("input[name='postcode']");
$postCodeInput.on("input", function () {
let value = $(this).val();
// Match 4 digits followed by 2 letters (e.g., 1234AB)
const match = value.match(/^(\d{4})([a-zA-Z]{2})$/);
if (match) {
// Add space between numbers and letters
const formatted = `${match[1]} ${match[2]}`;
$(this).val(formatted);
}
});
}); });

View File

@ -29,7 +29,14 @@
{/block} {/block}
{block name='header_nav'} {block name='header_nav'}
<nav class="header-nav border-bottom bg-light py-1 d-none d-md-block">
<div class="container">
<div class="row align-items-center">
{hook h='displayNav1'}
{hook h='displayNav2'}
</div>
</div>
</nav>
{/block} {/block}
{block name='header_top'} {block name='header_top'}
@ -72,15 +79,13 @@
{/images_block} {/images_block}
</a> </a>
</div> </div>
{hook h='displayTop'} {hook h='displayTop'}
</div> </div>
<div class="row">
<div class="col">
{hook h='displayNavFullWidth'}
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{hook h='displayNavFullWidth'}
{/block} {/block}

View File

@ -1,5 +1,13 @@
{* Defensive: Handles LazyArray objects for category *}
{if is_object($category)}
{$category = $category|json_encode|json_decode:true}
{if isset($category.category)}
{$category = $category.category}
{/if}
{/if}
<div id="js-product-list-footer"> <div id="js-product-list-footer">
{if $category.additional_description && $listing.pagination.items_shown_from == 1} {if isset($category.additional_description) && $category.additional_description && $listing.pagination.items_shown_from == 1}
<div id="category-description-2" class="cms-content my-3"> <div id="category-description-2" class="cms-content my-3">
{$category.additional_description nofilter} {$category.additional_description nofilter}
</div> </div>