- ${errorMsg}
diff --git a/falcon/_dev/css/abstracts/variables/bootstrap/_forms.scss b/falcon/_dev/css/abstracts/variables/bootstrap/_forms.scss
index c3fe83e..fb0a72e 100644
--- a/falcon/_dev/css/abstracts/variables/bootstrap/_forms.scss
+++ b/falcon/_dev/css/abstracts/variables/bootstrap/_forms.scss
@@ -1,8 +1,10 @@
-$input-btn-padding-y: rem-calc(8px);
-$input-btn-padding-x: rem-calc(16px);
+$input-btn-padding-y: rem-calc(8px);
+$input-btn-padding-x: rem-calc(16px);
-$input-btn-padding-y-sm: rem-calc(4px);
-$input-btn-padding-x-sm: rem-calc(8px);
+$input-btn-padding-y-sm: rem-calc(4px);
+$input-btn-padding-x-sm: rem-calc(8px);
-$input-btn-padding-y-lg: rem-calc(14px);
-$input-btn-padding-x-lg: rem-calc(20px);
+$input-btn-padding-y-lg: rem-calc(14px);
+$input-btn-padding-x-lg: rem-calc(20px);
+
+$input-height: rem-calc(50px);
diff --git a/falcon/_dev/css/abstracts/variables/bootstrap/_typography.scss b/falcon/_dev/css/abstracts/variables/bootstrap/_typography.scss
index 7e96adc..80876f8 100644
--- a/falcon/_dev/css/abstracts/variables/bootstrap/_typography.scss
+++ b/falcon/_dev/css/abstracts/variables/bootstrap/_typography.scss
@@ -1,8 +1,7 @@
-$font-family-sans-serif: "Roboto", -apple-system, blinkmacsystemfont, "Segoe UI",
- roboto, "Helvetica Neue", arial, "Noto Sans", "Liberation Sans", sans-serif,
- "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
+$font-family-sans-serif: "Plus Jakarta Sans", sans-serif;
$font-family-base: $font-family-sans-serif;
$headings-font-family: $font-family-sans-serif;
+$font-weight-base: 400;
$font-size-base: rem-calc(14px);
$font-size-lg: $font-size-base * 1.125;
diff --git a/falcon/_dev/css/theme/custom/_custom.scss b/falcon/_dev/css/theme/custom/_custom.scss
index 4250541..5fc1807 100644
--- a/falcon/_dev/css/theme/custom/_custom.scss
+++ b/falcon/_dev/css/theme/custom/_custom.scss
@@ -16,7 +16,7 @@ Look up all available Bootstrap variables here: https://rstudio.github.io/bslib/
//@import "abstracts/utilities";
// Components: parts of the theme itself that are not associated with a module.
-//@import "components/buttons";
+@import "components/buttons";
@import "components/forms";
// Modules: Styling for specific modules.
diff --git a/falcon/_dev/css/theme/custom/components/_buttons.scss b/falcon/_dev/css/theme/custom/components/_buttons.scss
index 9be84c8..1e9bf6b 100644
--- a/falcon/_dev/css/theme/custom/components/_buttons.scss
+++ b/falcon/_dev/css/theme/custom/components/_buttons.scss
@@ -1,4 +1,5 @@
-// To customize text colors per button, use this map
+// To customize text colors per button, use this map and below function
+
$btn-color: (
"primary": $white,
"secondary": $white,
@@ -6,7 +7,6 @@ $btn-color: (
"dark": $white,
);
-// Generate button color overrides from the map
@each $name, $color in $btn-color {
.btn-#{$name},
.btn-lg-#{$name},
@@ -15,33 +15,21 @@ $btn-color: (
}
}
-// bootstrap touchspin. Edit icons under js/theme/components/product.js
+// Bootstrap touchspin
.bootstrap-touchspin {
- min-width: 100px;
flex-wrap: nowrap;
- > input {
- border-left: 0px;
- color: $primary;
- &:focus {
- box-shadow: none;
- }
- }
-
- .btn {
- height: 50%;
- width: 100%;
- border-radius: 0px;
- &:first-child {
- border-bottom: 1px solid $border-color;
- }
- }
-
.input-touchspin {
- min-width: rem-calc(66px);
+ height: rem-calc(50px);
+ min-width: rem-calc(75px);
+ border-left: 0px;
}
.input-group-btn-vertical {
- min-width: rem-calc(33px);
+ display: flex;
+ flex-direction: column;
+ button {
+ border-radius: 0px;
+ }
}
}
diff --git a/falcon/_dev/css/theme/custom/components/_forms.scss b/falcon/_dev/css/theme/custom/components/_forms.scss
index 8a28ebf..6cf4630 100644
--- a/falcon/_dev/css/theme/custom/components/_forms.scss
+++ b/falcon/_dev/css/theme/custom/components/_forms.scss
@@ -1,12 +1,10 @@
-.field-password-policy .input-group.js-parent-focus {
- > * {
- max-height: rem-calc(39px);
- }
- .form-control {
- height: unset;
- }
+.input-group.js-parent-focus {
.input-group-append .btn {
border-top-right-radius: $border-radius !important;
border-bottom-right-radius: $border-radius !important;
}
}
+
+.input-group.js-parent-focus {
+ height: $input-height;
+}
diff --git a/falcon/_dev/css/theme/custom/layout/_header.scss b/falcon/_dev/css/theme/custom/layout/_header.scss
index c5f328d..838c327 100644
--- a/falcon/_dev/css/theme/custom/layout/_header.scss
+++ b/falcon/_dev/css/theme/custom/layout/_header.scss
@@ -10,4 +10,8 @@
margin: 0;
}
}
+
+ .header-top__badge {
+ right: -0.9em;
+ }
}
diff --git a/falcon/_dev/js/theme/components/cart/cart.js b/falcon/_dev/js/theme/components/cart/cart.js
index 985352f..125f31e 100644
--- a/falcon/_dev/js/theme/components/cart/cart.js
+++ b/falcon/_dev/js/theme/components/cart/cart.js
@@ -1,6 +1,6 @@
-import $ from 'jquery';
-import prestashop from 'prestashop';
-import debounce from '@js/theme/utils/debounce';
+import $ from "jquery";
+import prestashop from "prestashop";
+import debounce from "@js/theme/utils/debounce";
prestashop.cart = prestashop.cart || {};
@@ -9,358 +9,395 @@ prestashop.cart.active_inputs = null;
const spinnerSelector = 'input[name="product-quantity-spin"]';
let hasError = false;
let isUpdateOperation = false;
-let errorMsg = '';
+let errorMsg = "";
const CheckUpdateQuantityOperations = {
- switchErrorStat: () => {
- /**
- * if errorMsg is not empty or if notifications are shown, we have error to display
- * if hasError is true, quantity was not updated : we don't disable checkout button
- */
- const $checkoutBtn = $(prestashop.themeSelectors.checkout.btn);
+ switchErrorStat: () => {
+ /**
+ * if errorMsg is not empty or if notifications are shown, we have error to display
+ * if hasError is true, quantity was not updated : we don't disable checkout button
+ */
+ const $checkoutBtn = $(prestashop.themeSelectors.checkout.btn);
- if ($(prestashop.themeSelectors.notifications.dangerAlert).length || (errorMsg !== '' && !hasError)) {
- $checkoutBtn.addClass('disabled');
- }
+ if (
+ $(prestashop.themeSelectors.notifications.dangerAlert).length ||
+ (errorMsg !== "" && !hasError)
+ ) {
+ $checkoutBtn.addClass("disabled");
+ }
- if (errorMsg !== '') {
- const strError = `
+ if (errorMsg !== "") {
+ const strError = `
',
+ verticaldown:
+ '
',
+ });
});
- });
- CheckUpdateQuantityOperations.switchErrorStat();
+ CheckUpdateQuantityOperations.switchErrorStat();
}
const preventCustomModalOpen = (event) => {
- if (window.shouldPreventModal) {
- event.preventDefault();
+ if (window.shouldPreventModal) {
+ event.preventDefault();
- return false;
- }
+ return false;
+ }
- return true;
+ return true;
};
$(() => {
- const productLineInCartSelector = prestashop.themeSelectors.cart.productLineQty;
- const promises = [];
+ const productLineInCartSelector =
+ prestashop.themeSelectors.cart.productLineQty;
+ const promises = [];
- prestashop.on('updateCart', () => {
- $(prestashop.themeSelectors.cart.quickview).modal('hide');
- $('body').addClass('cart-loading');
- });
+ prestashop.on("updateCart", () => {
+ $(prestashop.themeSelectors.cart.quickview).modal("hide");
+ $("body").addClass("cart-loading");
+ });
- prestashop.on('updatedCart', () => {
- window.shouldPreventModal = false;
+ prestashop.on("updatedCart", () => {
+ window.shouldPreventModal = false;
- $(prestashop.themeSelectors.product.customizationModal).on('show.bs.modal', (modalEvent) => {
- preventCustomModalOpen(modalEvent);
+ $(prestashop.themeSelectors.product.customizationModal).on(
+ "show.bs.modal",
+ (modalEvent) => {
+ preventCustomModalOpen(modalEvent);
+ },
+ );
+
+ createSpin();
+ $("body").removeClass("cart-loading");
});
createSpin();
- $('body').removeClass('cart-loading');
- });
- createSpin();
+ const $body = $("body");
- const $body = $('body');
-
- function isTouchSpin(namespace) {
- return namespace === 'on.startupspin' || namespace === 'on.startdownspin';
- }
-
- function shouldIncreaseProductQuantity(namespace) {
- return namespace === 'on.startupspin';
- }
-
- function findCartLineProductQuantityInput($target) {
- const $input = $target.parents(prestashop.themeSelectors.cart.touchspin).find(productLineInCartSelector);
-
- if ($input.is(':focus')) {
- return null;
+ function isTouchSpin(namespace) {
+ return (
+ namespace === "on.startupspin" || namespace === "on.startdownspin"
+ );
}
- return $input;
- }
-
- function camelize(subject) {
- const actionTypeParts = subject.split('-');
- let i;
- let part;
- let camelizedSubject = '';
-
- for (i = 0; i < actionTypeParts.length; i += 1) {
- part = actionTypeParts[i];
-
- if (i !== 0) {
- part = part.substring(0, 1).toUpperCase() + part.substring(1);
- }
-
- camelizedSubject += part;
+ function shouldIncreaseProductQuantity(namespace) {
+ return namespace === "on.startupspin";
}
- return camelizedSubject;
- }
+ function findCartLineProductQuantityInput($target) {
+ const $input = $target
+ .parents(prestashop.themeSelectors.cart.touchspin)
+ .find(productLineInCartSelector);
- function parseCartAction($target, namespace) {
- if (!isTouchSpin(namespace)) {
- return {
- url: $target.attr('href'),
- type: camelize($target.data('link-action')),
- };
+ if ($input.is(":focus")) {
+ return null;
+ }
+
+ return $input;
}
- const $input = findCartLineProductQuantityInput($target);
+ function camelize(subject) {
+ const actionTypeParts = subject.split("-");
+ let i;
+ let part;
+ let camelizedSubject = "";
- let cartAction = {};
+ for (i = 0; i < actionTypeParts.length; i += 1) {
+ part = actionTypeParts[i];
- if ($input) {
- if (shouldIncreaseProductQuantity(namespace)) {
- cartAction = {
- url: $input.data('up-url'),
- type: 'increaseProductQuantity',
- };
- } else {
- cartAction = {
- url: $input.data('down-url'),
- type: 'decreaseProductQuantity',
- };
- }
+ if (i !== 0) {
+ part = part.substring(0, 1).toUpperCase() + part.substring(1);
+ }
+
+ camelizedSubject += part;
+ }
+
+ return camelizedSubject;
}
- return cartAction;
- }
+ function parseCartAction($target, namespace) {
+ if (!isTouchSpin(namespace)) {
+ return {
+ url: $target.attr("href"),
+ type: camelize($target.data("link-action")),
+ };
+ }
- const abortPreviousRequests = () => {
- let promise;
- while (promises.length > 0) {
- promise = promises.pop();
- promise.abort();
+ const $input = findCartLineProductQuantityInput($target);
+
+ let cartAction = {};
+
+ if ($input) {
+ if (shouldIncreaseProductQuantity(namespace)) {
+ cartAction = {
+ url: $input.data("up-url"),
+ type: "increaseProductQuantity",
+ };
+ } else {
+ cartAction = {
+ url: $input.data("down-url"),
+ type: "decreaseProductQuantity",
+ };
+ }
+ }
+
+ return cartAction;
}
- };
- const getTouchSpinInput = ($button) => $($button.parents(prestashop.themeSelectors.cart.touchspin).find('input'));
-
- $(prestashop.themeSelectors.product.customizationModal).on('show.bs.modal', (modalEvent) => {
- preventCustomModalOpen(modalEvent);
- });
-
- const handleCartAction = (event) => {
- event.preventDefault();
- window.shouldPreventModal = true;
-
- const $target = $(event.currentTarget);
- const { dataset } = event.currentTarget;
-
- const cartAction = parseCartAction($target, event.namespace);
- const requestData = {
- ajax: '1',
- action: 'update',
+ const abortPreviousRequests = () => {
+ let promise;
+ while (promises.length > 0) {
+ promise = promises.pop();
+ promise.abort();
+ }
};
- if (typeof cartAction === 'undefined') {
- return;
- }
+ const getTouchSpinInput = ($button) =>
+ $(
+ $button
+ .parents(prestashop.themeSelectors.cart.touchspin)
+ .find("input"),
+ );
- $.ajax({
- url: cartAction.url,
- method: 'POST',
- data: requestData,
- dataType: 'json',
- beforeSend: (jqXHR) => {
- promises.push(jqXHR);
- },
- })
- .then((resp) => {
- const $quantityInput = getTouchSpinInput($target);
- CheckUpdateQuantityOperations.checkUpdateOperation(resp);
- $quantityInput.val(resp.quantity);
+ $(prestashop.themeSelectors.product.customizationModal).on(
+ "show.bs.modal",
+ (modalEvent) => {
+ preventCustomModalOpen(modalEvent);
+ },
+ );
- // Refresh cart preview
- prestashop.emit('updateCart', {
- reason: dataset,
- resp,
- });
- })
- .fail((resp) => {
- prestashop.emit('handleError', {
- eventType: 'updateProductInCart',
- resp,
- cartAction: cartAction.type,
- });
- });
- };
+ const handleCartAction = (event) => {
+ event.preventDefault();
+ window.shouldPreventModal = true;
- $body.on('click', prestashop.themeSelectors.cart.actions, handleCartAction);
+ const $target = $(event.currentTarget);
+ const { dataset } = event.currentTarget;
- function sendUpdateQuantityInCartRequest(updateQuantityInCartUrl, requestData, $target) {
- abortPreviousRequests();
- window.shouldPreventModal = true;
+ const cartAction = parseCartAction($target, event.namespace);
+ const requestData = {
+ ajax: "1",
+ action: "update",
+ };
- return $.ajax({
- url: updateQuantityInCartUrl,
- method: 'POST',
- data: requestData,
- dataType: 'json',
- beforeSend: (jqXHR) => {
- promises.push(jqXHR);
- },
- })
- .then((resp) => {
- CheckUpdateQuantityOperations.checkUpdateOperation(resp);
+ if (typeof cartAction === "undefined") {
+ return;
+ }
- $target.val(resp.quantity);
- const dataset = ($target && $target.dataset) ? $target.dataset : resp;
+ $.ajax({
+ url: cartAction.url,
+ method: "POST",
+ data: requestData,
+ dataType: "json",
+ beforeSend: (jqXHR) => {
+ promises.push(jqXHR);
+ },
+ })
+ .then((resp) => {
+ const $quantityInput = getTouchSpinInput($target);
+ CheckUpdateQuantityOperations.checkUpdateOperation(resp);
+ $quantityInput.val(resp.quantity);
- // Refresh cart preview
- prestashop.emit('updateCart', {
- reason: dataset,
- resp,
- });
- })
- .fail((resp) => {
- prestashop.emit('handleError', {
- eventType: 'updateProductQuantityInCart',
- resp,
- });
- });
- }
-
- function getQuantityChangeType($quantity) {
- return $quantity > 0 ? 'up' : 'down';
- }
-
- function getRequestData(quantity) {
- return {
- ajax: '1',
- qty: Math.abs(quantity),
- action: 'update',
- op: getQuantityChangeType(quantity),
+ // Refresh cart preview
+ prestashop.emit("updateCart", {
+ reason: dataset,
+ resp,
+ });
+ })
+ .fail((resp) => {
+ prestashop.emit("handleError", {
+ eventType: "updateProductInCart",
+ resp,
+ cartAction: cartAction.type,
+ });
+ });
};
- }
- function updateProductQuantityInCart(event) {
- const $target = $(event.currentTarget);
- const updateQuantityInCartUrl = $target.data('update-url');
- const baseValue = $target.attr('value');
+ $body.on("click", prestashop.themeSelectors.cart.actions, handleCartAction);
- // There should be a valid product quantity in cart
- const targetValue = $target.val();
+ function sendUpdateQuantityInCartRequest(
+ updateQuantityInCartUrl,
+ requestData,
+ $target,
+ ) {
+ abortPreviousRequests();
+ window.shouldPreventModal = true;
- /* eslint-disable */
- if (targetValue != parseInt(targetValue, 10) || targetValue < 0 || Number.isNaN(targetValue)) {
- window.shouldPreventModal = false;
- $target.val(baseValue);
- return;
- }
- /* eslint-enable */
+ return $.ajax({
+ url: updateQuantityInCartUrl,
+ method: "POST",
+ data: requestData,
+ dataType: "json",
+ beforeSend: (jqXHR) => {
+ promises.push(jqXHR);
+ },
+ })
+ .then((resp) => {
+ CheckUpdateQuantityOperations.checkUpdateOperation(resp);
- // There should be a new product quantity in cart
- const qty = targetValue - baseValue;
+ $target.val(resp.quantity);
+ const dataset =
+ $target && $target.dataset ? $target.dataset : resp;
- if (qty === 0) {
- return;
+ // Refresh cart preview
+ prestashop.emit("updateCart", {
+ reason: dataset,
+ resp,
+ });
+ })
+ .fail((resp) => {
+ prestashop.emit("handleError", {
+ eventType: "updateProductQuantityInCart",
+ resp,
+ });
+ });
}
- if (targetValue === '0') {
- $target.closest('.product-line-actions').find('[data-link-action="delete-from-cart"]').click();
- } else {
- $target.attr('value', targetValue);
- sendUpdateQuantityInCartRequest(updateQuantityInCartUrl, getRequestData(qty), $target);
+ function getQuantityChangeType($quantity) {
+ return $quantity > 0 ? "up" : "down";
}
- }
- $body.on('touchspin.on.stopspin', spinnerSelector, debounce(updateProductQuantityInCart));
+ function getRequestData(quantity) {
+ return {
+ ajax: "1",
+ qty: Math.abs(quantity),
+ action: "update",
+ op: getQuantityChangeType(quantity),
+ };
+ }
- $body.on(
- 'focusout keyup',
- productLineInCartSelector,
- (event) => {
- if (event.type === 'keyup') {
- if (event.keyCode === 13) {
- isUpdateOperation = true;
- updateProductQuantityInCart(event);
+ function updateProductQuantityInCart(event) {
+ const $target = $(event.currentTarget);
+ const updateQuantityInCartUrl = $target.data("update-url");
+ const baseValue = $target.attr("value");
+
+ // There should be a valid product quantity in cart
+ const targetValue = $target.val();
+
+ /* eslint-disable */
+ if (
+ targetValue != parseInt(targetValue, 10) ||
+ targetValue < 0 ||
+ Number.isNaN(targetValue)
+ ) {
+ window.shouldPreventModal = false;
+ $target.val(baseValue);
+ return;
+ }
+ /* eslint-enable */
+
+ // There should be a new product quantity in cart
+ const qty = targetValue - baseValue;
+
+ if (qty === 0) {
+ return;
+ }
+
+ if (targetValue === "0") {
+ $target
+ .closest(".product-line-actions")
+ .find('[data-link-action="delete-from-cart"]')
+ .click();
+ } else {
+ $target.attr("value", targetValue);
+ sendUpdateQuantityInCartRequest(
+ updateQuantityInCartUrl,
+ getRequestData(qty),
+ $target,
+ );
+ }
+ }
+
+ $body.on(
+ "touchspin.on.stopspin",
+ spinnerSelector,
+ debounce(updateProductQuantityInCart),
+ );
+
+ $body.on("focusout keyup", productLineInCartSelector, (event) => {
+ if (event.type === "keyup") {
+ if (event.keyCode === 13) {
+ isUpdateOperation = true;
+ updateProductQuantityInCart(event);
+ }
+
+ return false;
+ }
+
+ if (!isUpdateOperation) {
+ updateProductQuantityInCart(event);
}
return false;
- }
+ });
- if (!isUpdateOperation) {
- updateProductQuantityInCart(event);
- }
+ $body.on("click", prestashop.themeSelectors.cart.discountCode, (event) => {
+ event.stopPropagation();
+ event.preventDefault();
- return false;
- },
- );
+ const $code = $(event.currentTarget);
+ const $discountInput = $("[name=discount_name]");
+ const $discountForm = $discountInput.closest("form");
- $body.on(
- 'click',
- prestashop.themeSelectors.cart.discountCode,
- (event) => {
- event.stopPropagation();
- event.preventDefault();
+ $discountInput.val($code.text());
+ // Show promo code field
+ $discountForm.trigger("submit");
- const $code = $(event.currentTarget);
- const $discountInput = $('[name=discount_name]');
- const $discountForm = $discountInput.closest('form');
-
- $discountInput.val($code.text());
- // Show promo code field
- $discountForm.trigger('submit');
-
- return false;
- },
- );
+ return false;
+ });
});
diff --git a/falcon/modules/is_favoriteproducts/views/templates/hook/button-product.tpl b/falcon/modules/is_favoriteproducts/views/templates/hook/button-product.tpl
index 5d00fb0..89446dc 100644
--- a/falcon/modules/is_favoriteproducts/views/templates/hook/button-product.tpl
+++ b/falcon/modules/is_favoriteproducts/views/templates/hook/button-product.tpl
@@ -1,5 +1,5 @@
-