diff --git a/.phive/phars.xml b/.phive/phars.xml index 5bfa092bfad10dad9d23240281a5a2041acb815b..7877fd4b0f51842b205534cdbd99b037ddb2831b 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <phive xmlns="https://phar.io/phive"> - <phar name="phpstan" version="1.11.8" installed="1.11.8" location="./tools/phpstan" copy="false"/> + <phar name="phpstan" version="^1.11.5" installed="1.11.5" location="./tools/phpstan" copy="false"/> <phar name="phpunit" version="^10.5.20" installed="10.5.20" location="./tools/phpunit" copy="false"/> <phar name="phpcs" version="^3.10.1" installed="3.10.1" location="./tools/phpcs" copy="false"/> <phar name="phpcbf" version="^3.10.1" installed="3.10.1" location="./tools/phpcbf" copy="false"/> diff --git a/bin/css/buttons.css b/bin/css/buttons.css index a3bf5c884fc3242ab7fa9af9ccf237934360ca55..714138ae5bc0a062e43c72ce05e644eb81ea75e2 100644 --- a/bin/css/buttons.css +++ b/bin/css/buttons.css @@ -28,16 +28,11 @@ a.qui-button, float: none; /* qui-button reset */ } -button > .fa, -.btn > .fa { +button > .fa:not(:only-child), +.btn > .fa:not(:only-child) { margin-right: .75rem; } -button.loading > .fa, -.btn.loading > .fa { - margin-right: 0; -} - /*****************************/ /* button primary & standard */ /*****************************/ diff --git a/bin/css/form.css b/bin/css/form.css index 13d4bf8ba1e8d0ee04754355db388c4f1d5e933a..e9222466487ca1ce01dfcbd034e1735e515012e9 100644 --- a/bin/css/form.css +++ b/bin/css/form.css @@ -21,7 +21,6 @@ select { background-image: url("../images/arrow-select.svg"); background-position: calc(100% - 10px) center; background-repeat: no-repeat; - background-size: 20px auto; background-size: 8px; height: 40px; padding-bottom: 0; @@ -58,6 +57,28 @@ textarea:focus { border-color: #a9a8a5; } +/* disabled */ +:is( + input:where(:not([type])), + [type='text'], + [type='email'], + [type='url'], + [type='password'], + [type='number'], + [type='date'], + [type='datetime-local'], + [type='month'], + [type='search'], + [type='tel'], + [type='time'], + [type='week'], + [multiple], + textarea, + select +):where([disabled]) { + opacity: 0.6; +} + /* iOs input search fix */ input[type="search"] { -webkit-appearance: none; diff --git a/bin/css/frontend-users.css b/bin/css/frontend-users.css index c8cde74ca385435d28c1ec9231d52b2d55fdf4e6..4c5250fc7d21d855c276508b3e575ad7da48be08 100644 --- a/bin/css/frontend-users.css +++ b/bin/css/frontend-users.css @@ -11,7 +11,7 @@ /* simple user info */ /********************/ .quiqqer-fupc-userinfo { - border: 1px solid #ddd; + border: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); border-radius: 5px; margin-bottom: 1em; background: #fff; @@ -21,67 +21,33 @@ background: url("../images/brushed_alu.png"); } -.quiqqer-frontendUsers-profile-container { - display: flex; - margin-bottom: 2rem; - margin-top: 2rem; -} - -.quiqqer-frontendUsers-controls-profile .quiqqer-frontendUsers-controls-profile-categories { - padding-right: 20px; -} - -.quiqqer-frontendUsers-controls-profile .quiqqer-frontendUsers-controls-profile-categoryContent { - padding-left: 20px; -} - -@media (max-width: 768px) { - .quiqqer-frontendUsers-controls-profile .quiqqer-frontendUsers-controls-profile-categories { - padding: 0; - width: 100%; - } - - .quiqqer-frontendUsers-controls-profile .quiqqer-frontendUsers-controls-profile-categoryContent { - padding-left: 0; - } +/***********/ +/* Profile */ +/***********/ +.quiqqer-frontendUsers-controls-profile { + --qui-frontend-users-profile__radius: 0; + --qui-frontend-users-profile__sidebar-width: 360px; + --qui-frontend-users-profile__content-maxWidth: 700px; + --qui-frontend-users-profile__sidebar-nav-item-outline--hover: none; + --qui-frontend-users-profile__sidebar-nav-item-bg-color--hover: transparent; } /*****************/ /* category menu */ /*****************/ .quiqqer-fupc-category { - margin-bottom: 2em; -} - -.quiqqer-fupc-category:last-child { - margin-bottom: 0; + /*margin-bottom: 2em;*/ } .quiqqer-fupc-category-header { line-height: 30px; } -.quiqqer-fupc-category .quiqqer-fupc-category-header { - border-bottom: 1px solid #ddd; - cursor: pointer; - font-size: 1.5em; - line-height: 30px; -} - -.quiqqer-fu-profile-categories-category-items { - clear: both; - float: left; - width: 100%; -} - .quiqqer-fupc-category-items-item { - border: 1px solid #ddd; - border-bottom: none; + border-top: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); + border-left: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); + border-right: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); clear: both; - color: #333; - display: flex; - float: left; - line-height: 40px; overflow: hidden; padding: 5px 0; position: relative; @@ -89,26 +55,13 @@ width: 100%; } -.quiqqer-fupc-category.quiqqer-fupc-category--open .quiqqer-fupc-category-header { - border-bottom: none !important; -} - -.quiqqer-fupc-category--open .quiqqer-fupc-category-items-item { - background: #fff; -} - -.quiqqer-fupc-category .quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item--active, -.quiqqer-fupc-category .quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item:hover { - background: #fff; -} - -.quiqqer-fupc-category--open .quiqqer-fupc-category-items-item:last-child { - border-bottom: 1px solid #ddd; +.quiqqer-fupc-category-items-item:last-child { + border-bottom: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; } -.quiqqer-fupc-category--open .quiqqer-fupc-category-items-item:first-child { +.quiqqer-fupc-category-items-item:first-child { border-top-left-radius: 5px; border-top-right-radius: 5px; } @@ -122,45 +75,21 @@ width: 0; } -.quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item--active, -.quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item:hover { - background: none; -} - -.quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item--active:before, -.quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item:hover:before { +.quiqqer-fupc-category-items-item[data-active]:before, +.quiqqer-fupc-category-items-item:is(:hover, :focus):before { width: 4px; } .quiqqer-fupc-category-items-item .fa { line-height: 40px; + width: 40px; } /***********/ /* address */ /***********/ -.quiqqer-frontend-users-address header, -.quiqqer-frontendUsers-userdata-section header { - padding: 20px 0; -} - -.quiqqer-frontend-users-address header h2, -.quiqqer-frontendUsers-userdata-section header h2 { - padding-bottom: 0; -} - -.quiqqer-frontend-users-address-edit .qui-select, -.quiqqer-frontend-users-address-edit .qui-select .drop-icon { - height: 40px; -} - -.quiqqer-frontend-users-address-edit .qui-select .text { - line-height: 40px; -} - .quiqqer-frontendUsers-userdata-invoiceaddress { border-bottom: 1px solid rgba(0, 0, 0, 0.1); - float: left; margin-bottom: 20px; padding-bottom: 20px; width: 100%; @@ -172,72 +101,10 @@ margin-right: 10px; } -.quiqqer-frontend-users-address-list-entry { - border: 1px solid #ddd; - background: #fff; -} - -.quiqqer-frontendUsers-controls-profile-categoryContent .quiqqer-frontend-users-address-list-entry-buttons button { - width: inherit; - margin-bottom: 0; -} - -.cologne-main .quiqqer-frontendUsers-userdata-address h2, -.cologne-main .quiqqer-frontendUsers-userdata-invoiceaddress h2, -.cologne-main .quiqqer-frontendUsers-userdata-invoiceaddress header, -.cologne-main .quiqqer-frontendUsers-controls-profile-changepassword h2, -.cologne-main .quiqqer-frontendUsers-controls-profile-deleteaccount h2 { - margin-top: 0; - padding-top: 0; -} - -@media (max-width: 768px) { - .quiqqer-frontendUsers-controls-profile-categories-mobile { - margin-bottom: 2em; - } - - .quiqqer-frontend-users-address-list .quiqqer-frontend-users-address-list-entry { - width: 100%; - } - - .quiqqer-frontend-users-address-list .quiqqer-frontend-users-address-list-entry:nth-child(even) { - margin-left: 0; - } - - .quiqqer-frontend-users-address-list .quiqqer-frontend-users-address-list-entry:nth-child(odd) { - margin-right: 0; - } -} - -/* email */ -.quiqqer-frontendUsers-userdata-address-additional .quiqqer-frontendUsers-userdata-email input { - float: left; - width: calc(100% - 70px); - margin-right: 10px; -} - -.quiqqer-frontendUsers-userdata-email .quiqqer-frontendUsers-userdata-email-edit { - line-height: 40px; - border-width: 1px; - border-radius: 0.25rem; -} - -@media screen and (max-width: 767px) { - .cologne-main .quiqqer-frontendUsers-controls-profile-control label { - margin-bottom: 10px; - } -} - -/**********/ -/* Avatar */ -/**********/ -.quiqqer-frontendUsers-userAvatar-gravatar { - margin: 1.5rem 0; -} - /******************/ /* profile orders */ /******************/ +/* hide top pagination */ .quiqqer-order-profile-orders .quiqqer-order-profile-orders-pagination:first-child { display: none; } @@ -252,12 +119,18 @@ :where(.loginAndRegister) .quiqqer-fu-login-container { background: #f8f8f8; - border: 1px solid #ddd; + border: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); max-width: 400px; position: relative; width: 100%; } +.loginAndRegister .quiqqer-fu-login-container-width { + width: 100%; + max-width: 400px; + margin-inline: auto; +} + :where(.loginAndRegister) .quiqqer-frontendUsers-login .quiqqer-fu-login-container { background: none; border: none; @@ -274,17 +147,18 @@ /******************/ /* reset password */ /******************/ -:where(.loginAndRegister) .quiqqer-fu-login-container .quiqqer-fu-login-forget-password-reset [name="cancel"] { +.quiqqer-fu-login-container .quiqqer-fu-login-forget-password-reset [name="cancel"] { background: none; border: none; color: inherit; - float: right; margin-top: 1rem; padding: 0; position: initial; + width: 100%; + text-align: right; } -:where(.loginAndRegister) .quiqqer-fu-login-container .quiqqer-fu-login-forget-password-reset [type="submit"] { +.quiqqer-fu-login-container .quiqqer-fu-login-forget-password-reset [type="submit"] { margin-top: 1rem; } @@ -317,8 +191,7 @@ } .loginAndRegister .quiqqer-fu-login-forget-password-reset { - padding: 1.5rem 2rem; - background: #f8f8f8; + padding-inline: 2rem; } .quiqqer-fu-registrationSignUp-terms-text [name="decline"] { diff --git a/bin/css/mini-basket.css b/bin/css/mini-basket.css index 62be613be80c3b6809a3ad75dcaa78a9a2f53787..783dff8dd47922ccebd0a9f4b7a9e1a18b7725c6 100644 --- a/bin/css/mini-basket.css +++ b/bin/css/mini-basket.css @@ -11,6 +11,7 @@ max-height: calc(100vh - 130px); /* header height + top bar height */ padding: 0 !important; width: 350px; + top: calc(var(--_qui-cologne-header-height, 100px) - 1px) !important; /* -1 because of border width */ } .quiqqer-order-basket-small-container > .qui-control { diff --git a/bin/css/order.css b/bin/css/order.css index 04032a9a245e9473b93731ad81372a543060f7b3..69c34c0e5c8304c5bec7d2d2507cffa2801c48d1 100644 --- a/bin/css/order.css +++ b/bin/css/order.css @@ -8,6 +8,15 @@ padding: 0; } +/* bad button design in this template... */ +.quiqqer-order-ordering-nobody-tabs-main__item .quiqqer-fu-login-forget-password-reset [name="cancel"], +.quiqqer-order-ordering-nobody-tabs-main__item .quiqqer-fu-login-forget-password-reset [name="cancel"]:is(:hover, :focus, :active) { + width: 100%; + background-color: transparent; + color: inherit; + border: none; +} + /****************/ /* step: basket */ /****************/ @@ -137,18 +146,28 @@ td.quiqqer-order-basket-articles-article-remove button:hover { .quiqqer-shoppingCart-basket-end, .quiqqer-order-basket-end { + --gap: 1.5rem; + background: #f8f8f8; border: 1px solid #ddd; - clear: both; margin-top: 20px; - min-height: 90px; padding: 20px; position: relative; width: 100%; + display: flex; + flex-direction: column; + gap: var(--gap); +} + +.quiqqer-order-basket-end > *:not(:first-child, :only-child) { + border-top: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); + padding-top: var(--gap); } @media screen and (max-width: 767px) { - .quiqqer-shoppingCart-basket-end, .quiqqer-order-basket-end { + .quiqqer-shoppingCart-basket-end, + .quiqqer-order-basket-end { + --gap: 1rem; padding: 10px; } } @@ -208,45 +227,7 @@ td.quiqqer-order-basket-articles-article-remove button:hover { border-bottom: 3px double #999999; } -/* coupons */ -.quiqqer-coupons-couponcodeinput-title { - display: none; -} - -input.quiqqer-coupons-couponcodeinput-input:hover, -input.quiqqer-coupons-couponcodeinput-input:focus, -input.quiqqer-coupons-couponcodeinput-input:active { - background: #fff; - border-color: #28a745; -} - -.btn.quiqqer-coupons-couponcodeinput-btn { - background: #fff; - border-color: #28a745; - color: #28a745; -} - -.btn.quiqqer-coupons-couponcodeinput-btn:hover, -.btn.quiqqer-coupons-couponcodeinput-btn:active { - background: #28a745; - color: #fff; -} - @media screen and (max-width: 767px) { - .quiqqer-coupons-couponcodeinput { - flex-wrap: wrap; - } - - .quiqqer-coupons-couponcodeinput label { - margin: 0 0 1rem 0; - width: 100%; - } - - .quiqqer-coupons-couponcodeinput input, - .btn.quiqqer-coupons-couponcodeinput-btn { - width: 100%; - } - .quiqqer-order-basket-articles-article td:before { font-weight: bold; } @@ -363,43 +344,6 @@ input.quiqqer-coupons-couponcodeinput-input:active { .quiqqer-order-ordering-buttons a { width: 100%; } - - .quiqqer-order-basket-end { - height: inherit; - padding: 1rem; - text-align: center; - } - - .quiqqer-order-basket-end > * { - display: inline-block; - float: none !important; - margin: 0 !important; - width: 100%; - } - - .quiqqer-order-basket-end > * + * { - margin-top: 20px !important; - } - - .quiqqer-payment-paypal-express { - padding: 1rem 0; - } - - .quiqqer-order-basket-end .quiqqer-coupons-couponcodeinput { - flex-direction: column; - padding: 0; - text-align: left; - } - - .quiqqer-order-basket-end .quiqqer-coupons-couponcodeinput input { - margin-bottom: 1rem; - width: 100%; - } - - .quiqqer-coupons-couponcodeinput label span { - display: block; - padding: 5px 10px; - } } /******************/ diff --git a/bin/css/style.css b/bin/css/style.css index a184fee7d9a121ce5f66d7144607513708dd4a90..4bcf1f4cb3f7785ec946c5b017dcacfdb1cbe5c7 100644 --- a/bin/css/style.css +++ b/bin/css/style.css @@ -747,7 +747,7 @@ a.toTop:before { border-bottom: 1px solid #ddd; box-shadow: 0 0 20px 0 rgba(57, 57, 57, 0); display: flex; - height: 100px; + height: var(--_qui-cologne-header-height, 100px); justify-content: space-between; left: 0; position: relative; @@ -758,8 +758,9 @@ a.toTop:before { } .cologne-header-fixed { + --_qui-cologne-header-height: 60px; + box-shadow: 0 0 20px 0 rgba(57, 57, 57, 0.2); - height: 60px; position: fixed; z-index: 100; /* Because of the search dropdown */ } @@ -927,6 +928,7 @@ a.toTop:before { .cologne-main { margin-top: 1rem; + margin-bottom: 1rem; width: 100%; } @@ -1522,6 +1524,12 @@ a.toTop:before { .cologne-login-dialog .qui-window-popup-content { padding: 20px 40px; + display: grid; + grid-template-areas: + 'logo' + 'body' + 'reset'; + grid-template-rows: auto 1fr; } .quiqqer-frontendUsers-loginWindow .quiqqer-frontendUsers-login { @@ -1614,11 +1622,12 @@ a.toTop:before { /* sing up / registration in link */ .login-popup-create-account-wrapper { - bottom: 10px; - left: 0; - position: absolute; text-align: center; width: 100%; + grid-area: reset; + margin-top: 1rem; + z-index: 1; + position: relative; } /*************************/ diff --git a/bin/css/user-orders.css b/bin/css/user-orders.css deleted file mode 100644 index 2ab49d78eb12c65ebd3678326d71c334c0dddcde..0000000000000000000000000000000000000000 --- a/bin/css/user-orders.css +++ /dev/null @@ -1,198 +0,0 @@ -section.quiqqer-order-profile-orders-order { - margin-bottom: 2em; -} - -.quiqqer-order-profile-orders-order-header-orderId { - float: left; - position: relative; - width: 25%; -} - -.quiqqer-order-profile-orders-order-header-date, -.quiqqer-order-profile-orders-order-header-total, -.quiqqer-order-profile-orders-order-header-addressInvoice, -.quiqqer-order-profile-orders-order-header-addressDelivery, -.quiqqer-order-profile-orders-order-header-orderId { - padding: 0 10px; -} - -.quiqqer-order-profile-orders-order-header-date { - padding-left: 0; -} - -.quiqqer-order-profile-orders-order-header-orderId { - padding-right: 0; -} - -.quiqqer-order-profile-orders-order-header-date > span:first-child, -.quiqqer-order-profile-orders-order-header-total > span:first-child, -.quiqqer-order-profile-orders-order-header-addressInvoice > span:first-child, -.quiqqer-order-profile-orders-order-header-addressDelivery > span:first-child, -.quiqqer-order-profile-orders-order-header-orderId > span:first-child { - display: block; -} - -/** - 1. avoid !important and increase the specificity (not good) - 2. set address position at the bottom line 100% height + 10px padding of "header" - */ -.quiqqer-order-profile-orders-order-header-addressInvoice address:is(address) { /* 1 */ - top: calc(100% + 10px); /* 2 */ -} - -.quiqqer-order-profile-orders-order-header-addressInvoice span { - align-items: center; - display: flex; - max-width: 100%; -} - -.quiqqer-order-profile-orders-order-header-addressInvoice > span > span { - display: block; - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.quiqqer-order-profile-orders-order-header-addressInvoice .fa { - margin-left: 5px; -} - -.quiqqer-order-profile-orders-order-articles { - background: #fff; -} - -.quiqqer-order-profile-orders-order-articles-article { - border-bottom: 1px dashed #ddd; - padding: 2em 0; -} - -.quiqqer-order-profile-orders-order-articles-article:last-child { - border-bottom: none; -} - -.quiqqer-order-profile-orders-order-articles-article { - align-items: start; - border-bottom: 1px dashed #ddd; - display: grid; - grid-column-gap: 20px; - grid-template-columns: 25% auto; - grid-template-rows: auto; - justify-items: start; - padding: 2em 0; -} - -.quiqqer-order-profile-orders-order-articles-image { - align-items: flex-start; - align-self: start; - border-right: 1px dashed #ddd; - display: flex; - grid-row: 1 / 5; - justify-content: center; - padding: 20px; - width: 100%; -} - -.quiqqer-order-profile-orders-order-articles-information { - padding-top: 0 !important; -} - -.quiqqer-order-profile-orders-order-articles-title { - color: inherit; - font-size: 1.75em; -} - -.quiqqer-order-profile-orders-order-articles-description { - margin: 5px 0; - color: #9ba3ad; -} - -.quiqqer-order-profile-orders-order-articles-price { - font-size: 1.2em; - font-weight: 500; - padding-bottom: 10px; -} - -.quiqqer-order-profile-orders-order-articles-rebuy { - align-self: end; -} - -/**********/ -/* footer */ -/**********/ -.quiqqer-order-profile-orders-order footer { - display: flex; - justify-content: space-between; -} - -.quiqqer-order-profile-orders-order footer .quiqqer-order-profile-orders-order-footer-paymentType { - margin-top: 0; -} - -.quiqqer-order-profile-orders-order-footer-rightWrapper { - display: flex; - align-items: center; -} - -@media (max-width: 768px) { - /***********************/ - /* article list header */ - /***********************/ - .quiqqer-order-profile-orders-order-header-date, .quiqqer-order-profile-orders-order-header-total, .quiqqer-order-profile-orders-order-header-addressInvoice, .quiqqer-order-profile-orders-order-header-addressDelivery, .quiqqer-order-profile-orders-order-header-orderId { - padding: 0; - margin-bottom: 10px; - } - - .quiqqer-order-profile-orders-order-header-orderId { - margin: 0 !important; - } - - .quiqqer-order-profile-orders-order-header-date > span:first-child, .quiqqer-order-profile-orders-order-header-total > span:first-child, .quiqqer-order-profile-orders-order-header-addressInvoice > span:first-child, .quiqqer-order-profile-orders-order-header-addressDelivery > span:first-child, .quiqqer-order-profile-orders-order-header-orderId > span:first-child { - padding-right: 5px; - } - - /****************/ - /* article list */ - /****************/ - .quiqqer-order-profile-orders-order-articles-article { - display: block; - padding: 3em 0; - } - - .quiqqer-order-profile-orders-order-articles-image { - border-bottom: 1px dashed #ddd; - border-right: none; - float: none !important; - margin: 0 0 20px 0; - } - - .quiqqer-order-profile-orders-order-articles-price { - padding-top: 10px; - } - - .quiqqer-order-profile-orders-order-articles-rebuy{ - display: block; - margin: 0 auto; - max-width: 340px; - width: 100%; - } - - /**********/ - /* footer */ - /**********/ - .quiqqer-order-profile-orders-order footer { - display: block; - } - - .quiqqer-order-profile-orders-order footer .quiqqer-order-profile-orders-order-footer-rightWrapper .btn { - padding-left: 3px; - padding-right: 3px; - } -} - -/****************/ -/* Invoice list */ -/****************/ -.quiqqer-invoice-profile-invoices-table-invoice { - background: #fff; -} \ No newline at end of file diff --git a/bin/css/variables.css b/bin/css/variables.css index 47ad80ed9784bc75d2eeaa7ea1048a4ca481ded1..77e5b4f3da49bf468ee7a6e997226c6966b82bd1 100644 --- a/bin/css/variables.css +++ b/bin/css/variables.css @@ -17,6 +17,11 @@ --bg-primary: #ddd; --bg-secondary: #f5f5f5; + --_qui-cologne-header-height: 100px; + --_qui-template-scrollMarginTop: var(--qui-template-scrollMarginTop, var(--_qui-cologne-header-height)); + + --_qui-cologne-theme-border-color: var(--qui-cologne-theme-border-color, #ddd); + --_qui-cologne-theme-border-width: var(--qui-cologne-theme-border-width, 1px); /* ecoyn / ecommerce */ --_qui-order-basket-articles-image-width: var(--qui-order-basket-articles-image-width, 100px); diff --git a/bin/javascript/init.js b/bin/javascript/init.js index 6b17cc4a84e1e3cb0202551634739cf99d82363b..aa506c199442aa2d27c95d8eb67b178263e01bc1 100644 --- a/bin/javascript/init.js +++ b/bin/javascript/init.js @@ -343,7 +343,7 @@ window.addEvent('domready', function () { 'package/quiqqer/order/bin/frontend/controls/basket/Button' ], function (Basket) { new Basket({ - open : BASKET_OPEN.toInt(), + action : BASKET_ACTION, events: { onCreate: function (Basket) { var BasketNode = Basket.getElm(), @@ -364,7 +364,7 @@ window.addEvent('domready', function () { new Element('span', { 'class': 'quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom', - html : '0' + html : '<span class="fa fa-spinner fa-spin"></span>' }).inject(BasketNode); if (BASKET_STYLE && BASKET_STYLE === 'full') { diff --git a/composer.json b/composer.json index 5689cd44fe9d0ae901bcffce55db4e49bdf0b9aa..a553c1629b6c3b9e98a69f9b0b0f92f72796d868 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "quiqqer/core": "^2", "quiqqer/erp": "^3", "quiqqer/products": "^2", - "quiqqer/order": "^2", + "quiqqer/order": "^2.7.24", "quiqqer/product-bricks": "^2", "quiqqer/frontend-users": "^2", "quiqqer/menu": "^3", @@ -28,7 +28,8 @@ "quiqqer/unsemantic": "^2", "quiqqer-asset/fastclick": "^1", "quiqqer/tooltips": "^2", - "quiqqer/currency": "^2" + "quiqqer/currency": "^2", + "quiqqer/smarty4": "^2.0.7" }, "autoload": { "psr-4": { diff --git a/events.xml b/events.xml index 10127fc14b8d3f3db37daae9c3a27d812f10e683..8551c67a5be2a654d2fde4d736fa542214e9b837 100644 --- a/events.xml +++ b/events.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <events> + <event on="onSmartyInit" fire="\QUI\TemplateCologne\EventHandler::onSmartyInit"/> <event on="onProjectConfigSave" fire="\QUI\TemplateCologne\EventHandler::onProjectConfigSave"/> <event on="onSiteSave" fire="\QUI\TemplateCologne\EventHandler::onSiteSave"/> <event on="onQuiqqer::products::product::buttons::end" diff --git a/index.html b/index.html index 055e04b41aabb06637c2c3d0ce738c007b1c4150..145eb88feaa2b6cb738da274e8ad0836ed6ed69b 100644 --- a/index.html +++ b/index.html @@ -10,16 +10,16 @@ {$Template->getHeader()} <script> - var BASKET_STYLE = "{$basketStyle}"; - var BASKET_OPEN = "{$basketOpen}"; - var INITAL_BASKET_PRICE = "{$initialBasketPrice}"; - var COUNT_LANGUAGES = "{$countLanguages}"; - var SHOW_CATEGORY_MENU = "{$showCategoryMenu}"; - var REGISTER_URL = "{$registerSiteUrl}"; - var SHOW_MENU_AFTER_SCROLL_POS = "{$showNavAfterScroll}"; // The number of pixels from top which the menu will be displayed. - var SHOW_MENU_SMOOTH = "{$showMenuSmooth}"; // if true menu slides from top (animation) - var SET_MENU_POS_BACK_ON_INIT = !!"{$setMenuPosBackOnInit}"; // if true menu slides from top (animation) - var SCROLL_OFFSET = 80; + const BASKET_STYLE = "{$basketStyle}"; + const BASKET_ACTION = "{$basketAction}"; + const INITAL_BASKET_PRICE = "{$initialBasketPrice}"; + const COUNT_LANGUAGES = "{$countLanguages}"; + const SHOW_CATEGORY_MENU = "{$showCategoryMenu}"; + const REGISTER_URL = "{$registerSiteUrl}"; + const SHOW_MENU_AFTER_SCROLL_POS = "{$showNavAfterScroll}"; // The number of pixels from top which the menu will be displayed. + const SHOW_MENU_SMOOTH = "{$showMenuSmooth}"; // if true menu slides from top (animation) + const SET_MENU_POS_BACK_ON_INIT = !!"{$setMenuPosBackOnInit}"; // if true menu slides from top (animation) + const SCROLL_OFFSET = 80; </script> {fetch template="template/head/styles.html" Template=$Template} diff --git a/index.php b/index.php index 722a87936c0c95ad8badaaab4453caa4df6f6d72..85536cdeca290224e4afa6ec85c32a8559c8a9c5 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,14 @@ <?php +/** + * cologne template file + * + * @var QUI\Projects\Project $Project + * @var QUI\Projects\Site $Site + * @var QUI\Interfaces\Template\EngineInterface $Engine + * @var QUI\Template $Template + **/ + /** * Emotion */ @@ -13,7 +22,7 @@ $templateSettings = QUI\TemplateCologne\Utils::getConfig([ 'Project' => $Project, 'Template' => $Template, - 'Site' => $Site + 'Site' => $Site ]); /** @@ -93,7 +102,7 @@ /* user avatar */ $Avatar = new QUI\FrontendUsers\Controls\UserIcon([ 'showLogout' => false, // template cologne use own logout popup (see bin/javascript/init.js) - 'User' => QUI::getUserBySession() + 'User' => QUI::getUserBySession() ]); /* product page - for layouts */ @@ -134,7 +143,7 @@ $registerSite = $Project->getSites([ 'where' => [ 'type' => [ - 'type' => 'IN', + 'type' => 'IN', 'value' => $registerSiteTypes ] ], diff --git a/layout/leftSidebar.html b/layout/leftSidebar.html index 01330cb69496f6c283a5df5385963bb24c89e58f..550431a281a04641f68b01774b3c5b21433393db 100644 --- a/layout/leftSidebar.html +++ b/layout/leftSidebar.html @@ -9,7 +9,7 @@ {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> @@ -63,7 +63,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/layout/noSidebar.html b/layout/noSidebar.html index 05b7c799c95eed67c4efc7dcfc04419ee80bf3cf..5c5e7afc273e118dc0eeaa656170d6255dad0a10 100644 --- a/layout/noSidebar.html +++ b/layout/noSidebar.html @@ -6,7 +6,7 @@ <div class="main-no-sidebar"> {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> @@ -58,7 +58,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/layout/noSidebarThin.html b/layout/noSidebarThin.html index 7eb71872aa80c259bc4669181b614b1ed8296ab6..c79001895bc003d0c76ea6d9fe522f65e72ad7e9 100644 --- a/layout/noSidebarThin.html +++ b/layout/noSidebarThin.html @@ -7,7 +7,7 @@ <div class="main-no-sidebar-thin"> {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> @@ -58,7 +58,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/layout/rightSidebar.html b/layout/rightSidebar.html index db226d4df02896b77588c73d2705f0c84babaafc..30e9a590e4a7d1f7f25220a934751a837e174fa6 100644 --- a/layout/rightSidebar.html +++ b/layout/rightSidebar.html @@ -10,7 +10,7 @@ {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> @@ -62,7 +62,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/layout/startPage.html b/layout/startPage.html index 672b17c7bf9f8f8f1f4304f29ce4b4c6a4eac70a..76256d82bb70abb625e0c291553120ed69e5ccba 100644 --- a/layout/startPage.html +++ b/layout/startPage.html @@ -6,7 +6,7 @@ <div class="main-start-page"> {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> @@ -59,7 +59,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/locale.xml b/locale.xml index 45a994ed5adabd209b40ae360bf3959591a77f7c..7b129ba8125f5170109a793ec5018cb77693638a 100644 --- a/locale.xml +++ b/locale.xml @@ -509,22 +509,26 @@ <en><![CDATA[If the option ist enabled, the product images are displayed in the shopping basket and order.]]></en> </locale> - <!-- basket open --> - <locale name="settings.shop.basketOpen"> - <de><![CDATA[Aktion bei Klick auf Warenkorb]]></de> - <en><![CDATA[What should happen when the user clicks on the shopping cart?]]></en> - </locale> - <locale name="settings.shop.basketOpen.nothing"> - <de><![CDATA[Bestellprozes nicht öffnen]]></de> - <en><![CDATA[Do not open order process]]></en> + <!-- basket action --> + <locale name="settings.shop.basketAction"> + <de><![CDATA[Aktion bei Klick auf Warenkorb-Icon]]></de> + <en><![CDATA[Shopping card action on click]]></en> + </locale> + <locale name="settings.shop.basketAction.desc"> + <de><![CDATA[Diese Option gilt nur für Desktop Ansicht. Auf mobilen Geräten wird immer zu der Bestellseite geleitet.]]></de> + <en><![CDATA[This option only applies to desktop view. On mobile devices it will always be redirected to the order process page.]]></en> + </locale> + <locale name="settings.shop.basketAction.openSmallBasket"> + <de><![CDATA[Kleinen Warenkorb öffnen]]></de> + <en><![CDATA[Open small basket]]></en> </locale> - <locale name="settings.shop.basketOpen.window"> - <de><![CDATA[Bestellprozes in einem Fenster öffnen]]></de> - <en><![CDATA[Open order process in a popup]]></en> + <locale name="settings.shop.basketAction.openOrderProcessUrl"> + <de><![CDATA[Bestellseite öffnen]]></de> + <en><![CDATA[Open order process page]]></en> </locale> - <locale name="settings.shop.basketOpen.page"> - <de><![CDATA[Zu Bestellprozess-Seite leiten]]></de> - <en><![CDATA[Go to order page]]></en> + <locale name="settings.shop.basketAction.openOrderProcess"> + <de><![CDATA[Bestellung in einem Popup Fenster öffnen]]></de> + <en><![CDATA[Open order process in a popup]]></en> </locale> <!-- hide empty fields --> <locale name="settings.shop.hideEmptyFields"> diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0fa167e4334aba70f2e8321bce11f980e22fd2f9..1339890a6e72c75d6ae49a176d1046f0c370282f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,51 +1,2 @@ parameters: - ignoreErrors: - - - message: "#^Call to an undefined method QUI\\\\Interfaces\\\\Projects\\\\Site\\:\\:getCachePath\\(\\)\\.$#" - count: 1 - path: src/QUI/TemplateCologne/Controls/Menu/Categories.php - - - - message: "#^Access to constant PRODUCT_FIELD_SHIPPING_TIME on an unknown class QUI\\\\ERP\\\\Shipping\\\\Shipping\\.$#" - count: 1 - path: src/QUI/TemplateCologne/Utils.php - - - - message: "#^Access to constant PRODUCT_FIELD_STOCK on an unknown class QUI\\\\ERP\\\\StockManagement\\\\StockManager\\.$#" - count: 1 - path: src/QUI/TemplateCologne/Utils.php - - - - message: "#^Call to method setProduct\\(\\) on an unknown class QUI\\\\ERP\\\\StockManagement\\\\Products\\\\Fields\\\\StockView\\.$#" - count: 1 - path: src/QUI/TemplateCologne/Utils.php - - - - message: "#^Call to static method getShippingTimeFrontendViewByProduct\\(\\) on an unknown class QUI\\\\ERP\\\\StockManagement\\\\StockManager\\.$#" - count: 1 - path: src/QUI/TemplateCologne/Utils.php - - - - message: "#^Method QUI\\\\TemplateCologne\\\\Utils\\:\\:getStockFrontendView\\(\\) should return QUI\\\\ERP\\\\Products\\\\Field\\\\View\\|false but returns QUI\\\\ERP\\\\StockManagement\\\\Products\\\\Fields\\\\StockView\\.$#" - count: 1 - path: src/QUI/TemplateCologne/Utils.php - - - - message: "#^PHPDoc tag @var for variable \\$StockView contains unknown class QUI\\\\ERP\\\\StockManagement\\\\Products\\\\Fields\\\\StockView\\.$#" - count: 1 - path: src/QUI/TemplateCologne/Utils.php - - - - message: "#^PHPDoc tag @var has invalid value \\(\\$Site Site\\)\\: Unexpected token \"\\$Site\", expected type at offset 9$#" - count: 1 - path: src/QUI/TemplateCologne/Utils.php - - - - message: "#^Variable \\$Project might not be defined\\.$#" - count: 2 - path: src/QUI/TemplateCologne/settings.css.php - - - - message: "#^Variable \\$Site might not be defined\\.$#" - count: 1 - path: src/QUI/TemplateCologne/settings.css.php + ignoreErrors: \ No newline at end of file diff --git a/quiqqer/quiqqer/lib/templates/mail/body.html b/quiqqer/core/src/templates/mail/body.html similarity index 100% rename from quiqqer/quiqqer/lib/templates/mail/body.html rename to quiqqer/core/src/templates/mail/body.html diff --git a/quiqqer/quiqqer/lib/templates/mail/footer.html b/quiqqer/core/src/templates/mail/footer.html similarity index 100% rename from quiqqer/quiqqer/lib/templates/mail/footer.html rename to quiqqer/core/src/templates/mail/footer.html diff --git a/quiqqer/quiqqer/lib/templates/mail/header.html b/quiqqer/core/src/templates/mail/header.html similarity index 100% rename from quiqqer/quiqqer/lib/templates/mail/header.html rename to quiqqer/core/src/templates/mail/header.html diff --git a/quiqqer/quiqqer/lib/templates/mail/meta.html b/quiqqer/core/src/templates/mail/meta.html similarity index 100% rename from quiqqer/quiqqer/lib/templates/mail/meta.html rename to quiqqer/core/src/templates/mail/meta.html diff --git a/quiqqer/frontend-users/src/QUI/FrontendUsers/Controls/Profile.html b/quiqqer/frontend-users/src/QUI/FrontendUsers/Controls/Profile.html index 171be08ad675a35234fb4c90c5693fa60269e054..97ec34219646155d2153a7f58c9eb9889db76800 100644 --- a/quiqqer/frontend-users/src/QUI/FrontendUsers/Controls/Profile.html +++ b/quiqqer/frontend-users/src/QUI/FrontendUsers/Controls/Profile.html @@ -1,76 +1,87 @@ {if !$Category} -<p> - {locale group="quiqqer/frontend-users" var="profile.no_categories_available"} -</p> + <div class="quiqqer-frontendUsers-controls-profile__noCategoriesInfo"> + <p> + {locale group="quiqqer/frontend-users" var="profile.no_categories_available"} + </p> + </div> {else} + <div class="quiqqer-frontendUsers-controls-profile__sidebar"> + {if $this->getAttribute('menu')} + <div class="quiqqer-frontendUsers-controls-profile-categories"> -{if $this->getAttribute('menu')} -<div class="quiqqer-frontendUsers-controls-profile-categories"> - - <div class="quiqqer-fupc-userinfo"> - {control control="QUI\TemplateCologne\Controls\SimpleUserInfo" assign=SimpleUserInfo} - {$SimpleUserInfo->create()} - </div> + <div class="quiqqer-fupc-userinfo"> + {control control="QUI\TemplateCologne\Controls\SimpleUserInfo" assign=SimpleUserInfo} + {$SimpleUserInfo->create()} + </div> - {foreach $categories as $category} - <div class="quiqqer-fupc-category quiqqer-fupc-category--open" - data-category="{$category.name}" - > - <div class="quiqqer-fupc-category-header"> - {$category.title} - </div> - <div class="quiqqer-fu-profile-categories-category-items"> - {foreach $category.items as $setting} + {foreach $categories as $category} + <div class="quiqqer-fupc-category" + data-category="{$category.name}" + data-name="nav-category" + data-open="1" + > + <div class="quiqqer-fupc-category-header" data-name="header"> + <span class="quiqqer-fupc-category-header__text">{$category.title}</span> + <span class="fa-solid fa-angle-right quiqqer-fupc-category-header__icon" data-name="opener"></span> + </div> + <div class="quiqqer-fu-profile-categories-category-items"> + {foreach $category.items as $setting} + {assign var=active value=false} + {if $currentCategory == $category.name && $currentSetting == $setting.name} + {assign var=active value=true} + {/if} + <a href="{$Site->getUrlRewritten()}/{$category.name}/{$setting.name}" + class="quiqqer-fupc-category-items-item" + {if $active}data-active{/if} + data-name="nav-category-item" + data-setting="{$setting.name}" + > + {if $setting.icon} + <span class="fa-fw quiqqer-fupc-category-items-item-icon {$setting.icon}"></span> + {/if} + <span>{$setting.title}</span> + </a> + {/foreach} + </div> + </div> + {/foreach} + </div> + {/if} - {assign var=active value=""} - {if $currentCategory == $category.name && $currentSetting == $setting.name} - {assign var=active value=" quiqqer-fupc-category-items-item--active"} - {/if} - <a href="{$Site->getUrlRewritten()}/{$category.name}/{$setting.name}" - class="quiqqer-fupc-category-items-item{$active}" - data-setting="{$setting.name}" - > - {if $setting.icon} - <span class="quiqqer-fupc-category-items-item-icon {$setting.icon}"></span> - {/if} - <span>{$setting.title}</span> - </a> - {/foreach} - </div> + {* mobile categories *} + <form action="" method="post" class="quiqqer-frontendUsers-controls-profile-categories-mobile"> + <label class="quiqqer-frontendUsers-controls-profile-categories-mobile-label"> + <select name="profile-categories-mobile"> + {foreach $categories as $category} + <optgroup label="{$category.title}"> + {foreach $category.items as $setting} + {assign var=active value=""} + {if $currentCategory == $category.name && $currentSetting == $setting.name} + {assign var=active value="selected"} + {/if} + <option value="{$category.name}:{$setting.name}" {$active}> + {$setting.title} + </option> + {/foreach} + </optgroup> + {/foreach} + </select> + </label> + </form> </div> - {/foreach} -</div> -{/if} - -<form action="" method="post"> - <label class="quiqqer-frontendUsers-controls-profile-categories-mobile"> - <select name="profile-categories"> - {foreach $categories as $category} - <optgroup label="{$category.title}"> - {foreach $category.items as $setting} - {assign var=active value=""} - {if $currentCategory== $category.name} - {assign var=active value=" selected"} - {/if} - <option value="{$category.name}:{$setting.name}"{$active}> - {$setting.title} - </option> - {/foreach} - </optgroup> - {/foreach} - </select> - </label> -</form> -<form class="quiqqer-frontendUsers-controls-profile-categoryContent" - method="post" - action="" - data-category="{$currentCategory}" - data-setting="{$currentSetting}" -> - <div class="quiqqer-frontendUsers-controls-profile-categoryContentAnimation"> - {$Category->create()} - <input type="hidden" name="profile-save" value="1"> + <div class="quiqqer-frontendUsers-controls-profile__content"> + <form class="quiqqer-frontendUsers-controls-profile-categoryContent" + data-name="form" + method="post" + action="" + data-category="{$currentCategory}" + data-setting="{$currentSetting}" + > + <div class="quiqqer-frontendUsers-controls-profile-categoryContentAnimation" data-name="content-animated"> + {$Category->create()} + <input type="hidden" name="profile-save" value="1"> + </div> + </form> </div> -</form> {/if} \ No newline at end of file diff --git a/quiqqer/order/src/QUI/ERP/Order/Controls/Basket/Basket.html b/quiqqer/order/src/QUI/ERP/Order/Controls/Basket/Basket.html index d06d5283ad797a814d8ad2b7054c5a05d84d6630..8414d1f68fb53922608a6efd655680e32fd06004 100644 --- a/quiqqer/order/src/QUI/ERP/Order/Controls/Basket/Basket.html +++ b/quiqqer/order/src/QUI/ERP/Order/Controls/Basket/Basket.html @@ -231,11 +231,23 @@ {elseif $this->isGuest() && $this->isLoading()} <div class="quiqqer-order-basket-isLoading"> - <span class="fa fa-spinner fa-spin"></span> + <div class="quiqqer-order-basket-isLoading__inner"> + <span class="fa fa-circle-notch fa-spin"></span> + </div> </div> {else} <div class="quiqqer-order-basket-isEmpty"> - {locale group="quiqqer/order" var="message.basket.is.empty"} + <div class="quiqqer-order-basket-isEmpty__iconContainer"> + <div class="decorative-element"> + <div class="decorative-element__line decorative-element__line--1 animation"></div> + <div class="decorative-element__line decorative-element__line--2 animation"></div> + <div class="decorative-element__line decorative-element__line--3 animation"></div> + </div> + <i class="fa-solid fa-cart-shopping quiqqer-order-basket-isEmpty__icon animation"></i> + </div> + <div class="quiqqer-order-basket-isEmpty__text animation"> + {locale group="quiqqer/order" var="message.basket.is.empty"} + </div> </div> {/if} diff --git a/quiqqer/order/src/QUI/ERP/Order/FrontendUsers/Controls/UserOrders.Order.html b/quiqqer/order/src/QUI/ERP/Order/FrontendUsers/Controls/UserOrders.Order.html deleted file mode 100644 index 49f018d1d96cac09af9b544848536e6f61537183..0000000000000000000000000000000000000000 --- a/quiqqer/order/src/QUI/ERP/Order/FrontendUsers/Controls/UserOrders.Order.html +++ /dev/null @@ -1,87 +0,0 @@ -<section class="quiqqer-order-profile-orders-order"> - <header> - <div class="quiqqer-order-profile-orders-order-header-date"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.date"}</span> - <span>{$Order->getCreateDate()}</span> - </div> - - <div class="quiqqer-order-profile-orders-order-header-total"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.total"}</span> - <span>{$order.calculations.display_sum}</span> - </div> - - <div class="quiqqer-order-profile-orders-order-header-addressInvoice"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.invoiceAddress"}</span> - {if $Invoice} - {assign var=Customer value=$Invoice->getCustomer()} - {else} - {assign var=Customer value=$Order->getCustomer()} - {/if} - - {assign var=Address value=$Customer->getAddress()} - {$Address->render(['tel' => false, 'mail' => false])} - <span> - <span>{$Address->getName()}</span> - <span class="fa fa-angle-down"></span> - </span> - </div> - - <div class="quiqqer-order-profile-orders-order-header-orderId"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.orderNo"}</span> - <a href="{$Utils->getOrderUrl($Project, $Order)}" - target="_blank" - data-hash="{$Order->getHash()}" - title="{locale group='quiqqer/order' var='control.order.details.title'}" - > - {$Order->getId()} - </a> - </div> - </header> - - <div class="quiqqer-order-profile-orders-order-articles"> - {foreach $articles as $Article} - {$this->renderArticle($Article)} - {/foreach} - </div> - - <footer> - <div class="quiqqer-order-profile-orders-order-footer-leftWrapper"> - {if $Payment} - <div class="quiqqer-order-profile-orders-order-footer-paymentType"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.paymentMethod"}:</span> - <span>{$Payment->getTitle()}</span> - </div> - {/if} - - {if isset($orderStatus)} - <div class="quiqqer-order-profile-orders-order-footer-orderStatus"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.orderStatus"}:</span> - <span>{$orderStatus}</span> - </div> - {/if} - - {if !empty($shippingStatus)} - <div class="quiqqer-order-profile-orders-order-footer-shipping"> - <span class="text-muted text-small">{locale group="quiqqer/shipping" var="control.profile.orders.shipping"}:</span> - <span>{$shippingStatus}</span> - </div> - {/if} - </div> - - <div class="quiqqer-order-profile-orders-order-footer-rightWrapper"> - {if $Order->isPosted() && $Order->getInvoiceType() === 'QUI\ERP\Accounting\Invoice\Invoice'} - <a href="{$Order->getAttribute('downloadLink')}" target="_blank" - class="btn btn-link-dark"> - <span class="fa fa-file-pdf-o"></span> - <span>{locale group="quiqqer/order" var="control.profile.orders.order.invoice"}</span> - </a> - {else if !$Order->isSuccessful()} - <a href="{$orderUrl}" target="_blank" - class="btn btn-link-dark"> - <span class="fa fa-shopping-basket"></span> - <span>{locale group="quiqqer/order" var="control.profile.orders.order.continuePayment"}</span> - </a> - {/if} - </div> - </footer> -</section> diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListDetails.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListDetails.html index 5d4512556fa0a530d0a4aee710e2eaf8d2408a57..770df2cf286a0c4f5b2f6c14c316492201d8d889 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListDetails.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListDetails.html @@ -42,7 +42,7 @@ {/if} {if $Project->getConfig('templateCologne.settings.categoryShowStock')} - {assign var=ShippingTimeFrontendView value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + {assign var=ShippingTimeFrontendView value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} <div class="cologne-productList-product-details-content-shippingTime"> {$ShippingTimeFrontendView->create()} diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListGallery.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListGallery.html index 38f84d0d3483627e259783f59e58f1077b220b2f..c1d5c724413a24cd031951993871c68c8829d362 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListGallery.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListGallery.html @@ -36,7 +36,7 @@ </div> {if $Project->getConfig('templateCologne.settings.categoryShowStock')} - {assign var=ShippingTimeFrontendView value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + {assign var=ShippingTimeFrontendView value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} <div class="cologne-products-productGallery-products-product-price-shippingTime"> {$ShippingTimeFrontendView->create()} diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListList.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListList.html index 050380ea1ff62d5a9ab53ed10ff3dedad0b4d4a7..67133125fdbd0da2ab172702026a924a117f9efb 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListList.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListList.html @@ -16,7 +16,7 @@ </div> {if $Project->getConfig('templateCologne.settings.categoryShowStock')} - {assign var=ShippingTimeFrontendView value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + {assign var=ShippingTimeFrontendView value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} <div class="quiqqer-productList-product-list-text-shippingTime"> {$ShippingTimeFrontendView->create()} diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Products/Product.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Products/Product.html index 8842cc5a4102fa5eeb80ccdbb10cf467094f995d..1adeb7c6a2570c0cab69732aa87298e87b7417ae 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Products/Product.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Products/Product.html @@ -69,12 +69,12 @@ {/foreach} {assign var=ShippingTimeFrontendView - value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} {$ShippingTimeFrontendView->create()} {/if} - {assign var=StockFrontendView value=\QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())} + {assign var=StockFrontendView value=QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())} {if $StockFrontendView} {$StockFrontendView->create()} {/if} diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Products/ProductVariant.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Products/ProductVariant.html index 22ca1931ee078443700f88765bfd9a6d915f30fc..f8cb2e9f42d4db52a69213ff5a03ab190a5eac4f 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Products/ProductVariant.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Products/ProductVariant.html @@ -52,12 +52,12 @@ {/foreach} {assign var=ShippingTimeFrontendView - value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} {$ShippingTimeFrontendView->create()} {/if} - {assign var=StockFrontendView value=\QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())} + {assign var=StockFrontendView value=QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())} {if $StockFrontendView} {$StockFrontendView->create()} {/if} diff --git a/settings.xml b/settings.xml index 3f0a34b1a347e13ebf3bd208cf94519132e3f173..36dacb1d26bd18c4f35f0db144ac5a984da19160 100644 --- a/settings.xml +++ b/settings.xml @@ -40,9 +40,9 @@ <type><![CDATA[bool]]></type> <defaultvalue>1</defaultvalue> </conf> - <conf name="basketOpen"> - <type><![CDATA[integer]]></type> - <defaultvalue>2</defaultvalue> + <conf name="basketAction"> + <type><![CDATA[string]]></type> + <defaultvalue>openSmallBasket</defaultvalue> </conf> <conf name="hideEmptyFields"> <type><![CDATA[bool]]></type> @@ -454,27 +454,35 @@ </description> </input> - <!-- basket open (nothing order window, order page)--> - <select conf="templateCologne.settings.basketOpen"> + + + + <!-- basket action (openSmallBasket, openOrderProcessUrl, openOrderProcess (qui popup))--> + <select conf="templateCologne.settings.basketAction"> <text> <locale group="quiqqer/template-cologne" - var="settings.shop.basketOpen" + var="settings.shop.basketAction" /> </text> + <description> + <locale group="quiqqer/template-cologne" + var="settings.shop.basketAction.desc" + /> + </description> - <option value="0"> + <option value="openSmallBasket"> <locale group="quiqqer/template-cologne" - var="settings.shop.basketOpen.nothing" + var="settings.shop.basketAction.openSmallBasket" /> </option> - <option value="1"> + <option value="openOrderProcessUrl"> <locale group="quiqqer/template-cologne" - var="settings.shop.basketOpen.window" + var="settings.shop.basketAction.openOrderProcessUrl" /> </option> - <option value="2"> + <option value="openOrderProcess"> <locale group="quiqqer/template-cologne" - var="settings.shop.basketOpen.page" + var="settings.shop.basketAction.openOrderProcess" /> </option> </select> diff --git a/src/QUI/TemplateCologne/Controls/Menu/Categories.php b/src/QUI/TemplateCologne/Controls/Menu/Categories.php index eadc91cc168a063974d3fb9c43f8414610144ae3..ab3af91956ac264d5c19a97af0b18dfb6e191153 100644 --- a/src/QUI/TemplateCologne/Controls/Menu/Categories.php +++ b/src/QUI/TemplateCologne/Controls/Menu/Categories.php @@ -72,10 +72,14 @@ public function getBody(): string } $cache = EventHandler::menuCacheName() . '/megaMenu/'; + $cachePah = ''; + + if (method_exists($this->getSite(), 'getCachePath')) { + $cachePah = $this->getSite()->getCachePath(); + } $cache .= md5( - $this->getSite()->getCachePath() . - serialize($this->getAttributes()) + $cachePah . serialize($this->getAttributes()) ); try { diff --git a/src/QUI/TemplateCologne/EventHandler.php b/src/QUI/TemplateCologne/EventHandler.php index f34b098703a955a3a6216b818ef4a37440793d26..f7544fbb2fd7b685232102259f5d8a6d8c36ca07 100644 --- a/src/QUI/TemplateCologne/EventHandler.php +++ b/src/QUI/TemplateCologne/EventHandler.php @@ -7,6 +7,7 @@ namespace QUI\TemplateCologne; use QUI; +use Smarty; use QUI\ERP\Products\Product\ViewFrontend; use QUI\Smarty\Collector; @@ -71,4 +72,17 @@ public static function onQuiqqerProductsProductButtonsEnd( </div>' ); } + + /** + * Event: on smarty init + * + * @param Smarty $Smarty + * @return void + */ + public static function onSmartyInit(Smarty $Smarty): void + { + $Smarty->registerClass('QUI\TemplateCologne\Utils', '\QUI\TemplateCologne\Utils'); + $Smarty->registerClass('QUI\Bricks\Manager', '\QUI\Bricks\Manager'); + $Smarty->registerClass('QUI\ERP\Products\Utils\Products', '\QUI\ERP\Products\Utils\Products'); + } } diff --git a/src/QUI/TemplateCologne/Utils.php b/src/QUI/TemplateCologne/Utils.php index bfa1bfa51a30193db9b6b0bb8fa0a99254ff8111..14d62f549aa728608fa92730fd1a180459768fca 100644 --- a/src/QUI/TemplateCologne/Utils.php +++ b/src/QUI/TemplateCologne/Utils.php @@ -11,8 +11,8 @@ use QUI\ERP\Shipping\Shipping; use QUI\ERP\StockManagement\StockManager; use QUI\Projects\Project; -use QUI\Projects\Site; use QUI\TemplateCologne\Controls\Payments; +use ReflectionClass; use function class_exists; use function count; @@ -32,7 +32,7 @@ class Utils * @throws QUI\Exception * */ - public static function getAvatar(mixed $User): QUI\Projects\Media\Image|bool + public static function getAvatar(mixed $User): QUI\Projects\Media\Image | bool { if (!$User instanceof QUI\Interfaces\Users\User) { throw new QUI\Exception([ @@ -73,15 +73,10 @@ public static function getAvatar(mixed $User): QUI\Projects\Media\Image|bool * @return array|bool|object|string * @throws QUI\Exception */ - public static function getConfig(array $params): object|array|bool|string + public static function getConfig(array $params): object | array | bool | string { - /** @var $Site Site */ $Site = $params['Site']; - - /* @var $Project Project */ $Project = $params['Project']; - - /* @var $Project QUI\Template */ $Template = $params['Template']; $cacheName = md5($Site->getId() . $Project->getName() . $Project->getLang()); @@ -237,13 +232,10 @@ public static function getConfig(array $params): object|array|bool|string } // basket open - $basketOpen = 2; + $basketAction = $Project->getConfig('templateCologne.settings.basketAction'); - switch ($Project->getConfig('templateCologne.settings.basketOpen')) { - case '0': - case '1': - case '2': - $basketOpen = $Project->getConfig('templateCologne.settings.basketOpen'); + if (!in_array($basketAction, ['openSmallBasket', 'openOrderProcessUrl', 'openOrderProcess'])) { + $basketAction = 'openSmallBasket'; } $settingsCSS = include 'settings.css.php'; @@ -355,7 +347,7 @@ public static function getConfig(array $params): object|array|bool|string $config['siteType'] = $siteType; $config['pageCustomClass'] = $pageCustomClass; $config['basketStyle'] = $basketStyle; - $config['basketOpen'] = $basketOpen; + $config['basketAction'] = $basketAction; $config['showCategoryMenu'] = $showCategoryMenu; $config['homeLink'] = $homeLink; $config['homeLinkText'] = $homeLinkText; @@ -602,7 +594,7 @@ private static function getPredefinedFooter(Project $Project): array * * @return false|QUI\ERP\Products\Field\View */ - public static function getShippingTimeFrontendView(int $productId) + public static function getShippingTimeFrontendView(int $productId): bool | QUI\ERP\Products\Field\View { try { $Product = QUI\ERP\Products\Handler\Products::getProduct($productId); @@ -612,7 +604,7 @@ public static function getShippingTimeFrontendView(int $productId) return false; } - if (QUI::getPackageManager()->isInstalled('quiqqer/stock-management')) { + if (class_exists('QUI\ERP\StockManagement\StockManager')) { return StockManager::getShippingTimeFrontendViewByProduct($Product); } @@ -620,6 +612,16 @@ public static function getShippingTimeFrontendView(int $productId) return false; } + if (!class_exists('QUI\ERP\Shipping\Shipping')) { + return false; + } + + $reflection = new ReflectionClass(Shipping::class); + + if (!$reflection->hasConstant('PRODUCT_FIELD_SHIPPING_TIME')) { + return false; + } + try { $ShippingField = $Product->getField(Shipping::PRODUCT_FIELD_SHIPPING_TIME); } catch (\Exception $Exception) { @@ -659,6 +661,10 @@ public static function getStockFrontendView(int $productId) return false; } + if (!class_exists('QUI\ERP\StockManagement\StockManager')) { + return false; + } + try { $Product = QUI\ERP\Products\Handler\Products::getProduct($productId); $StockField = $Product->getField(StockManager::PRODUCT_FIELD_STOCK); @@ -668,7 +674,6 @@ public static function getStockFrontendView(int $productId) return false; } - /** @var QUI\ERP\StockManagement\Products\Fields\StockView $StockView */ $StockView = $StockField->getFrontendView(); if (method_exists($StockView, 'setProduct')) { @@ -712,7 +717,7 @@ public static function convertBrickCSSClass(array $classes): string * @param string $settingName * @return bool|array|int|string */ - public static function getSetting(string $settingName): bool|array|int|string + public static function getSetting(string $settingName): bool | array | int | string { if (empty($settingName)) { return false; diff --git a/src/QUI/TemplateCologne/settings.css.php b/src/QUI/TemplateCologne/settings.css.php index 9953e255331aedca58a2bcb56ac9c9359ea10e9e..965553d6978bce1e0f686addb2030a79c0e7dcda 100644 --- a/src/QUI/TemplateCologne/settings.css.php +++ b/src/QUI/TemplateCologne/settings.css.php @@ -1,4 +1,12 @@ <?php +/** + * cologne template file + * + * @var QUI\Projects\Project $Project + * @var QUI\Projects\Site $Site + * @var QUI\Interfaces\Template\EngineInterface $Engine + * @var QUI\Template $Template + **/ $largeSpacing = $Site->getAttribute('templateCologne.largeSpacing'); $headerImagePosition = $Project->getConfig('templateCologne.settings.headerImagePosition'); @@ -7,7 +15,6 @@ ob_start(); ?> - <?php if ($largeSpacing) { ?> /* more spacing */ .page-content-header, diff --git a/template/head/styles.html b/template/head/styles.html index 2a1952737c404af4029d7e28ca2c129a6630eb6a..9a0379881bec11c9b7aafe045cb76ae2d8805f0a 100644 --- a/template/head/styles.html +++ b/template/head/styles.html @@ -13,7 +13,6 @@ <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/products.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/frontend-users.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/order.css')}"/> -<link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/user-orders.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/controls.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/mini-basket.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/product-bricks.css')}"/> diff --git a/template/menu/menuSuffix.html b/template/menu/menuSuffix.html index 5f7f6b32c9121dc08784540080a07792aaf11386..248a899f455c3967195c406d2085f9163be3bd8b 100644 --- a/template/menu/menuSuffix.html +++ b/template/menu/menuSuffix.html @@ -10,14 +10,18 @@ <button disabled class="quiqqer-order-basketButton button--callToAction tpl-btn basket-style-{$basketStyle}" style="float: right;"><span class="quiqqer-order-basketButton-icon-custom"><span class="fa fa-shopping-basket"></span></span><span - class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom">0</span></button> + class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom"> + <span class="fa fa-spinner fa-spin"></span> + </span></button> {else} <button disabled class="quiqqer-order-basketButton button--callToAction tpl-btn basket-style-full" style="float: right;"> <span class="quiqqer-order-basketButton-icon-custom"> <span class="fa fa-shopping-basket"></span> </span> - <span class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom">0</span> + <span class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom"> + <span class="fa fa-spinner fa-spin"></span> + </span> <span class="quiqqer-order-basketButton-sum"> {*$InitialBasketPrice->getDisplayPrice()*} {$initialBasketPrice} diff --git a/template/page.html b/template/page.html index ba86b13999e9cb774a79886fb8183eba571136fd..6af211ab19eafb1b8c2de83556c27d6790d350e3 100644 --- a/template/page.html +++ b/template/page.html @@ -25,7 +25,7 @@ {assign var=brickNoPadding value="brick-no-spacing"} {/if} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-headerSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-container template-grid-row {$brickFullWidth} {$brickNoPadding}"> @@ -54,7 +54,7 @@ {assign var=brickNoPadding value="brick-no-spacing"} {/if} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-footerPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-container template-grid-row {$brickFullWidth} {$brickNoPadding}">