5 Commits

Author SHA1 Message Date
1db08c5f17 Add is_shoppingcart.tpl file 2026-04-24 09:52:03 +02:00
c911fc76d2 fix(falcon-PS9): Corrected selector for discount code
Discounts couldn't be added to the promotion code field on click since this selector was wrong.
2026-03-25 14:00:17 +01:00
dc8ed97eb0 fix: add shipping cost info to cart summary 2026-03-10 16:51:32 +01:00
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
6 changed files with 189 additions and 78 deletions

2
.gitignore vendored
View File

@@ -1,2 +1,4 @@
falcon/vendor/ falcon/vendor/
*.zip

View File

@@ -1,82 +1,84 @@
import prestashop from 'prestashop'; import prestashop from "prestashop";
import $ from 'jquery'; import $ from "jquery";
prestashop.themeSelectors = { prestashop.themeSelectors = {
product: { product: {
tabs: '.tabs .nav-link', tabs: ".tabs .nav-link",
activeNavClass: 'js-product-nav-active', activeNavClass: "js-product-nav-active",
activeTabClass: 'js-product-tab-active', activeTabClass: "js-product-tab-active",
activeTabs: '.tabs .nav-link.active, .js-product-nav-active', activeTabs: ".tabs .nav-link.active, .js-product-nav-active",
imagesModal: '.js-product-images-modal', imagesModal: ".js-product-images-modal",
thumb: '.js-thumb', thumb: ".js-thumb",
thumbContainer: '.thumb-container, .js-thumb-container', thumbContainer: ".thumb-container, .js-thumb-container",
arrows: '.js-arrows', arrows: ".js-arrows",
selected: '.selected, .js-thumb-selected', selected: ".selected, .js-thumb-selected",
modalProductCover: '.js-modal-product-cover', modalProductCover: ".js-modal-product-cover",
cover: '.js-qv-product-cover', cover: ".js-qv-product-cover",
customizationModal: '.js-customization-modal', customizationModal: ".js-customization-modal",
}, },
listing: { listing: {
searchFilterToggler: '#search_filter_toggler, .js-search-toggler', searchFilterToggler: "#search_filter_toggler, .js-search-toggler",
searchFiltersWrapper: '#search_filters_wrapper', searchFiltersWrapper: "#search_filters_wrapper",
searchFilterControls: '#search_filter_controls', searchFilterControls: "#search_filter_controls",
searchFilters: '#search_filters', searchFilters: "#search_filters",
activeSearchFilters: '#js-active-search-filters', activeSearchFilters: "#js-active-search-filters",
listTop: '#js-product-list-top', listTop: "#js-product-list-top",
list: '#js-product-list', list: "#js-product-list",
listBottom: '#js-product-list-bottom', listBottom: "#js-product-list-bottom",
listHeader: '#js-product-list-header', listHeader: "#js-product-list-header",
searchFiltersClearAll: '.js-search-filters-clear-all', searchFiltersClearAll: ".js-search-filters-clear-all",
searchLink: '.js-search-link', searchLink: ".js-search-link",
}, },
order: { order: {
returnForm: '#order-return-form, .js-order-return-form', returnForm: "#order-return-form, .js-order-return-form",
}, },
arrowDown: '.arrow-down, .js-arrow-down', arrowDown: ".arrow-down, .js-arrow-down",
arrowUp: '.arrow-up, .js-arrow-up', arrowUp: ".arrow-up, .js-arrow-up",
clear: '.clear', clear: ".clear",
fileInput: '.js-file-input', fileInput: ".js-file-input",
contentWrapper: '#content-wrapper, .js-content-wrapper', contentWrapper: "#content-wrapper, .js-content-wrapper",
footer: '#footer, .js-footer', footer: "#footer, .js-footer",
modalContent: '.js-modal-content', modalContent: ".js-modal-content",
modal: '.js-checkout-modal', modal: ".js-checkout-modal",
touchspin: '.js-touchspin', touchspin: ".js-touchspin",
checkout: { checkout: {
termsLink: '.js-terms a', termsLink: ".js-terms a",
giftCheckbox: '.js-gift-checkbox', giftCheckbox: ".js-gift-checkbox",
imagesLink: '.card-block .cart-summary-products p a, .js-show-details', imagesLink: ".card-block .cart-summary-products p a, .js-show-details",
carrierExtraContent: '.carrier-extra-content, .js-carrier-extra-content', carrierExtraContent:
btn: '.checkout a', ".carrier-extra-content, .js-carrier-extra-content",
}, btn: ".checkout a",
cart: { },
productLineQty: '.js-cart-line-product-quantity', cart: {
quickview: '.quickview', productLineQty: ".js-cart-line-product-quantity",
touchspin: '.bootstrap-touchspin', quickview: ".quickview",
promoCode: '#promo-code', touchspin: ".bootstrap-touchspin",
displayPromo: '.display-promo', promoCode: "#promo-code",
promoCodeButton: '.promo-code-button', displayPromo: ".display-promo",
discountCode: '.js-discount .code', promoCodeButton: ".promo-code-button",
discountName: '[name=discount_name]', discountCode: ".js-discount .js-code",
actions: '[data-link-action="delete-from-cart"], [data-link-action="remove-voucher"]', discountName: "[name=discount_name]",
}, actions:
notifications: { '[data-link-action="delete-from-cart"], [data-link-action="remove-voucher"]',
dangerAlert: '#notifications article.alert-danger', },
container: '#notifications .container', notifications: {
}, dangerAlert: "#notifications article.alert-danger",
passwordPolicy: { container: "#notifications .container",
template: '#password-feedback', },
hint: '.js-hint-password', passwordPolicy: {
container: '.js-password-strength-feedback', template: "#password-feedback",
strengthText: '.js-password-strength-text', hint: ".js-hint-password",
requirementScore: '.js-password-requirements-score', container: ".js-password-strength-feedback",
requirementLength: '.js-password-requirements-length', strengthText: ".js-password-strength-text",
requirementScoreIcon: '.js-password-requirements-score i', requirementScore: ".js-password-requirements-score",
requirementLengthIcon: '.js-password-requirements-length i', requirementLength: ".js-password-requirements-length",
progressBar: '.js-password-policy-progress-bar', requirementScoreIcon: ".js-password-requirements-score i",
inputColumn: '.js-input-column', requirementLengthIcon: ".js-password-requirements-length i",
}, progressBar: ".js-password-policy-progress-bar",
inputColumn: ".js-input-column",
},
}; };
$(() => { $(() => {
prestashop.emit('themeSelectorsInit'); prestashop.emit("themeSelectorsInit");
}); });

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

@@ -0,0 +1,79 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="header-top__block header-top__block--cart col flex-grow-0">
<div class="js-blockcart blockcart cart-preview dropdown" data-refresh-url="{$refresh_url}">
<a href="#" role="button" id="cartDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
class="header-top__link d-lg-block d-none">
<div class="header-top__icon-container">
<span class="header-top__icon material-icons">shopping_basket</span>
<span class="header-top__badge {if $cart.products_count > 9}header-top__badge--smaller{/if}">
{$cart.products_count}
</span>
</div>
</a>
<a href="{$cart_url}" class="d-flex d-lg-none header-top__link">
<div class="header-top__icon-container">
<span class="header-top__icon material-icons">shopping_basket</span>
<span class="header-top__badge {if $cart.products_count > 9}header-top__badge--smaller{/if}">
{$cart.products_count}
</span>
</div>
</a>
<div class="dropdown-menu blockcart__dropdown cart-dropdown dropdown-menu-right" aria-labelledby="cartDropdown">
<div class="cart-dropdown__content keep-open js-cart__card-body cart__card-body">
<div class="cart-loader">
<div class="spinner-border text-primary" role="status"><span
class="sr-only">{l s='Loading...' d='Shop.Theme.Global'}</span></div>
</div>
<div class="cart-dropdown__title d-flex align-items-center mb-3">
<p class="h5 mb-0 mr-2">
{l s='Your cart' d='Modules.Isshoppingcart.Isshoppingcart'}
</p>
<a data-toggle="dropdown" href="#" class="cart-dropdown__close dropdown-close ml-auto cursor-pointer text-decoration-none">
<i class="material-icons d-block">close</i>
</a>
</div>
{if $cart.products_count > 0}
<div class="cart-dropdown__products pt-3 mb-3">
{foreach from=$cart.products item=product}
{include 'module:is_shoppingcart/views/templates/front/is_shoppingcart-product-line.tpl' product=$product}
{/foreach}
</div>
<div class="cart-summary-line cart-total">
<span class="label">{$cart.totals.total.label}</span>
<span class="value">{$cart.totals.total.value}</span>
</div>
<div class="mt-3">
<a href="{$cart_url}" class="btn btn-sm btn-primary btn-block dropdown-close">
{l s='Proceed to checkout' d='Shop.Theme.Actions'}
</a>
</div>
{else}
<div class="alert alert-warning">
{l s='Unfortunately your basket is empty' d='Modules.Isshoppingcart.Isshoppingcart'}
</div>
{/if}
</div>
</div>
</div>
</div>

View File

@@ -1,7 +1,15 @@
{* 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>
{/if} {/if}
</div> </div>

View File

@@ -38,6 +38,11 @@
<span class="label">{$cart.totals.total.label}&nbsp;{if $configuration.display_taxes_label && $configuration.taxes_enabled}{$cart.labels.tax_short}{/if}</span> <span class="label">{$cart.totals.total.label}&nbsp;{if $configuration.display_taxes_label && $configuration.taxes_enabled}{$cart.labels.tax_short}{/if}</span>
<span class="value">{$cart.totals.total.value}</span> <span class="value">{$cart.totals.total.value}</span>
</div> </div>
{if !$cart.has_delivery_address}
<p class="no_delivery_address_yet_message">
{l s='Shipping costs will be calculated in the next step, before you checkout. Shipping costs depend on the country the order is shipped to. For the Netherlands, orders with a value of € 125.00 will be shipped free of charge. You can view the shippingcosts <a href="https://www.nijssenbulbs.com/content/16-verzendkosten"><u>here</u></a>' d='Shop.Checkout.Total'}
</p>
{/if}
{/if} {/if}
{/block} {/block}