Florian Eisenmenger пре 4 година
родитељ
комит
6aae1d4fa6
3 измењених фајлова са 149 додато и 127 уклоњено
  1. +55
    -25
      zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js
  2. +89
    -89
      zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/overrides.scss
  3. +5
    -13
      zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js

+ 55
- 25
zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js Прегледај датотеку

@@ -14,20 +14,21 @@ $(document).ready(function() {
// Add Class for Promotion Modal Box
if ($(".swag-custom-notification-info-modal__content").length) {
$(".swag-custom-notification-info-modal__content").parents(".modal").addClass("spwn-swag-custom-notification-info");
}
}
let dpInput = $(".confirm-delivery-date #dtgs-datepicker-inputfield");
if (dpInput.length) {
fp = document.querySelector("#dtgs-datepicker-inputfield")._flatpickr;
dpInput.prop('disabled', true);
dpInput.wrap('<div class="spwn-date-wrapper"></div>');
$("<span id='spwn-remove-date' title='Zurücksetzen'></span>").insertAfter(dpInput);
$("<input type='text' value='' id='spwn-dp-input' disabled='disabled' />").insertAfter(dpInput);
let doNotShow = $(".do-not-show").length ? " class='do-not-show'" : "";
$("<div id='spwn-delivery'" + doNotShow + "><p></p><div class='spwn-delivery--time'></div></div>").insertAfter(".confirm-delivery-date");
fp.config.onChange.push(function() {
manipulateDateInputValue();
});
// If Austria and same day delivery is checked change to DPD
if ($(".confirm-address-shipping").data("iso") === "AT") {
inputDPD.attr('checked', true).trigger("click");
@@ -36,22 +37,28 @@ $(document).ready(function() {
// No shop
inputShopPickup.parents(".shipping-method").hide();
}
// Call changeDelivery
$("[name='shippingMethodId']").on('change', () => {
changeDelivery(fp);
});
/* Set first selectable day selected */

spawnDateInputValue = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val();
/* Set first selectable day selected */
// remove hours
if ($(".confirm-delivery-date #dtgs-datepicker-inputfield").val().indexOf(":") !== -1) {
let inputTemp = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val();
spawnDateInputValue = inputTemp.substring(0, inputTemp.length - 6);
} else {
spawnDateInputValue = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val();
}
if (spawnDateInputValue === '') {
setDateSelected();
}
$("body").find("#spwn-dp-input").val(spawnDateInputValue);

changeDelivery(fp);
}
var sticky = $(".thumbnail-container");
if (sticky.length) {
var parentContainer = sticky.parents(".aku-cms-factory-element"),
@@ -61,12 +68,13 @@ $(document).ready(function() {
tagBar(sticky, parentContainer, stickyTop);
});
}
$("body").on("click", "#spwn-remove-date", function() {
$(".confirm-delivery-date #spwn-dp-input").val("");
$(".confirm-delivery-date #dtgs-datepicker-inputfield").val("");
spawnDateInputValue = "";
});
// Add smooth scrolling to all links
$(".thumbnail-container a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
@@ -75,7 +83,7 @@ $(document).ready(function() {
event.preventDefault();
// Store hash
var hash = this.hash;
var sTop = parseInt($(hash).offset().top - $(".header-inner").outerHeight() - 12);
scrollToPos(sTop, 800);
window.location.hash = hash;
@@ -93,14 +101,24 @@ function easeOutCuaic(t){
}

function manipulateDateInputValue() {
spawnDateInputValue = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val();
console.log("manipulateDateInputValue");
// remove hours
if ($(".confirm-delivery-date #dtgs-datepicker-inputfield").val().indexOf(":") !== -1) {
let inputTemp = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val();
spawnDateInputValue = inputTemp.substring(0, inputTemp.length - 6);
} else {
spawnDateInputValue = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val();
}
if (inputSameDayDelivery.is(':checked')) {
// If same day delivery is checked, select time
$("#spwn-delivery .spwn-delivery--time span.active").trigger("click");
} else {
$("#spwn-dp-input").val(spawnDateInputValue);
}
}

function setDateSelected() {
console.log("setDateSelected");
let spwnFirstSelectableDay = $(".flatpickr-day:not(.flatpickr-disabled)").first().text();
let spwnFPdate = new Date();
let spwnDay = spwnFPdate.getDate();
@@ -117,13 +135,15 @@ function setDateSelected() {
}

function changeDelivery(fp) {
console.log("changeDelivery");
$("body").on("click", "#spwn-delivery .spwn-delivery--time span", function() {
$("#spwn-delivery .spwn-delivery--time span").removeClass("active");
$(this).addClass("active");
$(".confirm-delivery-date #dtgs-datepicker-inputfield").val(spawnDateInputValue + " " + $(this).text());
$(".confirm-delivery-date #spwn-dp-input").val(spawnDateInputValue + " " + $(this).text());
$(".confirm-delivery-date #dtgs-datepicker-inputfield").val(spawnDateInputValue + " " + $(this).attr('data-time'));
$(".flatpickr-hour").val($(this).attr('data-hour'));
});
let daysToAdd = 0;
// if Vorkasse add 4 days
if (inputVorkasse.is(':checked')) {
@@ -133,32 +153,37 @@ function changeDelivery(fp) {
if (inputShopPickup.is(':checked')) {
// Abholung im Ladengeschäft
console.log("Abholung");
$(".confirm-delivery-date #dtgs-datepicker-inputfield").val('Abholung im Ladengeschäft');
$(".confirm-delivery-date #spwn-dp-input").val('Abholung im Ladengeschäft');
$(".confirm-delivery-date #dtgs-datepicker-inputfield").val('31.12.2050 04:00');
$(".confirm-delivery-date").hide();
$("#spwn-delivery p").text("Die bestellten Produkte stehen zur Abholung in unserem Ladengeschäft in Hamburg für Sie bereit.");
$(".flatpickr-hour").val('04');
} else if (inputSameDayDelivery.is(':checked')) {
// Abendzustellung
console.log("Abendzustellung");
$(".confirm-delivery-date #dtgs-datepicker-inputfield").val('');
spwnIncludedDays = [1, 2, 3, 4, 5];
// ONLY TUE AND THU
spwnIncludedDays = [2, 4];
// spwnIncludedDays = [1, 2, 3, 4, 5];
if (daysToAdd === 0) {
daysToAdd = 0;
}
setIncludedDays("evening", fp, daysToAdd);
$("#spwn-delivery p").text("Abendzustellung gewählt. Bitte wählen Sie nun eine Wunsch-Zeit:");
$("#spwn-delivery .spwn-delivery--time").append("<span class='active'>18 - 20 Uhr</span><span>19 - 21 Uhr</span><span>20 - 22 Uhr</span>");
$("#spwn-delivery .spwn-delivery--time").append("<span class='active' data-time='18:00' data-hour='18'>18 - 20 Uhr</span><span data-time='19:00' data-hour='19'>19 - 21 Uhr</span><span data-time='20:00' data-hour='20'>20 - 22 Uhr</span>");
// If not date from DPD days
if (!$(".flatpickr-day").hasClass("selected")) {
setDateSelected();
}
if ($(".flatpickr-day").hasClass("selected")) {
if (spawnDateInputValue === "" || spawnDateInputValue.indexOf("Uhr") === -1) {
// || spawnDateInputValue.indexOf(":00") === -1
if (spawnDateInputValue === "") {
manipulateDateInputValue();
}
} else {
// If DPD date is not in Abendzustellung range
setDateSelected();
}
}
$("#spwn-delivery .spwn-delivery--time span.active").trigger("click");
} else {
// DPD
console.log("DPD");
@@ -177,6 +202,7 @@ function changeDelivery(fp) {
// If Abendzustellung date is not in DPD range
setDateSelected();
}
$(".flatpickr-hour").val('01');
}
} else {
console.log("DPD AT");
@@ -191,6 +217,7 @@ function changeDelivery(fp) {
// If Abendzustellung or DPD DE date is not in DPD AT range
setDateSelected();
}
$(".flatpickr-hour").val('01');
}
}

@@ -198,15 +225,18 @@ function setIncludedDays(delivery, fp, addDays) {
// today
let spwnDateTemp = new Date();
spwnDateTemp.setDate(spwnDateTemp.getDate() + addDays);
let spwnTime = parseInt((spwnDateTemp.getHours() < 10 ? '0' : '') + spwnDateTemp.getHours() + "" + (spwnDateTemp.getMinutes() < 10 ? '0' : '') + spwnDateTemp.getMinutes());
// If "evening" after 11am add one extra day or if "dpd" after 2pm add one extra day
if ((delivery === "evening" && spwnTime > 1100) || (delivery === "dpd" && spwnTime > 1400)) {
spwnDateTemp.setDate(spwnDateTemp.getDate() + 1);
}
console.log(spwnDateTemp);
let spwnDate = fp.formatDate(spwnDateTemp, "d.m.Y");
fp.set("minDate", spwnDate);

// fp.set("maxDate", new Date().fp_incr(21));

fp.set("enable", [
function(date) {
let day = date.getDate();
@@ -232,10 +262,10 @@ $.fn.isInViewport = function() {
if ($(this).length) {
var elementTop = $(this).offset().top + 50;
var elementBottom = elementTop + $(this).outerHeight();
var viewportTop = $(window).scrollTop();
var viewportBottom = viewportTop + $(window).height();
return elementBottom > viewportTop && elementTop < viewportBottom;
}
};


+ 89
- 89
zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/overrides.scss Прегледај датотеку

@@ -8,103 +8,103 @@ https://getbootstrap.com/docs/4.0/getting-started/theming/#variable-defaults
*/

html {
//scroll-behavior: smooth;
//scroll-behavior: smooth;
}

body {
background: #fff;
overflow-x: hidden;
background: #fff;
overflow-x: hidden;
}

h1 {
font-size: 60px;
line-height: 54px !important;
font-size: 60px;
line-height: 54px !important;
}

h2 {
font-size: 44px;
line-height: 44px !important;
font-size: 44px;
line-height: 44px !important;
}

h3 {
font-size: 22px;
line-height: 24px;
font-weight: 500 !important;
font-family: $sw-font-family-base !important;
font-size: 22px;
line-height: 24px;
font-weight: 500 !important;
font-family: $sw-font-family-base !important;
}

h4,
h5,
h6 {
font-size: 18px;
line-height: 24px;
font-weight: 500 !important;
font-family: $sw-font-family-base !important;
font-size: 18px;
line-height: 24px;
font-weight: 500 !important;
font-family: $sw-font-family-base !important;
}

.breadcrumb-container {
display: none;
display: none;
}

.cms-block {
.category {
font-size: 16px;
font-weight: 500;
letter-spacing: 1.6px;
line-height: 18px;
text-transform: uppercase;
;
}
.category {
font-size: 16px;
font-weight: 500;
letter-spacing: 1.6px;
line-height: 18px;
text-transform: uppercase;
;
}
}

.sv-vbadge-vb3fx {
z-index: 999 !important;
z-index: 999 !important;
}

.product-image.is-standard {
object-fit: cover !important;
font-family: "object-fit: cover;" !important;
object-fit: cover !important;
font-family: "object-fit: cover;" !important;
}

.btn-outline-primary {
border: 2px solid #33548C !important;
border-radius: 3px;
font-size: 16px;
font-weight: 600;
letter-spacing: 1px;
text-transform: uppercase;
padding: 5px 32px !important;
border: 2px solid #33548C !important;
border-radius: 3px;
font-size: 16px;
font-weight: 600;
letter-spacing: 1px;
text-transform: uppercase;
padding: 5px 32px !important;
}

input.custom-number[type=number] {
border-bottom: 2px solid $sw-color-brand-primary;
border-bottom: 2px solid $sw-color-brand-primary;
}

.product-wishlist .icon-wishlist svg {
color: $sw-color-brand-primary;
color: $sw-color-brand-primary;
}

@media (min-width: 992px) {
.is-act-confirmpage {
.checkout {
.checkout-main {
margin-left: 0 !important;
flex: 0 0 100% !important;
max-width: 100% !important;
}
.checkout-additional {
margin-left: 0 !important;
flex: 0 0 66.6666666667% !important;
max-width: 66.6666666667% !important;
}
}
.is-act-confirmpage {
.checkout {
.checkout-main {
margin-left: 0 !important;
flex: 0 0 100% !important;
max-width: 100% !important;
}
.checkout-additional {
margin-left: 0 !important;
flex: 0 0 66.6666666667% !important;
max-width: 66.6666666667% !important;
}
}
}
}

@media (min-width: 576px) {
.modal-dialog {
max-width: 800px !important;
}
.modal-dialog {
max-width: 800px !important;
}
}


@@ -166,7 +166,7 @@ input.custom-number[type=number] {
cursor: pointer;
display: inline-block;
margin: 0 20px 0 0;
color: #86b04b;
color: #33548c;
font-size: 16px;
line-height: 18px;
border: 2px solid #33548c;
@@ -206,47 +206,47 @@ input.custom-number[type=number] {
}

.modal.spwn-swag-custom-notification-info {
.modal-header {
.close {
opacity: 1;
}
.icon {
color: #fff;
}
.modal-header {
.close {
opacity: 1;
}
@media (min-width: 576px) {
.modal-dialog {
max-width: 600px !important;
}
.icon {
color: #fff;
}
.modal-content {
background: transparent;
box-shadow: none;
}
@media (min-width: 576px) {
.modal-dialog {
max-width: 600px !important;
}
}
.modal-content {
background: transparent;
box-shadow: none;
}
}

.swag-custom-notification-info-modal__content {
padding-bottom: 40px;
.row {
align-items: center;
.col-md-6 {
flex: 0 0 100%;
max-width: 100%;
text-align: center;
}
h3 {
font-family: $sw-font-family-headline !important;
font-size: 44px;
font-weight: 700 !important;
margin-bottom: 30px;
display: none;
}
p {
display: none;
}
img {
width: 100%;
max-width: 450px;
}
padding-bottom: 40px;
.row {
align-items: center;
.col-md-6 {
flex: 0 0 100%;
max-width: 100%;
text-align: center;
}
h3 {
font-family: $sw-font-family-headline !important;
font-size: 44px;
font-weight: 700 !important;
margin-bottom: 30px;
display: none;
}
p {
display: none;
}
img {
width: 100%;
max-width: 450px;
}
}
}

+ 5
- 13
zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js Прегледај датотеку

@@ -22,7 +22,7 @@ $(document).ready(function() {
dpInput.prop('disabled', true);
dpInput.wrap('<div class="spwn-date-wrapper"></div>');
$("<span id='spwn-remove-date' title='Zurücksetzen'></span>").insertAfter(dpInput);
$("<input type='text' value='' id='spwn-dp-input' />").insertAfter(dpInput);
$("<input type='text' value='' id='spwn-dp-input' disabled='disabled' />").insertAfter(dpInput);
let doNotShow = $(".do-not-show").length ? " class='do-not-show'" : "";
$("<div id='spwn-delivery'" + doNotShow + "><p></p><div class='spwn-delivery--time'></div></div>").insertAfter(".confirm-delivery-date");
fp.config.onChange.push(function() {
@@ -154,16 +154,6 @@ function changeDelivery(fp) {
// Abholung im Ladengeschäft
console.log("Abholung");
$(".confirm-delivery-date #spwn-dp-input").val('Abholung im Ladengeschäft');
// let spwnDate = fp.formatDate('31.12.2050', 'd.m.Y');
// fp.set("maxDate", '2050/12/31');
// fp.setDate(new Date('2050/12/31'), true);
fp.set("dateFormat", 'd.m.Y');
fp.set("minDate", '05.04.2022');
fp.set("maxDate", '05.04.2022');
fp.set("enable", ["05.04.2022"]);
// fp.set("minDate", '31.12.2050');
// fp.set("maxDate", '31.12.2050');
// fp.set("enable", ["31.12.2050"]);
$(".confirm-delivery-date #dtgs-datepicker-inputfield").val('31.12.2050 04:00');
$(".confirm-delivery-date").hide();
$("#spwn-delivery p").text("Die bestellten Produkte stehen zur Abholung in unserem Ladengeschäft in Hamburg für Sie bereit.");
@@ -171,7 +161,9 @@ function changeDelivery(fp) {
} else if (inputSameDayDelivery.is(':checked')) {
// Abendzustellung
console.log("Abendzustellung");
spwnIncludedDays = [1, 2, 3, 4, 5];
// ONLY TUE AND THU
spwnIncludedDays = [2, 4];
// spwnIncludedDays = [1, 2, 3, 4, 5];
if (daysToAdd === 0) {
daysToAdd = 0;
}
@@ -243,7 +235,7 @@ function setIncludedDays(delivery, fp, addDays) {
let spwnDate = fp.formatDate(spwnDateTemp, "d.m.Y");
fp.set("minDate", spwnDate);

fp.set("maxDate", new Date().fp_incr(21));
// fp.set("maxDate", new Date().fp_incr(21));

fp.set("enable", [
function(date) {


Loading…
Откажи
Сачувај