Add new payment and shipping parsers for various integrations

- Implemented Google Pay parser in bongooglepay.js
- Added Buckaroo 3 payment parser in buckaroo3.js
- Introduced DataTrans CW Mastercard parser in datatranscw.js
- Created DataTrans CW Credit Card parser in datatranscw_creditcard.js
- Developed DHL Assistant shipping parser in dhlassistant.js
- Added Estimated Delivery parser in estimateddelivery.js
- Implemented Floapay payment parser in floapay.js
- Created FS Pickup at Store shipping parser in fspickupatstore.js
- Developed Generic Iframe parser in generic_iframe_parser.js
- Added Geodis Officiel shipping parser in geodisofficiel.js
- Implemented Glob Kurier module shipping parser in globkuriermodule.js
- Created Latvija Post Express Pickup Terminal parser in latvijaspastsexpresspastspostterminalslv.js
- Developed LP Shipping parser in lpshipping.js
- Added Mijora Venipak parser in mijoravenipak.js
- Implemented Apple Pay parser in pm_applepay.js
- Created Przelewy24 payment parser in przelewy24.js
- Developed Pshugls shipping parser in pshugls.js
- Added Redsys Insite payment parser in redsysinsite.js
- Implemented Tpay payment parser in tpay.js
- Updated third-party integration documentation for FedEx DotCom
This commit is contained in:
2025-08-04 23:10:27 +02:00
parent 037a6c5551
commit d39433f0d4
125 changed files with 4986 additions and 1772 deletions

View File

@@ -20,9 +20,10 @@
color: #a458ff;
}
.page-content .checkout-block .inner-area .offer-login a,
body#checkout .page-content .checkout-block .inner-area .offer-login a,
.checkout-block .inner-area .offer-login a:hover,
.has-discount .discount {
.has-discount .discount,
.reassurance-section>.icon::after {
background-color: #a458ff;
}

View File

@@ -69,12 +69,14 @@
}
.is-empty-cart #tc-container,
.is-empty-cart #tc-container-mobile {
.is-empty-cart #tc-container-mobile,
.is-empty-cart .prev-next-container {
display: none;
}
.checkout-block {
margin: 0;
padding: 10px 3px;
}
.checkout-block .inner-area {
@@ -221,15 +223,15 @@ a.custom-link:hover {
border-bottom: 1px solid #2fb5d2;
}
.business-customer,
.private-customer {
padding: 0 0 15px;
}
//.business-customer,
//.private-customer {
// padding: 0 0 15px;
//}
// put .private-customer checkbox closer to .business-customer if both are visible
.business-customer ~ .private-customer {
margin-top: -15px;
}
//.business-customer ~ .private-customer {
// margin-top: -15px;
//}
#i_am_business[disabled=disabled], #i_am_business[disabled=disabled] ~ label,
#i_am_private[disabled=disabled], #i_am_private[disabled=disabled] ~ label {
@@ -296,7 +298,8 @@ form.hidden {
}
.card-block.block-promo {
padding: 10px 0;
padding-top: 0;
padding-bottom: 0;
}
.cart-grid.row {
@@ -384,6 +387,20 @@ div#thecheckout-address-invoice {
margin: -2px 0 20px;
}
.notice-msg {
text-align: left;
font-style: italic;
background: #fcffe7;
color: green;
padding: 10px 5px;
margin: -2px 0 20px;
}
// Do not display notice if error is shown on the same field
.-error.-notice ~ .notice-msg {
display: none;
}
.error-msg.visible {
display: block;
}
@@ -393,6 +410,11 @@ div#thecheckout-address-invoice {
margin-top: 1px;
}
.-error > .error-msg {
display: block;
margin-top: 1px;
}
.error-msg #sign-in-link {
margin: 0 10px;
padding: 0 3px;
@@ -414,6 +436,7 @@ body#checkout span.custom-checkbox,
body#checkout span.custom-checkbox span {
position: relative;
//flex: unset;
margin-top: 0.15rem;
}
body#checkout .custom-checkbox span.label {
@@ -423,19 +446,6 @@ body#checkout .custom-checkbox span.label {
flex-grow: 1;
}
body#checkout span.custom-checkbox > label,
body#checkout .condition-label{
padding-left: 0;
margin-top: 0.1rem;
}
@supports (display: flex) {
span.custom-checkbox {
display: flex;
align-items: flex-start;
}
}
#conditions-to-approve span.custom-checkbox,
#conditions-to-approve ul,
.condition-label {
@@ -488,10 +498,6 @@ span.custom-radio {
margin-top: 5px;
}
.custom-checkbox span.label {
text-align: left;
}
.payment-option-fee.hidden {
display: none;
}
@@ -562,43 +568,77 @@ button#confirm_order:disabled {
.delivery-option > label > .row {
margin: 0;
text-align: left;
display: block;
}
.delivery-option > label > .row > div > .row > div {
padding: 0;
}
.delivery-option-detail > .row {
display: flex;
}
.delivery-option > label,
.payment-option > label{
margin-bottom: 0;
display: flex;
align-items: center;
}
.payment-option, .delivery-option {
padding-top: 5px;
padding-bottom: 5px;
}
.delivery-option-detail {
display: flex;
flex-grow: 1;
margin: 0;
position: relative;
}
.delivery-option-logo img {
max-height: 100%;
max-width: ~"calc(100% - 10px)"; // because of Less syntax
margin-right: 10px;
}
// Absolute positioned shipping logo (to save space) - replaced on 8.11.2023 with logo on the left
//.delivery-option .delivery-option-logo img {
// max-height: 100%;
// max-width: 100%;
// margin-left: 10px;
//}
//.delivery-option-label.has-logo {
// .delivery-option-name, .delivery-option-delay {
// margin-right: 50px;
// }
//}
.delivery-option-logo {
position: absolute;
right: 10px;
width: 50px;
height: 50px;
max-width: 70px;
}
.delivery-option .delivery-option-logo img {
max-height: 100%;
max-width: 100%;
margin-left: 10px;
}
.delivery-option-label.has-logo {
.delivery-option-name, .delivery-option-delay {
margin-right: 50px;
.delivery-option-price {
&.free {
.carrier-price-with-tax-formatted {
display: none;
}
}
&:not(.free) {
.carrier-price {
display: none;
}
}
}
.delivery-option-price .carrier-price-without-tax-formatted {
display: none;
}
.delivery-option-detail .name-and-delay {
flex-grow: 1;
}
.delivery-options .row.delivery-option {
margin: 0;
line-height: 1.5;
display: flex;
flex-wrap: wrap;
flex-wrap: nowrap;
}
label.delivery-option-label {
@@ -989,23 +1029,18 @@ label.required:before {
.already-account-label {
flex-basis: 100%;
color: #000;
}
.classic-login, .social-login {
display: inline-block;
position: relative;
}
.social-login {
padding-top: 25px
}
.classic-login {
margin-left: 20px;
display: flex;
flex-direction: column;
justify-content: center;
padding-left: 125px;
}
/**
@@ -1111,7 +1146,7 @@ label.required:before {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
opacity: 0.8;
//opacity: 0.8;
display: none;
}
@@ -1136,7 +1171,7 @@ span.social-logo > span {
.tc-social-login-btn .social-logo {
position: absolute;
display: inline-block;
border-right: 1px solid rgba(0, 0, 0, 0.2);
//border-right: 1px solid rgba(0, 0, 0, 0.2);
left: 0;
padding: 6px 6px 6px 5px;
top: 1px;
@@ -1174,37 +1209,41 @@ span.social-logo > span {
}
/* Social style: Light */
.social-btn-style-light .google-logo {
.tc-social-login-btn .google-logo {
.google-logo-official;
}
.social-btn-style-light .facebook-logo {
.tc-social-login-btn .facebook-logo {
.facebook-logo-official;
}
.social-btn-style-light #tc-facebook-signin {
.tc-social-login-btn #tc-facebook-signin {
background-color: white;
}
.social-btn-style-light #tc-facebook-signin:hover {
background-color: #eee;
#tc-facebook-signin:hover {
border-color: #d2e3fc;
background-color: #f8faff;
}
.social-btn-style-light #tc-google-signin {
.tc-social-login-btn #tc-google-signin {
background-color: white;
}
.social-btn-style-light #tc-google-signin:hover {
.tc-social-login-btn #tc-google-signin:hover {
background-color: #eee;
}
.social-btn-style-light .tc-social-login-btn {
color: #666;
border: 1px solid #ccc;
padding: 10px 11px 9px 45px;
.tc-social-login-btn {
color: #3c4043;
border: 1px solid #dadce0;
padding: 10px 11px 9px 40px;
font-size: 12px;
font-family: "Roboto", sans-serif;
font-weight: 500;
}
.social-btn-style-light .tc-social-login-btn .social-logo {
.tc-social-login-btn .social-logo {
padding: 8px 7px 7px 8px
}
@@ -1311,7 +1350,7 @@ span.social-logo > span {
background: #e9e9e9;
box-shadow: 0 4px 4px -4px #9b9b9b;
border-radius: 5px;
margin: -4px;
margin: 0 -4px;
}
.popup-body {
@@ -1609,8 +1648,32 @@ a.edit-customer-info {
padding: 1px;
}
body#checkout .condition-label {
padding-left: 0;
margin-top: 0;
& > label {
margin-bottom: 0;
}
}
/* Only for Chromium and Firefox; IE11 does not support feature query @supports, so it won't evaluate */
@supports (display: flex) {
body#checkout span.custom-checkbox {
display: flex;
align-items: flex-start;
& span {
top: 0;
margin: 0 5px 0 0;
}
& > label, & span.label {
margin: 0;
line-height: 1.25em;
text-align: left;
padding: 0;
}
}
.form-fields, .business-fields-container, .private-fields-container {
display: flex;
flex-wrap: wrap;
@@ -1619,12 +1682,37 @@ a.edit-customer-info {
flex-basis: 100%;
}
.form-group {
padding-left: 5px;
padding-right: 5px;
.form-group, .business-customer, .private-customer, .second-address, .order-options, .terms-and-conditions, .shaim_gdpr_checkbox {
//padding-left: 5px;
//padding-right: 5px;
flex-grow: 1;
flex-basis: 100%;
}
.terms-and-conditions {
text-align: left;
}
}
body#checkout .condition-label {
margin-left: 5px;
& label {
margin-top: 1px;
}
}
body#checkout div.shaim_heureka_checkbox {
margin-left: 26px;
text-align: left;
& label {
margin-top: 1px;
}
}
@media screen and (max-width: 767px) {
.form-group, .business-customer, .private-customer, .second-address, .order-options, .terms-and-conditions, .shaim_gdpr_checkbox {
padding-left: 0;
}
}
/* Debug: flash block that's re-loading data */
@@ -1735,6 +1823,7 @@ div#tc-container-mobile {
.social-login .tc-social-login-btn {
max-width: 100%;
width: 240px;
}
/* Column-responsive styles for login-block BEGIN */
@@ -1821,7 +1910,6 @@ body.is-virtual-cart.is-invoice-address-primary .checkout-block .second-address
#tc-container .form-group {
overflow: visible;
margin-bottom: 10px;
}
// Sticky block
@@ -1840,11 +1928,6 @@ body.is-virtual-cart.is-invoice-address-primary .checkout-block .second-address
max-width: 100%;
}
.payment-option label {
padding-top: 5px;
line-height: 1.5em;
}
.cart-summary-line.cart-total.cart-total-tax-included > span,
.cart-summary-line.cart-total.cart-total-auto-tax > span {
font-size: 1.2em;
@@ -1883,7 +1966,7 @@ body.is-test-mode #is-test-mode-notice {
border: 1px solid black;
animation: collapse-smaller .6s forwards;
animation-delay: 5s;
z-index: 100;
z-index: 1000;
}
@keyframes collapse-smaller {
@@ -1933,82 +2016,79 @@ body.is-test-mode #is-test-mode-notice {
// Test mode notice box END
// Compact cart styling (only desktop view) BEGIN
body.compact-cart #tc-container .product-line-image img {
max-width: 100px;
}
body.compact-cart {
#tc-container {
.product-line-image img {
max-width: 100px;
}
body.compact-cart #tc-container .cart-item .product-line {
//display: block;
min-height: 100px;
}
.cart-item .product-line {
//display: block;
min-height: 100px;
}
.cart-item .product-line-info {
width: 100%;
}
body.compact-cart #tc-container .cart-item .product-line-info {
width: 100%;
}
.product-line-info.product-price.h5 {
display: none;
}
//body.compact-cart #tc-container .product-line .product-line-image {
// float: left;
//}
.product-line-actions {
align-items: center;
padding-top: 5px;
margin-top: 5px;
}
body.compact-cart #tc-container .product-line-info.product-price.h5 {
display: none;
}
.product-line-info .label {
font-size: 0.8em;
line-height: 1em;
}
body.compact-cart #tc-container .product-line-actions {
align-items: center;
padding-top: 5px;
//border: 1px solid #f5f5f5;
//background: #fafafa;
margin-top: 5px;
}
.product-line-info.product-attribute {
font-size: 0.9em;
}
body.compact-cart #tc-container .product-line-info .label {
font-size: 0.8em;
line-height: 1em;
}
.cart-item .product-line-info:first-child {
margin-top: 0;
}
body.compact-cart #tc-container .product-line-info.product-attribute {
font-size: 0.9em;
}
.product-line-body {
display: flex;
flex-wrap: wrap;
align-items: center;
}
body.compact-cart #tc-container .cart-item .product-line-info:first-child {
margin-top: 0;
}
.cart-detailed-totals {
width: 100%;
left: 0;
}
body.compact-cart #tc-container .product-line-body {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.qty-container .qty-box {
transform: scale(0.8);
}
body.compact-cart #tc-container .cart-detailed-totals {
width: 100%;
left: 0;
}
.cart-summary-line > span {
font-size: 0.85em;
}
body.compact-cart #tc-container .qty-container .qty-box {
transform: scale(0.8);
}
.block-promo .promo-code {
padding: 10px 5px;
}
body.compact-cart #tc-container .cart-summary-line > span {
font-size: 0.85em;
}
.product-line-actions .product-line-qty {
flex-grow: 5;
text-align: right;
}
body.compact-cart #tc-container .block-promo .promo-code {
padding: 10px 5px;
}
.product-line-actions > div {
line-height: 20px;
}
body.compact-cart #tc-container .product-line-actions .product-line-qty {
flex-grow: 5;
text-align: right;
}
body.compact-cart #tc-container .product-line-actions > div {
line-height: 20px;
}
body.compact-cart #tc-container .product-line-delete {
padding-top: 0;
.product-line-delete {
padding-top: 0;
}
}
}
// Compact cart styling (only desktop view) END
@@ -2339,7 +2419,7 @@ e.g. Amazon has confirmation button inside of additional info */
.lang-rtl.using-material-icons .custom-radio {
margin-right: 0;
margin-left: 10px;
margin-left: 1.25em;
}
.lang-rtl span.carrier-delay {
@@ -2534,7 +2614,7 @@ label.delivery-option-label {
}
*/
.paypal-plus .pp-info {
.paypal-plus .pp-info, div[data-pp-info]{
display: none;
}
@@ -2627,10 +2707,9 @@ div[paypal-bnpl-button-container] {
.remaining-amount {
font-weight: bold;
}
}
/* Fix chronopost's map display - allow it to have wider area */
.delivery-options .row.delivery-option.chronopost {
flex-wrap: wrap;
&.free {
display: none;
}
}
/* Paypal v5.7 fix */
@@ -2777,13 +2856,15 @@ p.toast-title {
}
}
.cart-voucher>p>a.promo-code-button {
border: 0;
.cart-voucher>p>a.promo-code-button.collapsed {
border: 1px dashed #b1adad;
padding: 10px 20px;
background: #a20401;
background: #f5fff7;
display: inline-block;
color: #FFF;
border-radius: 25px;
}
.cart-voucher>p>a.promo-code-button {
display: none;
}
.block-promo {
@@ -2834,6 +2915,11 @@ p.toast-title {
}
}
body:not(.collapse-shipping-methods) #expand_other_shipping_options,
body:not(.collapse-payment-methods) #expand_other_payment_options {
display: none;
}
.expandOtherOptionsVisible() {
max-height: 60px;
opacity: 1;
@@ -2897,7 +2983,7 @@ p.toast-title {
body#checkout .additional-information {
margin-left: 0;
}
.form-group {
.form-group, .shaim_gdpr_checkbox {
padding-left: 0;
}
}
@@ -2961,6 +3047,7 @@ div#vyhledejte_pobocku_dpdparcelshop {
.delivery-options :is(.row.delivery-option.chronopost, .row.delivery-option.dpdfrance) {
flex-wrap: wrap;
display: flex;
.shipping-radio {
flex-basis: 5%;
}
@@ -2969,13 +3056,20 @@ div#vyhledejte_pobocku_dpdparcelshop {
}
#chronorelais_container .row {
flex-wrap: wrap;
display: flex;
& > div {
flex-grow: 1;
flex-basis: 20em;
}
}
input#relais_postcode {
padding-top: 2px;
height: 100%;
padding-bottom: 1px;
}
}
#chronorelais_dummy_container {
display: none;
}
@@ -3054,6 +3148,141 @@ body#checkout .checkout-block .inner-area .login-block-moved .offer-login a {
position: sticky;
top: 0;
}
.form-group.vat_number {
display: none !important;
/* iframe popup for payment methods - by default, iframe popup-embed is not visible, with CSS class .iframe, payment-form shall not be visible */
.popup-body {
iframe.popup-embed {
display: none;
}
.popup-payment-form, .popup-payment-button {
display: block;
}
}
.popup-payment-content.iframe {
width: 50em;
.popup-body {
padding: 0;
}
iframe.popup-embed {
width: 100%;
height: 30em;
display: block;
border: none;
}
.popup-payment-form, .popup-payment-button {
display: none;
}
// Specific height for certain payment methods
&[data-payment-module=ps_checkpayment] .popup-embed {
height: 18em;
}
}
// Add minus sign and change color of discount value in cart summary
div#cart-subtotal-discount > .value:before {
content: '-';
padding-right: 2px;
}
div#cart-subtotal-discount > .value {
color: #dd0000;
}
// Display password field as required, if 'create account' checkbox is ticked
div#create_account ~ .form-group.password .field-label:after {
content: '*';
color: #36b4d2;
}
[name=general_error] ~ .error-msg {
width: 100%;
}
// Paypal pay-later, fix the 'pay later' button visibility
.popup_content[data-payment-module=paypal] .popup-payment-button {
display: flex!important;
justify-content: center;
#payment-confirmation {
display: none!important;
}
#paypal-buttons [paypal-bnpl-button-container] {
display: none!important;
&:last-child {
display: block!important;
}
}
}
/* GLS PakkeShop & Postnord map styling */
.delivery-option > label {
max-width: 100%;
flex-wrap: wrap;
& .shipping_agents, & #map {
width: calc(100% + 40px) !important;
margin-left: -40px
}
}
/* mondialrelay slideDown() sometimes stops at smaller heights, so force it to be auto-height */
.row.carrier-extra-content.mondialrelay {
height: auto!important;
}
.payment-option label {
width: 100%;
}
/* Logos on the right side in shipping/payment listing (config option) */
body.logos-on-the-right {
& .payment-option label {
& .payment-call-to-action-and-logo {
flex-grow: 1;
}
& .payment-logo {
order: 1;
}
}
& .delivery-option-detail {
& .name-and-delay {
flex-grow: 1;
& .delivery-option-price {
display: block!important;
}
}
& .delivery-option-logo {
order: 1;
}
& .delivery-option-price {
display: none;
}
}
}
#checkout .popup-payment-form > .additional-information {
display: flex;
justify-content: center;
}
/* Payment form displayed when T&C checkbox was ticked, but we need to postpone that until popup */
[data-payment-module=ps_checkout] > .js-payment-option-form {
display: none!important;
}
/* Warehouse theme, touchspin on quantity input box made inconvenient blink effect */
.qty-box > .bootstrap-touchspin {
display: none;
& ~ a {
display: none;
}
}
#checkout .popup-payment-form > .przelewy24.additional-information {
flex-flow: column;
}
.cart-summary-line.vat-exempt {
text-align: center;
& > span.label {
color: green;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -82,4 +82,50 @@ div#payment-confirmation .ps-shown-by-js {
.payment-options.amazon_ongoing_session > div:not(.amazon-visible) {
display: none;
}
}
/* generic iframe (only single payment method visible) */
body.p3i-option-set .payment-options > :not(.p3i-visible-only) {
display: none;
}
body.p3i-option-set
:is(section#separate-payment-order-review, header, footer, #conditions-to-approve, h1.step-title),
body.p3i-option-set .cart-grid-body ~ *{
display: none;
}
body.p3i-option-set
:is(.cart-grid-body, #wrapper, .container, #content, .p3i-visible-only),
body.p3i-option-set #checkout-payment-step > .content,
body.p3i-option-set #content .row{
padding: 0!important;
margin: 0!important;
}
body.p3i-option-set
:is(.container, #content, .cart-grid-body, #checkout-payment-step) {
width: 100%;
}
body.p3i-option-set section#checkout-payment-step {
display: flex;
justify-content: center;
padding: 5px;
margin: 0!important;
/*height: 100vh;*/
align-items: center;
}
/* scrollbar begin */
body.p3i-option-set::-webkit-scrollbar {
width: 0.5em;
}
body.p3i-option-set::-webkit-scrollbar-track {
box-shadow: inset 0 0 2px rgb(0 0 0 / 16%);
}
body.p3i-option-set::-webkit-scrollbar-thumb {
background-color: #e0e0e0;
}
/* scrollbar end */

View File

@@ -12,58 +12,61 @@
display: flex;
justify-content: center;
margin-bottom: 15px;
}
& .tc-social-login-btn {
margin: 0 2px;
cursor: not-allowed;
position: relative;
text-align: left;
border-radius: 4px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: #3c4043;
border: 1px solid #dadce0;
padding: 11px 11px 8px 40px;
font-size: 14px;
font-family: "Roboto", sans-serif;
font-weight: 500;
max-width: 100%;
width: 240px;
display: none;
&.enabled {
cursor: pointer;
display: inline-block;
}
#tc-social-logins .facebook-logo {
background-image: url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='266.893px' height='266.895px' viewBox='0 0 266.893 266.895' enable-background='new 0 0 266.893 266.895' xml:space='preserve'%3e%3cpath id='Blue_1_' fill='%233C5A99' d='M248.082,262.307c7.854,0,14.223-6.369,14.223-14.225V18.812 c0-7.857-6.368-14.224-14.223-14.224H18.812c-7.857,0-14.224,6.367-14.224,14.224v229.27c0,7.855,6.366,14.225,14.224,14.225 H248.082z'/%3e%3cpath id='f' fill='%23FFFFFF' d='M182.409,262.307v-99.803h33.499l5.016-38.895h-38.515V98.777c0-11.261,3.127-18.935,19.275-18.935 l20.596-0.009V45.045c-3.562-0.474-15.788-1.533-30.012-1.533c-29.695,0-50.025,18.126-50.025,51.413v28.684h-33.585v38.895h33.585 v99.803H182.409z'/%3e%3c/svg%3e");
}
& span.social-logo {
position: absolute;
display: inline-block;
left: 0;
padding: 8px 7px 7px 8px;
top: 1px;
bottom: 1px;
text-align: center;
& .facebook-logo {
background-image: url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='266.893px' height='266.895px' viewBox='0 0 266.893 266.895' enable-background='new 0 0 266.893 266.895' xml:space='preserve'%3e%3cpath id='Blue_1_' fill='%233C5A99' d='M248.082,262.307c7.854,0,14.223-6.369,14.223-14.225V18.812 c0-7.857-6.368-14.224-14.223-14.224H18.812c-7.857,0-14.224,6.367-14.224,14.224v229.27c0,7.855,6.366,14.225,14.224,14.225 H248.082z'/%3e%3cpath id='f' fill='%23FFFFFF' d='M182.409,262.307v-99.803h33.499l5.016-38.895h-38.515V98.777c0-11.261,3.127-18.935,19.275-18.935 l20.596-0.009V45.045c-3.562-0.474-15.788-1.533-30.012-1.533c-29.695,0-50.025,18.126-50.025,51.413v28.684h-33.585v38.895h33.585 v99.803H182.409z'/%3e%3c/svg%3e");
}
.tc-social-login-btn .social-logo {
position: absolute;
display: inline-block;
border-right: 1px solid rgba(0, 0, 0, 0.2);
left: 0;
padding: 7px 7px 7px 8px;
top: 1px;
bottom: 1px;
text-align: center;
}
& > span {
display: inline-block;
width: 21px;
height: 21px;
background-size: contain;
background-repeat: no-repeat;
background-position: center center;
}
}
#tc-social-logins span.social-logo > span {
display: inline-block;
width: 21px;
height: 21px;
background-size: contain;
background-repeat: no-repeat;
background-position: center center;
}
#tc-social-logins .tc-social-login-btn {
margin: 1px 3px 2px;
cursor: not-allowed;
position: relative;
text-align: left;
border-radius: 4px;
font-size: 15px;
width: 250px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
opacity: 0.8;
display: none;
color: #666;
border: 1px solid #ccc;
padding: 9px 11px 8px 45px;
}
#tc-social-logins .tc-social-login-btn.enabled {
cursor: pointer;
display: inline-block;
}
#tc-facebook-signin:hover {
background-color: rgba(66,133,244,.04);
&:hover {
border-color: #d2e3fc;
background-color: #f8faff;
}
}
}

View File

@@ -31,7 +31,8 @@
display: none;
}
.checkout-block.main-block {
.checkout-block.main-block,
#thecheckout-newsletter, #thecheckout-psgdpr, #thecheckout-data-privacy, #thecheckout-confirm, #thecheckout-required-checkbox-1, #thecheckout-required-checkbox-2 {
padding: 15px 7px;
}
@@ -192,7 +193,6 @@ span.non-material-icon.delete-from-cart {
padding-top: 0;
display: flex;
align-items: flex-start;
width: 100%;
}
.payment-options .payment-option {
@@ -244,9 +244,20 @@ span.non-material-icon.delete-from-cart {
filter: brightness(0);
}
body#checkout span.custom-checkbox {
& > label, & span.label {
line-height: 1.05em;
}
}
div#checkout-step-btn-container {
margin-bottom: 5px;
}
.country-call-prefix {
font-size: 1.2em;
width: 49px;
height: 47px;
}
/* einvoicing prestalia */
@@ -268,6 +279,11 @@ label.col-md-3.form-control-label {
max-width: 100%;
}
.form-fields .form-group {
padding-left: 3px;
padding-right: 3px;
}
.col-md-3.form-control-comment {
display: none;
}

View File

@@ -26,7 +26,13 @@
.checkout-block[class*='num-'] .block-header:before {
display: none;
}
.checkout-block.main-block {
.checkout-block.main-block,
#thecheckout-newsletter,
#thecheckout-psgdpr,
#thecheckout-data-privacy,
#thecheckout-confirm,
#thecheckout-required-checkbox-1,
#thecheckout-required-checkbox-2 {
padding: 15px 7px;
}
.has-float-label input:placeholder-shown:not(:focus) ~ span.field-label,
@@ -153,7 +159,6 @@ div.product-line-actions .qty-box a {
padding-top: 0;
display: flex;
align-items: flex-start;
width: 100%;
}
.payment-options .payment-option {
padding: 5px 0;
@@ -194,9 +199,17 @@ div.product-line-actions .qty-box a {
.page-content .custom-checkbox input[type=checkbox]:checked + span {
filter: brightness(0);
}
body#checkout span.custom-checkbox > label,
body#checkout span.custom-checkbox span.label {
line-height: 1.05em;
}
div#checkout-step-btn-container {
margin-bottom: 5px;
}
.country-call-prefix {
font-size: 1.2em;
width: 49px;
height: 47px;
}
/* einvoicing prestalia */
label.col-md-3.form-control-label {
@@ -214,6 +227,10 @@ label.col-md-3.form-control-label {
margin: 0;
max-width: 100%;
}
.form-fields .form-group {
padding-left: 3px;
padding-right: 3px;
}
.col-md-3.form-control-comment {
display: none;
}
@@ -221,4 +238,4 @@ label.col-md-3.form-control-label {
.checkout-block.no-header {
margin-top: -37px;
}
/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22home%5C%2Fpeter%5C%2Fwww%5C%2Fpresta_178%5C%2Fmodules%5C%2Fthecheckout%5C%2Fviews%5C%2Fcss%5C%2Fstyles%5C%2Fclean.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AAAA%3BEACE%3B%3BAAGF%2CeAAe%2CWAAY%3BEACzB%2CyBAAA%3BEACA%3BEACA%3B%3BAAGF%3BAAAe%3BEACb%3BEACA%3BEACA%3BEACA%3BEACA%3B%3BAAGF%3BEACE%3BEACA%3BEACA%3BEACA%3B%3BAAGF%2CYAAa%3BEACX%3B%3BAAGF%2CeAAe%2CeAAgB%2CcAAa%3BEAC1C%3B%3BAAGF%2CeAAe%3BEACb%2CiBAAA%3B%3BAAGF%2CgBAAiB%2CMAAK%2CkBAAkB%2CIAAI%2CQAAW%2COAAI%3BAAAc%2CgBAAiB%2COAAM%2CkBAAkB%2CIAAI%2CQAAW%2COAAI%3BEACnI%3BEACA%3BEACA%3B%3BAAGF%2CgBAAgB%2CSAAU%2CKAAI%3BAAAc%2CSAAU%2CiBAAiB%2CKAAI%3BAAAc%2CgBAAiB%2CKAAI%3BEAC5G%3BEACA%3BEACA%3BEACA%3BEACA%3BEACA%3BEACA%3B%3BAAGF%2CKAAK%3BEACH%3B%3BAAGF%2CaAAc%3BAAAe%2CaAAc%2COAAM%2CoBAAoB%3BEACnE%2CyBAAA%3BEACA%3BEACA%3B%3BAAGF%2CgBAAiB%2CMAAK%3BAAAQ%2CgBAAiB%2COAAM%3BEACnD%2CmCAAA%3B%3BAAGF%2CgBAAiB%2CKAAI%2CoBAAoB%2CIAAI%3BEAC3C%3B%3BAAGF%2CaAAc%2CiBAAiB%2COAAM%3BEACnC%2CgBAAgB%2CiYAAhB%3BEACA%3B%3BAAGF%3BEACE%3BEACA%3B%3B%3BAAMF%2CaAAa%3BEACX%3BEACA%3BEACA%3B%3BAAGF%2CaAAc%3BEACZ%3B%3BAAGF%3BEACE%3BEACA%3B%3BAAGF%2CyBAA0B%3BEACxB%3BEACA%3B%3BAAGF%2CyBAA0B%3BEACxB%3BEACA%3BEACA%3B%3BAAGF%2CyBAA0B%3BEACxB%3B%3BAAGF%2CyBAA0B%3BEACxB%3B%3BAAGF%2CGAAG%2CqBAAsB%2CSAAS%3BEAEhC%3BEACA%2CyBAAA%3BEACA%3BEACA%3B%3BAAGF%2CqBAAsB%2CSAAS%3BEAC7B%3BEACA%2CyBAAA%3B%3BAAMF%2CqBAAsB%3BEAEpB%3B%3BAAGF%2CaAAc%2CmBAAkB%3BEAC9B%3B%3BAAGF%2CaAAc%3BEACZ%3B%3BAAGF%3BEAEE%3B%3BAAGF%3BEACE%3BEACA%3BEACA%3B%3BAAGF%2CkBAAmB%3BEACjB%3B%3BAAGF%2CkBAAkB%3BEAChB%3B%3BAAGF%2CUAAW%3BEACT%3B%3BAAGF%3BEACE%2C6BAAA%3B%3BAAGF%2CkBAAkB%2CWAAW%3BEAC3B%2C6BAAA%3BEACA%3B%3BAAGF%2CaAAa%3BEACX%2CcAAA%3B%3BAAGF%3BEACE%3B%3B%3B%3BAAMF%2CeAAgB%3BEACd%3BEACA%3BEACA%3BEACA%3B%3BAAGF%2CgBAAiB%3BEACf%2CcAAA%3BEACA%3B%3BAAGF%3BEACE%3B%3BAAGF%2CeAAgB%2CMAAM%2CKAAI%3BEACxB%3B%3BAAGF%2CeAAgB%3BEACd%3BEACA%3B%3B%3B%3BAAMF%3BEACE%2CsBAAA%3BEACA%3BEACA%3BEACA%3B%3BAAGF%3BEACE%2CsBAAA%3B%3BAAGF%2CoBAAoB%2CSAAS%3BAAAQ%2CoBAAoB%2CSAAS%3BEAChE%2CSAAS%2CEAAT%3BEACA%3BEACA%3BEACA%2CcAAA%3BEACA%3BEACA%2CgCAAA%3B%3B%3B%3BAAOF%2CaAAc%2CiBAAiB%2CMAAK%2CeAAe%2CQAAW%3BEAC5D%2CQAAQ%2CaAAR%3B%3BAAGF%3BEACE%3BEACA%3B%3B%3BAAIF%2CKAAK%2CSAAS%3BEACV%3BEACA%3BEACA%3B%3BAAGJ%2CWAAW%3BEACP%3BEACA%3BEACA%3B%3BAAGJ%2CWAAW%2CIAAO%3BEACd%3BEACA%3BEACA%3B%3BAAGJ%2CSAAS%3BEACL%3B%3B%3BAAIJ%2CeAAe%3BEACb%22%7D */
/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22home%5C%2Fpeter%5C%2Fwww%5C%2Fpresta_178%5C%2Fmodules%5C%2Fthecheckout%5C%2Fviews%5C%2Fcss%5C%2Fstyles%5C%2Fclean.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AAAA%3BEACE%3B%3BAAGF%2CeAAe%2CWAAY%3BEACzB%2CyBAAA%3BEACA%3BEACA%3B%3BAAGF%3BAAAe%3BEACb%3BEACA%3BEACA%3BEACA%3BEACA%3B%3BAAGF%3BEACE%3BEACA%3BEACA%3BEACA%3B%3BAAGF%2CYAAa%3BEACX%3B%3BAAGF%2CeAAe%2CeAAgB%2CcAAa%3BEAC1C%3B%3BAAGF%2CeAAe%3BAACf%3BAAAyB%3BAAAqB%3BAAA2B%3BAAAsB%3BAAAkC%3BEAC%5C%2FH%2CiBAAA%3B%3BAAGF%2CgBAAiB%2CMAAK%2CkBAAkB%2CIAAI%2CQAAW%2COAAI%3BAAAc%2CgBAAiB%2COAAM%2CkBAAkB%2CIAAI%2CQAAW%2COAAI%3BEACnI%3BEACA%3BEACA%3B%3BAAGF%2CgBAAgB%2CSAAU%2CKAAI%3BAAAc%2CSAAU%2CiBAAiB%2CKAAI%3BAAAc%2CgBAAiB%2CKAAI%3BEAC5G%3BEACA%3BEACA%3BEACA%3BEACA%3BEACA%3BEACA%3B%3BAAGF%2CKAAK%3BEACH%3B%3BAAGF%2CaAAc%3BAAAe%2CaAAc%2COAAM%2CoBAAoB%3BEACnE%2CyBAAA%3BEACA%3BEACA%3B%3BAAGF%2CgBAAiB%2CMAAK%3BAAAQ%2CgBAAiB%2COAAM%3BEACnD%2CmCAAA%3B%3BAAGF%2CgBAAiB%2CKAAI%2CoBAAoB%2CIAAI%3BEAC3C%3B%3BAAGF%2CaAAc%2CiBAAiB%2COAAM%3BEACnC%2CgBAAgB%2CiYAAhB%3BEACA%3B%3BAAGF%3BEACE%3BEACA%3B%3B%3BAAMF%2CaAAa%3BEACX%3BEACA%3BEACA%3B%3BAAGF%2CaAAc%3BEACZ%3B%3BAAGF%3BEACE%3BEACA%3B%3BAAGF%2CyBAA0B%3BEACxB%3BEACA%3B%3BAAGF%2CyBAA0B%3BEACxB%3BEACA%3BEACA%3B%3BAAGF%2CyBAA0B%3BEACxB%3B%3BAAGF%2CyBAA0B%3BEACxB%3B%3BAAGF%2CGAAG%2CqBAAsB%2CSAAS%3BEAEhC%3BEACA%2CyBAAA%3BEACA%3BEACA%3B%3BAAGF%2CqBAAsB%2CSAAS%3BEAC7B%3BEACA%2CyBAAA%3B%3BAAMF%2CqBAAsB%3BEAEpB%3B%3BAAGF%2CaAAc%2CmBAAkB%3BEAC9B%3B%3BAAGF%2CaAAc%3BEACZ%3B%3BAAGF%3BEAEE%3B%3BAAGF%3BEACE%3BEACA%3BEACA%3B%3BAAGF%2CkBAAmB%3BEACjB%3B%3BAAGF%2CkBAAkB%3BEAChB%3B%3BAAGF%2CUAAW%3BEACT%3B%3BAAGF%3BEACE%2C6BAAA%3B%3BAAGF%2CkBAAkB%2CWAAW%3BEAC3B%2C6BAAA%3BEACA%3B%3BAAGF%2CaAAa%3BEACX%2CcAAA%3B%3BAAGF%3BEACE%3B%3B%3B%3BAAMF%2CeAAgB%3BEACd%3BEACA%3BEACA%3B%3BAAGF%2CgBAAiB%3BEACf%2CcAAA%3BEACA%3B%3BAAGF%3BEACE%3B%3BAAGF%2CeAAgB%2CMAAM%2CKAAI%3BEACxB%3B%3BAAGF%2CeAAgB%3BEACd%3BEACA%3B%3B%3B%3BAAMF%3BEACE%2CsBAAA%3BEACA%3BEACA%3BEACA%3B%3BAAGF%3BEACE%2CsBAAA%3B%3BAAGF%2CoBAAoB%2CSAAS%3BAAAQ%2CoBAAoB%2CSAAS%3BEAChE%2CSAAS%2CEAAT%3BEACA%3BEACA%3BEACA%2CcAAA%3BEACA%3BEACA%2CgCAAA%3B%3B%3B%3BAAOF%2CaAAc%2CiBAAiB%2CMAAK%2CeAAe%2CQAAW%3BEAC5D%2CQAAQ%2CaAAR%3B%3BAAIA%2CIADE%2CSAAU%2CKAAI%2CgBACZ%3BAAAO%2CIADT%2CSAAU%2CKAAI%2CgBACH%2CKAAI%3BEACf%3B%3BAAIJ%2CGAAG%3BEACD%3B%3BAAGF%3BEACE%3BEACA%3BEACA%3B%3B%3BAAIF%2CKAAK%2CSAAS%3BEACV%3BEACA%3BEACA%3B%3BAAGJ%2CWAAW%3BEACP%3BEACA%3BEACA%3B%3BAAGJ%2CWAAW%2CIAAO%3BEACd%3BEACA%3BEACA%3B%3BAAGJ%2CYAAa%3BEACX%3BEACA%3B%3BAAGF%2CSAAS%3BEACL%3B%3B%3BAAIJ%2CeAAe%3BEACb%22%7D */

View File

@@ -1 +1 @@
{"version":3,"sources":["home\/peter\/www\/presta_178\/modules\/thecheckout\/views\/css\/styles\/clean.less"],"names":[],"mappings":"AAAA;EACE;;AAGF,eAAe,WAAY;EACzB,yBAAA;EACA;EACA;;AAGF;AAAe;EACb;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF,YAAa;EACX;;AAGF,eAAe,eAAgB,cAAa;EAC1C;;AAGF,eAAe;EACb,iBAAA;;AAGF,gBAAiB,MAAK,kBAAkB,IAAI,QAAW,OAAI;AAAc,gBAAiB,OAAM,kBAAkB,IAAI,QAAW,OAAI;EACnI;EACA;EACA;;AAGF,gBAAgB,SAAU,KAAI;AAAc,SAAU,iBAAiB,KAAI;AAAc,gBAAiB,KAAI;EAC5G;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,KAAK;EACH;;AAGF,aAAc;AAAe,aAAc,OAAM,oBAAoB;EACnE,yBAAA;EACA;EACA;;AAGF,gBAAiB,MAAK;AAAQ,gBAAiB,OAAM;EACnD,mCAAA;;AAGF,gBAAiB,KAAI,oBAAoB,IAAI;EAC3C;;AAGF,aAAc,iBAAiB,OAAM;EACnC,gBAAgB,iYAAhB;EACA;;AAGF;EACE;EACA;;;AAMF,aAAa;EACX;EACA;EACA;;AAGF,aAAc;EACZ;;AAGF;EACE;EACA;;AAGF,yBAA0B;EACxB;EACA;;AAGF,yBAA0B;EACxB;EACA;EACA;;AAGF,yBAA0B;EACxB;;AAGF,yBAA0B;EACxB;;AAGF,GAAG,qBAAsB,SAAS;EAEhC;EACA,yBAAA;EACA;EACA;;AAGF,qBAAsB,SAAS;EAC7B;EACA,yBAAA;;AAMF,qBAAsB;EAEpB;;AAGF,aAAc,mBAAkB;EAC9B;;AAGF,aAAc;EACZ;;AAGF;EAEE;;AAGF;EACE;EACA;EACA;;AAGF,kBAAmB;EACjB;;AAGF,kBAAkB;EAChB;;AAGF,UAAW;EACT;;AAGF;EACE,6BAAA;;AAGF,kBAAkB,WAAW;EAC3B,6BAAA;EACA;;AAGF,aAAa;EACX,cAAA;;AAGF;EACE;;;;AAMF,eAAgB;EACd;EACA;EACA;EACA;;AAGF,gBAAiB;EACf,cAAA;EACA;;AAGF;EACE;;AAGF,eAAgB,MAAM,KAAI;EACxB;;AAGF,eAAgB;EACd;EACA;;;;AAMF;EACE,sBAAA;EACA;EACA;EACA;;AAGF;EACE,sBAAA;;AAGF,oBAAoB,SAAS;AAAQ,oBAAoB,SAAS;EAChE,SAAS,EAAT;EACA;EACA;EACA,cAAA;EACA;EACA,gCAAA;;;;AAOF,aAAc,iBAAiB,MAAK,eAAe,QAAW;EAC5D,QAAQ,aAAR;;AAGF;EACE;EACA;;;AAIF,KAAK,SAAS;EACV;EACA;EACA;;AAGJ,WAAW;EACP;EACA;EACA;;AAGJ,WAAW,IAAO;EACd;EACA;EACA;;AAGJ,SAAS;EACL;;;AAIJ,eAAe;EACb"}
{"version":3,"sources":["home\/peter\/www\/presta_178\/modules\/thecheckout\/views\/css\/styles\/clean.less"],"names":[],"mappings":"AAAA;EACE;;AAGF,eAAe,WAAY;EACzB,yBAAA;EACA;EACA;;AAGF;AAAe;EACb;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF,YAAa;EACX;;AAGF,eAAe,eAAgB,cAAa;EAC1C;;AAGF,eAAe;AACf;AAAyB;AAAqB;AAA2B;AAAsB;AAAkC;EAC\/H,iBAAA;;AAGF,gBAAiB,MAAK,kBAAkB,IAAI,QAAW,OAAI;AAAc,gBAAiB,OAAM,kBAAkB,IAAI,QAAW,OAAI;EACnI;EACA;EACA;;AAGF,gBAAgB,SAAU,KAAI;AAAc,SAAU,iBAAiB,KAAI;AAAc,gBAAiB,KAAI;EAC5G;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,KAAK;EACH;;AAGF,aAAc;AAAe,aAAc,OAAM,oBAAoB;EACnE,yBAAA;EACA;EACA;;AAGF,gBAAiB,MAAK;AAAQ,gBAAiB,OAAM;EACnD,mCAAA;;AAGF,gBAAiB,KAAI,oBAAoB,IAAI;EAC3C;;AAGF,aAAc,iBAAiB,OAAM;EACnC,gBAAgB,iYAAhB;EACA;;AAGF;EACE;EACA;;;AAMF,aAAa;EACX;EACA;EACA;;AAGF,aAAc;EACZ;;AAGF;EACE;EACA;;AAGF,yBAA0B;EACxB;EACA;;AAGF,yBAA0B;EACxB;EACA;EACA;;AAGF,yBAA0B;EACxB;;AAGF,yBAA0B;EACxB;;AAGF,GAAG,qBAAsB,SAAS;EAEhC;EACA,yBAAA;EACA;EACA;;AAGF,qBAAsB,SAAS;EAC7B;EACA,yBAAA;;AAMF,qBAAsB;EAEpB;;AAGF,aAAc,mBAAkB;EAC9B;;AAGF,aAAc;EACZ;;AAGF;EAEE;;AAGF;EACE;EACA;EACA;;AAGF,kBAAmB;EACjB;;AAGF,kBAAkB;EAChB;;AAGF,UAAW;EACT;;AAGF;EACE,6BAAA;;AAGF,kBAAkB,WAAW;EAC3B,6BAAA;EACA;;AAGF,aAAa;EACX,cAAA;;AAGF;EACE;;;;AAMF,eAAgB;EACd;EACA;EACA;;AAGF,gBAAiB;EACf,cAAA;EACA;;AAGF;EACE;;AAGF,eAAgB,MAAM,KAAI;EACxB;;AAGF,eAAgB;EACd;EACA;;;;AAMF;EACE,sBAAA;EACA;EACA;EACA;;AAGF;EACE,sBAAA;;AAGF,oBAAoB,SAAS;AAAQ,oBAAoB,SAAS;EAChE,SAAS,EAAT;EACA;EACA;EACA,cAAA;EACA;EACA,gCAAA;;;;AAOF,aAAc,iBAAiB,MAAK,eAAe,QAAW;EAC5D,QAAQ,aAAR;;AAIA,IADE,SAAU,KAAI,gBACZ;AAAO,IADT,SAAU,KAAI,gBACH,KAAI;EACf;;AAIJ,GAAG;EACD;;AAGF;EACE;EACA;EACA;;;AAIF,KAAK,SAAS;EACV;EACA;EACA;;AAGJ,WAAW;EACP;EACA;EACA;;AAGJ,WAAW,IAAO;EACd;EACA;EACA;;AAGJ,YAAa;EACX;EACA;;AAGF,SAAS;EACL;;;AAIJ,eAAe;EACb"}

View File

@@ -6,8 +6,8 @@
background: white;
}
.input-effects-flash .has-float-label input:focus~.effects-helper::after,
.input-effects-flash .has-float-label select:focus~.effects-helper::after {
.input-effects-flash .has-float-label input:focus ~ .effects-helper::after,
.input-effects-flash .has-float-label select:focus ~ .effects-helper::after {
-webkit-animation: none;
animation: none;
}
@@ -24,14 +24,13 @@
.mark-required .form-group.tel label.required .field-label::after,
.mark-required .form-group.select label.required .field-label::after,
.mark-required .form-group.countrySelect label.required .field-label::after {
color: #a20401;
color: #36b4d2;
}
#wrapper :is(.label, label) {
color: #232323;
text-align: left;
font-size: 13px;
font-weight: 400;
font-size: 13.5px;
}
.form-group.radio-buttons {
@@ -43,10 +42,6 @@
//margin-top: 30px;
}
label {
margin-bottom: 10px;
}
.static-customer-info {
border-bottom: 1px solid transparent;
}
@@ -60,7 +55,7 @@ a.edit-customer-info:hover .static-customer-info:after {
position: absolute;
right: 0;
bottom: 0;
background: #a20401;
background: #2fb5d2;
color: white;
padding: 2px 6px;
font-size: 0.9em;
@@ -68,21 +63,21 @@ a.edit-customer-info:hover .static-customer-info:after {
}
a.edit-customer-info:hover .static-customer-info {
border-bottom: 1px solid #a20401;
border-bottom: 1px solid #2fb5d2;
}
span.carrier-delay {
color: #a20401;
color: #36b4d2;
padding-right: 50px;
}
.delivery-options,
.payment-options {
.delivery-options, .payment-options {
width: 100%;
border: 1px solid #ccc;
padding: 20px;
}
#thecheckout-shipping .inner-area,
#thecheckout-payment .inner-area {
#thecheckout-shipping .inner-area, #thecheckout-payment .inner-area {
border: 0 solid #e9e9e9;
}
@@ -100,7 +95,7 @@ span.carrier-delay {
border-radius: 5px;
}
.-error~.error-msg {
.-error ~ .error-msg {
margin-top: -9px;
padding: 15px 5px 7px;
}
@@ -108,18 +103,18 @@ span.carrier-delay {
.using-material-icons .custom-radio {
display: inline-block;
position: relative;
width: 20px;
height: 20px;
width: 30px;
height: 30px;
vertical-align: middle;
cursor: pointer;
border-radius: 50%;
border: none;
background: #fff;
margin-right: 10px;
margin-top: 7px;
margin-right: 1.25rem;
margin-top: 0;
}
.using-material-icons .custom-radio input[type=radio]+span {
.using-material-icons .custom-radio input[type=radio] + span {
display: inline-block;
width: 100%;
height: 100%;
@@ -135,8 +130,8 @@ span.carrier-delay {
background: transparent;
}
.using-material-icons .custom-radio input[type=radio]:checked+span {
border-color: #a20401;
.using-material-icons .custom-radio input[type=radio]:checked + span {
border-color: #2fb5d2;
background: url(../../img/checkmark.png) center no-repeat;
}
@@ -166,15 +161,16 @@ label.radio-inline {
padding-top: 5px;
}
.form-group {
padding-left: 5px;
padding-right: 5px;
flex-grow: 1;
flex-basis: 100%;
@media (min-width: 768px) {
.form-group, .account_creation.shaim_gdpr_checkbox {
padding-left: 5px;
padding-right: 5px;
flex-grow: 1;
flex-basis: 100%;
}
}
.has-float-label input.form-control,
.has-float-label select.form-control.form-control-select {
.has-float-label input.form-control, .has-float-label select.form-control.form-control-select {
font-size: 0.95em;
margin-bottom: 2px;
border-radius: 5px;
@@ -186,6 +182,9 @@ label.radio-inline {
position: relative;
background-color: white;
}
.has-float-label {
margin-bottom: 15px;
}
.has-float-label :not(:placeholder-shown):not(:focus) {
border-color: #e5e5e5;
@@ -202,8 +201,8 @@ label.radio-inline {
opacity: 0.8;
}
.has-float-label input:placeholder-shown:not(:focus)~span.field-label,
.has-float-label select:placeholder-shown:not(:focus)~span.field-label {
.has-float-label input:placeholder-shown:not(:focus) ~ span.field-label,
.has-float-label select:placeholder-shown:not(:focus) ~ span.field-label {
font-size: 0.95em;
opacity: 0.8;
padding-left: 0;
@@ -232,8 +231,7 @@ label.radio-inline {
margin: 20px auto 30px;
}
.reassurance-section.security:after,
.reassurance-section.delivery:after {
.reassurance-section.security:after, .reassurance-section.delivery:after {
content: "";
display: block;
width: 80%;
@@ -242,25 +240,26 @@ label.radio-inline {
border-bottom: 2px solid #85cad9;
}
.has-float-label input:placeholder-shown:not(:focus)~span.field-label,
.has-float-label select:placeholder-shown:not(:focus)~span.field-label {
.has-float-label input:placeholder-shown:not(:focus) ~ span.field-label, .has-float-label select:placeholder-shown:not(:focus) ~ span.field-label {
top: -20px;
cursor: text;
opacity: 0.6;
}
.block-header {
margin-bottom: 0px;
padding: 20px 0px;
font-size: 16px;
letter-spacing: 1px;
}
section.form-fields {
padding-top: 25px;
}
.business-customer,
.private-customer {
padding: 5px 5px 0px;
}
.second-address {
padding-left: 5px;
}
//.business-customer, .private-customer {
// padding: 5px 5px 0px;
//}
/* Cart summary section */
@@ -295,32 +294,33 @@ section.form-fields {
.checkout-block[class*='num-'] .block-header:before {
font-weight: bold;
background: #a20401;
color: #FFF;
border: 0;
border: 2px solid #ccc;
color: #2fb5d2;
border-radius: 50%;
width: 40px;
height: 40px;
line-height: 40px;
width: 64px;
height: 64px;
line-height: 64px;
margin: 0px 0px 12px 0px;
padding: 0;
text-align: center;
display: block;
font-size: 16px;
font-size: 27px;
-webkit-box-shadow: 1px 1px 10px 3px rgba(0, 0, 0, 0.08);
-moz-box-shadow: 1px 1px 10px 3px rgba(0, 0, 0, 0.08);
box-shadow: 1px 1px 10px 3px rgba(0, 0, 0, 0.08);
}
body#checkout .checkout-block .inner-area .offer-login a {
background: #a20401;
background: #2fb5d2;
max-width: 219px;
padding: 10px 25px;
padding: 15px;
border-radius: 40px;
color: white;
margin: 10px auto;
font-size: 14px;
font-size: 20px;
&:hover {
text-decoration: none;
color: #750200;
background: #037d9a;
}
}
@@ -364,12 +364,12 @@ img#OffAmazonPaymentsWidgets0 {
height: auto;
}
.page-content .custom-checkbox input[type=checkbox]+span {
.page-content .custom-checkbox input[type=checkbox] + span {
border-radius: 3px;
border: 2px solid #a20401;
border: 2px solid #36b4d2;
}
.custom-checkbox input[type=checkbox]+span {
.custom-checkbox input[type=checkbox] + span {
min-width: 16px;
width: 16px;
height: 16px;
@@ -390,33 +390,31 @@ img#OffAmazonPaymentsWidgets0 {
min-height: 16px;
}
.product-line-body .product-line-info span.label,
.value {
.product-line-body .product-line-info span.label, .value {
color: #171717a8;
}
.custom-checkbox input[type=checkbox]+span .checkbox-checked {
color: #a20401;
.custom-checkbox input[type=checkbox] + span .checkbox-checked {
color: #36b4d2;
}
.page-content .custom-checkbox input[type=checkbox]:checked+span {
.page-content .custom-checkbox input[type=checkbox]:checked + span {
background-color: transparent;
border-color: #a20401;
border-color: #36b4d2;
}
.page-content .custom-checkbox input[type=checkbox]:checked+span>i {
.page-content .custom-checkbox input[type=checkbox]:checked + span > i {
display: none;
}
#delivery_message,
#gift_message {
#delivery_message, #gift_message {
min-height: 100px;
border-radius: 5px;
padding: 8px;
}
.mark-required .form-group.checkbox label.required span.label::before {
color: #a20401;
color: #36b4d2;
}
span.custom-checkbox span.label {
@@ -433,14 +431,11 @@ span.custom-checkbox span.label em {
}
.checkout-block {
.cart-summary-line .label,
.cart-summary-line .value {
.cart-summary-line .label, .cart-summary-line .value {
font-size: 16px;
}
a.cart-line-product-quantity-up,
a.cart-line-product-quantity-down {
a.cart-line-product-quantity-up, a.cart-line-product-quantity-down {
width: 30px;
height: 30px;
border: 1px solid gray;
@@ -456,8 +451,7 @@ span.custom-checkbox span.label em {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="%23777" viewBox="0 0 24 24"><path d="M24 10h-24v4h24z"/></svg>');
}
a.cart-line-product-quantity-up:hover,
a.cart-line-product-quantity-down:hover {
a.cart-line-product-quantity-up:hover, a.cart-line-product-quantity-down:hover {
background-color: inherit;
background-size: auto;
background-size: 60%;
@@ -474,11 +468,11 @@ span.custom-checkbox span.label em {
}
.has-discount .discount {
background: #a20401;
background: #36b4d2;
}
.product-price {
color: #a20401;
color: #2fb5d2;
display: inline-block;
}
@@ -500,8 +494,7 @@ span.custom-checkbox span.label em {
border-color: gray;
}
.product-price-section .product-price,
.product-price-section a {
.product-price-section .product-price, .product-price-section a {
color: white;
font-size: 13px;
font-weight: bold;
@@ -513,12 +506,6 @@ span.custom-checkbox span.label em {
position: relative;
left: 124px;
}
@media (max-width: 991px) {
.cart-detailed-totals {
width: 100%;
left: 0;
}
}
.card-block:first-child {
border-bottom: 1px dotted #c6c6c6;
@@ -536,17 +523,14 @@ span.custom-checkbox span.label em {
border-bottom: 1px solid #c1c1c1;
}
.card.cart-container,
.card.cart-summary {
.card.cart-container, .card.cart-summary {
box-shadow: none;
border: none;
}
.card.cart-summary {
border-bottom: 1px solid #ccc;
}
}
.block-header.shopping-cart-header {
border-top: 1px solid #ccc;
margin-top: 10px;
@@ -554,19 +538,16 @@ span.custom-checkbox span.label em {
padding-top: 20px;
}
.thecheckout-reassurance,
.delivery-options,
.payment-options {
.thecheckout-reassurance, .delivery-options, .payment-options {
border-radius: 5px;
}
.delivery-options,
.payment-options {
.delivery-options, .payment-options {
margin-bottom: 20px;
}
.card-block.block-promo {
padding-top: 10px;
}
@@ -601,8 +582,13 @@ span.custom-checkbox span.label em {
font-size: 22px;
}
body#checkout .form-group {
padding-left: 0;
.delivery-options, .payment-options {
padding: 20px 10px;
}
.checkout-block .cart-detailed-totals {
width: 100%;
left: 0;
}
}
@@ -611,4 +597,4 @@ span.custom-checkbox span.label em {
width: 100%;
left: 0;
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"sources":["home\/host239242\/domains\/wyczarujprezent.pl\/public_html\/modules\/thecheckout\/views\/css\/styles\/cute.less"],"names":[],"mappings":"YAAY;AAIZ;EACE;;AAGF,oBAAqB,iBAAiB,MAAK,MAAS,kBAAe;AACnE,oBAAqB,iBAAiB,OAAM,MAAS,kBAAe;EAClE;EACA;;AAGF;EACE;EACA;;AAGF,cAAe,YAAW,KAAM,MAAK,SAAU,aAAY;AAC3D,cAAe,YAAW,KAAK,SAAU,MAAM,aAAY;AAC3D,cAAe,YAAW,MAAO,MAAK,SAAU,aAAY;AAC5D,cAAe,YAAW,SAAU,MAAK,SAAU,aAAY;AAC\/D,cAAe,YAAW,IAAK,MAAK,SAAU,aAAY;AAC1D,cAAe,YAAW,OAAQ,MAAK,SAAU,aAAY;AAC7D,cAAe,YAAW,cAAe,MAAK,SAAU,aAAY;EAClE;;AAGF,QAAS,IAAG;EACV;EACA;EACA;;AAGF,WAAW;EACT;EACA;;AAOF;EACE;;AAGF;EACE,oCAAA;;AAGF;EACE;;AAGF,CAAC,mBAAmB,MAAO,sBAAqB;EAC9C,SAAS,qBAAT;EACA;EACA;EACA;EACA;EACA;EACA,gBAAA;EACA;EACA;;AAGF,CAAC,mBAAmB,MAAO;EACzB,gCAAA;;AAGF,IAAI;EACF;EACA;;AAGF;AAAmB;EACjB;EACA,sBAAA;EACA;;AAGF,qBAAsB;AAAa,oBAAqB;EACtD,uBAAA;;AAGF,iBAAiB;EACf;;AAGF,aAAc,MAAK;EACjB;EACA;;AAGF;EACE;EACA;;AAGF,OAAU;EACR;EACA,qBAAA;;AAGF,qBAAsB;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,qBAAsB,cAAc,MAAK,YAAe;EACtD;EACA;EACA;EACA;EACA;EACA,yBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,qBAAsB,cAAc,MAAK,YAAY,QAAW;EAC9D;EACA,yDAAA;;AAGF;EACE;EACA;;AAGF,mBAAoB;EAClB;EACA;EACA;;AAGF,mBAAoB,OAAM;EACxB;;AAGF,aAAc,KAAI;EAEhB;EACA;;AAGF,KAAK;EACH;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF,gBAAiB,MAAK;AAAe,gBAAiB,OAAM,aAAa;EACvE;EACA;EACA;EACA,yBAAA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,gBAAiB,KAAI,oBAAoB,IAAI;EAC3C;;AAGF;EACE,sBAAA;EACA;EACA;;AAGF,gBAAiB,MAAK,kBAAkB,IAAI,QAAQ;AACpD,gBAAiB,OAAM,kBAAkB,IAAI,QAAQ;EACnD;;AAGF,gBAAiB,MAAK,kBAAkB,IAAI,QAAW,OAAI;AAC3D,gBAAiB,OAAM,kBAAkB,IAAI,QAAW,OAAI;EAC1D;EACA;EACA;;AAGF,gBAAgB,SAAU,KAAI;AAC9B,SAAU,iBAAiB,KAAI;AAC\/B,gBAAiB,KAAI;EACnB;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE,sBAAA;;AAGF,oBAAoB,SAAS;AAAQ,oBAAoB,SAAS;EAChE,SAAS,EAAT;EACA;EACA;EACA,cAAA;EACA;EACA,gCAAA;;AAGF,gBAAiB,MAAK,kBAAkB,IAAI,QAAW,OAAI;AAAc,gBAAiB,OAAM,kBAAkB,IAAI,QAAW,OAAI;EACnI;EACA;EACA;;AAGF;EACE;EACA,iBAAA;EACA;EACA;;AAGF,OAAO;EACL;;AAGF;AAAoB;EAClB,oBAAA;;AAGF;EACE;;;AAKF,kBAAmB;EACjB;EACA;EACA;;AAGF;EACE;;AAGF,UAAW,mBAAkB,kBAAmB;EAC9C;EACA;;AAGF;EACE;;AAGF,mBAAoB;EAClB,sBAAA;EACA;EACA,aAAA;;AAGF;EACE;;AAGF,eAAe,eAAgB,cAAa;EAC1C;EACA,sBAAA;EACA;EACA;EACA;EACA;EACA;EACA,wBAAA;EACA;EACA;EACA;EACA;EACA,wDAAA;EACA,qDAAA;EACA,gDAAA;;AAGF,IAAI,SAAU,gBAAgB,YAAY,aAAa;EACrD;EACA;EACA;EACA;EACA;EACA,iBAAA;EACA;;AACA,IARE,SAAU,gBAAgB,YAAY,aAAa,EAQpD;EACC;EACA;;AAIJ,kBAAmB;EACjB;;AAGF,gBAAiB,GAAG;EAClB;EACA,iBAAA;EACA,cAAA;EACA;EACA;EACA;EAEA;EACA;;AAGF,gBAAiB,GAAG;EAClB;EACA,iBAAA;EACA,cAAA;EACA;EACA;EACA;EACA,sBAAA;EACA;;AAGF,GAAG;EACD,iBAAA;;AAGF,eAAgB,OAAM,IAAI,YAAY;EACpC;EACA;EAEA;EACA;EACA;;AAGF,aAAc,iBAAiB,MAAK,eAAkB;EACpD;EACA,yBAAA;;AAGF,gBAAiB,MAAK,eAAkB;EACtC;EACA;EACA;EACA;;AAGF;EACE;;AAGF,gBAAiB,MAAK;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,kBAAmB,mBAAmB,KAAI;AAAQ;EAChD;;AAGF,gBAAiB,MAAK,eAAkB,OAAK;EAC3C;;AAGF,aAAc,iBAAiB,MAAK,eAAe,QAAW;EAC5D;EACA;;AAGF,aAAc,iBAAiB,MAAK,eAAe,QAAW,OAAO;EACnE;;AAGF;AAAmB;EACjB;EACA;EACA;;AAGF,cAAe,YAAW,SAAU,MAAK,SAAU,KAAI,MAAM;EAC3D;;AAGF,IAAI,gBAAiB,KAAI;EACvB;;AAGF,IAAI,gBAAiB,KAAI,MAAO;EAC9B;;AAGF,kBAAmB;EACjB;EACA;;AAGF,eACE,mBAAmB;AADrB,eAC6B,mBAAmB;EAC5C;;AAFJ,eAKE,EAAC;AALH,eAKmC,EAAC;EAChC;EACA;EACA,sBAAA;EACA;EACA;;AAVJ,eAaE,EAAC;EACC,sBAAsB,wLAAtB;;AAdJ,eAiBE,EAAC;EACC,sBAAsB,8JAAtB;;AAlBJ,eAqBE,EAAC,8BAA8B;AArBjC,eAqByC,EAAC,gCAAgC;EACtE;EACA;EACA;;AAxBJ,eA2BE,aAAa;EACX;;AA5BJ,eA+BE,EAAC;EACC;EACA;EACA;;AAlCJ,eAqCE,cAAc;EACZ;;AAtCJ,eAyCE;EACE;EACA;;AA3CJ,eA8CE;EACE;EACA;EACA;EACA;EACA,qBAAA;EACA;EACA;;AArDJ,eAwDE,MAAK;EACH;EACA;EACA;EACA,yBAAA;EACA;;AA7DJ,eAgEE,uBAAuB;AAhEzB,eAgEyC,uBAAuB;EAC5D;EACA;EACA;;AAnEJ,eAsEE;EACE,yBAAA;EACA;EACA;EACA;;AA1EJ,eA6EE,YAAW;EACT,iCAAA;;AA9EJ,eAiFE,WAAU;EACR,6BAAA;;AAlFJ,eAqFE,WAAU,IAAI;EACZ,gCAAA;;AAtFJ,eAyFE,WAAU;EACR,gCAAA;;AA1FJ,eA6FE,MAAK;AA7FP,eA6FwB,MAAK;EACzB;EACA;;AA\/FJ,eAiGE,MAAK;EACH,6BAAA;;AAGJ,aAAa;EACX,0BAAA;EACA;EACA;EACA;;AAGF;AAA0B;AAAmB;EAC3C;;AAGF;AAAmB;EACjB;;AAGF,WAAW;EACT;;;;;;;;;AA4CF,mBAhCqC;EACnC;IACE;IACA;;EAGF,kBAAmB;IACjB;IACA;IACA;;EAGF;IACE;;EAGF,eAAe,eAAgB,cAAa;IAC1C;IACA;IACA;IACA;;EAGF;EAAmB;IACjB,kBAAA;;EAGF,IAAI,SAAU;IACZ;;;AAUJ,QAN0B;EACxB;IACE;IACA"}
{"version":3,"sources":["home\/server493388\/ftp\/public_html\/wyczarujprezent.pl\/modules\/thecheckout\/views\/css\/styles\/cute.less"],"names":[],"mappings":"YAAY;AAIZ;EACE;;AAGF,oBAAqB,iBAAiB,MAAK,MAAS,kBAAe;AACnE,oBAAqB,iBAAiB,OAAM,MAAS,kBAAe;EAClE;EACA;;AAGF;EACE;EACA;;AAGF,cAAe,YAAW,KAAM,MAAK,SAAU,aAAY;AAC3D,cAAe,YAAW,KAAK,SAAU,MAAM,aAAY;AAC3D,cAAe,YAAW,MAAO,MAAK,SAAU,aAAY;AAC5D,cAAe,YAAW,SAAU,MAAK,SAAU,aAAY;AAC\/D,cAAe,YAAW,IAAK,MAAK,SAAU,aAAY;AAC1D,cAAe,YAAW,OAAQ,MAAK,SAAU,aAAY;AAC7D,cAAe,YAAW,cAAe,MAAK,SAAU,aAAY;EAClE;;AAGF,QAAS,IAAG;EACV;EACA;EACA;;AAGF,WAAW;EACT;EACA;;AAOF;EACE,oCAAA;;AAGF;EACE;;AAGF,CAAC,mBAAmB,MAAO,sBAAqB;EAC9C,SAAS,qBAAT;EACA;EACA;EACA;EACA;EACA;EACA,gBAAA;EACA;EACA;;AAGF,CAAC,mBAAmB,MAAO;EACzB,gCAAA;;AAGF,IAAI;EACF;EACA;;AAGF;AAAmB;EACjB;EACA,sBAAA;EACA;;AAGF,qBAAsB;AAAa,oBAAqB;EACtD,uBAAA;;AAGF,iBAAiB;EACf;;AAGF,aAAc,MAAK;EACjB;EACA;;AAGF;EACE;EACA;;AAGF,OAAU;EACR;EACA,qBAAA;;AAGF,qBAAsB;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,qBAAsB,cAAc,MAAK,YAAe;EACtD;EACA;EACA;EACA;EACA;EACA,yBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,qBAAsB,cAAc,MAAK,YAAY,QAAW;EAC9D;EACA,yDAAA;;AAGF;EACE;EACA;;AAGF,mBAAoB;EAClB;EACA;EACA;;AAGF,mBAAoB,OAAM;EACxB;;AAGF,aAAc,KAAI;EAEhB;EACA;;AAGF,KAAK;EACH;EACA;;AAYF,QAT0B;EACxB;EAAa,iBAAiB;IAC5B;IACA;IACA;IACA;;;AAIJ,gBAAiB,MAAK;AAAe,gBAAiB,OAAM,aAAa;EACvE;EACA;EACA;EACA,yBAAA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;;AAGF,gBAAiB,KAAI,oBAAoB,IAAI;EAC3C;;AAGF;EACE,sBAAA;EACA;EACA;;AAGF,gBAAiB,MAAK,kBAAkB,IAAI,QAAQ;AACpD,gBAAiB,OAAM,kBAAkB,IAAI,QAAQ;EACnD;;AAGF,gBAAiB,MAAK,kBAAkB,IAAI,QAAW,OAAI;AAC3D,gBAAiB,OAAM,kBAAkB,IAAI,QAAW,OAAI;EAC1D;EACA;EACA;;AAGF,gBAAgB,SAAU,KAAI;AAC9B,SAAU,iBAAiB,KAAI;AAC\/B,gBAAiB,KAAI;EACnB;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE,sBAAA;;AAGF,oBAAoB,SAAS;AAAQ,oBAAoB,SAAS;EAChE,SAAS,EAAT;EACA;EACA;EACA,cAAA;EACA;EACA,gCAAA;;AAGF,gBAAiB,MAAK,kBAAkB,IAAI,QAAW,OAAI;AAAc,gBAAiB,OAAM,kBAAkB,IAAI,QAAW,OAAI;EACnI;EACA;EACA;;AAGF;EACE;EACA,iBAAA;EACA;EACA;;AAGF,OAAO;EACL;;;AASF,kBAAmB;EACjB;EACA;EACA;;AAGF;EACE;;AAGF,UAAW,mBAAkB,kBAAmB;EAC9C;EACA;;AAGF;EACE;;AAGF,mBAAoB;EAClB,sBAAA;EACA;EACA,aAAA;;AAGF;EACE;;AAGF,eAAe,eAAgB,cAAa;EAC1C;EACA,sBAAA;EACA;EACA;EACA;EACA;EACA;EACA,wBAAA;EACA;EACA;EACA;EACA;EACA,wDAAA;EACA,qDAAA;EACA,gDAAA;;AAGF,IAAI,SAAU,gBAAgB,YAAY,aAAa;EACrD;EACA;EACA;EACA;EACA;EACA,iBAAA;EACA;;AACA,IARE,SAAU,gBAAgB,YAAY,aAAa,EAQpD;EACC;EACA;;AAIJ,kBAAmB;EACjB;;AAGF,gBAAiB,GAAG;EAClB;EACA,iBAAA;EACA,cAAA;EACA;EACA;EACA;EAEA;EACA;;AAGF,gBAAiB,GAAG;EAClB;EACA,iBAAA;EACA,cAAA;EACA;EACA;EACA;EACA,sBAAA;EACA;;AAGF,GAAG;EACD,iBAAA;;AAGF,eAAgB,OAAM,IAAI,YAAY;EACpC;EACA;EAEA;EACA;EACA;;AAGF,aAAc,iBAAiB,MAAK,eAAkB;EACpD;EACA,yBAAA;;AAGF,gBAAiB,MAAK,eAAkB;EACtC;EACA;EACA;EACA;;AAGF;EACE;;AAGF,gBAAiB,MAAK;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,kBAAmB,mBAAmB,KAAI;AAAQ;EAChD;;AAGF,gBAAiB,MAAK,eAAkB,OAAK;EAC3C;;AAGF,aAAc,iBAAiB,MAAK,eAAe,QAAW;EAC5D;EACA;;AAGF,aAAc,iBAAiB,MAAK,eAAe,QAAW,OAAO;EACnE;;AAGF;AAAmB;EACjB;EACA;EACA;;AAGF,cAAe,YAAW,SAAU,MAAK,SAAU,KAAI,MAAM;EAC3D;;AAGF,IAAI,gBAAiB,KAAI;EACvB;;AAGF,IAAI,gBAAiB,KAAI,MAAO;EAC9B;;AAGF,kBAAmB;EACjB;EACA;;AAGF,eACE,mBAAmB;AADrB,eAC6B,mBAAmB;EAC5C;;AAFJ,eAKE,EAAC;AALH,eAKmC,EAAC;EAChC;EACA;EACA,sBAAA;EACA;EACA;;AAVJ,eAaE,EAAC;EACC,sBAAsB,wLAAtB;;AAdJ,eAiBE,EAAC;EACC,sBAAsB,8JAAtB;;AAlBJ,eAqBE,EAAC,8BAA8B;AArBjC,eAqByC,EAAC,gCAAgC;EACtE;EACA;EACA;;AAxBJ,eA2BE,aAAa;EACX;;AA5BJ,eA+BE,EAAC;EACC;EACA;EACA;;AAlCJ,eAqCE,cAAc;EACZ;;AAtCJ,eAyCE;EACE;EACA;;AA3CJ,eA8CE;EACE;EACA;EACA;EACA;EACA,qBAAA;EACA;EACA;;AArDJ,eAwDE,MAAK;EACH;EACA;EACA;EACA,yBAAA;EACA;;AA7DJ,eAgEE,uBAAuB;AAhEzB,eAgEyC,uBAAuB;EAC5D;EACA;EACA;;AAnEJ,eAsEE;EACE,yBAAA;EACA;EACA;EACA;;AA1EJ,eA6EE,YAAW;EACT,iCAAA;;AA9EJ,eAiFE,WAAU;EACR,6BAAA;;AAlFJ,eAqFE,WAAU,IAAI;EACZ,gCAAA;;AAtFJ,eAyFE,WAAU;EACR,gCAAA;;AA1FJ,eA6FE,MAAK;AA7FP,eA6FwB,MAAK;EACzB;EACA;;AA\/FJ,eAiGE,MAAK;EACH,6BAAA;;AAGJ,aAAa;EACX,0BAAA;EACA;EACA;EACA;;AAGF;AAA0B;AAAmB;EAC3C;;AAGF;AAAmB;EACjB;;AAGF,WAAW;EACT;;;;;;;;;AA6CF,mBAjCqC;EACnC;IACE;IACA;;EAGF,kBAAmB;IACjB;IACA;IACA;;EAGF;IACE;;EAGF,eAAe,eAAgB,cAAa;IAC1C;IACA;IACA;IACA;;EAGF;EAAmB;IACjB,kBAAA;;EAGF,eAAgB;IACd;IACA;;;AAUJ,QAN0B;EACxB;IACE;IACA"}

View File

@@ -0,0 +1,203 @@
/*
================================================================================
This stylesheet adds platic (with borders and shadows look to blocks
It tries to mimic modern fields layout, used by Google and similar big players
on their input forms
Also it creates field-enter flash effect as fun and engaging factor
================================================================================
*/
.checkout-block:not(#thecheckout-confirm) .inner-area {
box-shadow: 2px 2px 8px 0 rgba(0, 0, 0, 0.2);
border: 1px solid rgba(0, 0, 0, 0.125);
background: white;
}
/*
================================================================================
Input fields styling
================================================================================
*/
.has-float-label label,
.has-float-label span.field-label {
position: absolute;
left: 0;
top: -4px;
cursor: text;
font-size: 0.85em;
transition: all .2s;
opacity: 0.6;
}
.has-float-label input:placeholder-shown:not(:focus):not(:-webkit-autofill) ~ span.field-label,
.has-float-label select:placeholder-shown:not(:focus) ~ span.field-label {
font-size: 1.2em;
opacity: 0.3;
top: .9em;
padding-left: 5px;
}
.has-float-label input.form-control,
.has-float-label select.form-control {
font-size: 1.2em;
padding-top: 1em;
margin-bottom: 2px;
border: 0;
border-radius: 0;
border-bottom: 2px solid rgba(0, 0, 0, 0.1);
padding: 1em 0.5em 0.2em;
}
.has-float-label input,
.has-float-label select {
font-size: inherit;
padding-top: 1em;
margin-bottom: 2px;
border: 0;
border-radius: 0;
border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}
.-error ~ .error-msg {
margin-top: -2px;
}
.business-fields-separator:after,
.private-fields-separator:after {
margin: 15px auto 20px;
}
/*
================================================================================
Transition flash effects on input fields
================================================================================
*/
.effects-helper::after {
content: '';
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 100%;
height: 100%;
box-shadow: 0 0 0 0;
color: rgba(199, 152, 157, 0.6);
pointer-events: none;
}
.has-float-label input:focus ~ .effects-helper::after,
.has-float-label select:focus ~ .effects-helper::after {
-webkit-animation: anim-shadow 0.3s forwards;
animation: anim-shadow 0.3s forwards;
}
@-webkit-keyframes anim-shadow {
to {
box-shadow: 0 0 100px 50px;
opacity: 0;
}
}
@keyframes anim-shadow {
to {
box-shadow: 0 0 100px 50px;
opacity: 0;
}
}
/*
================================================================================
Shopping cart area
================================================================================
*/
input.cart-line-product-quantity {
width: 40px;
height: 36px;
text-align: center;
margin-right: 20px;
border-width: 1px;
}
a.cart-line-product-quantity-up,
a.cart-line-product-quantity-down {
display: inline-block;
width: 22px;
height: 18px;
position: absolute;
color: transparent;
/* hide actual label on that anchor */
background-size: 70% 70%;
background-position: center;
background-repeat: no-repeat;
background-color: white;
right: 0;
}
a.cart-line-product-quantity-up:hover,
a.cart-line-product-quantity-down:hover {
box-shadow: 1px 1px 4px 0px grey;
background-color: white;
background-size: 90% 90%;
}
.plus-simple {
background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3Csvg width='1792' height='1792' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z'/%3E%3C/svg%3E");
}
.minus-simple {
background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3Csvg width='1792' height='1792' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M1600 736v192q0 40-28 68t-68 28h-1216q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h1216q40 0 68 28t28 68z'/%3E%3C/svg%3E");
}
a.cart-line-product-quantity-up {
top: 0px;
background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3Csvg width='1792' height='1792' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z'/%3E%3C/svg%3E");
border: 1px solid #a39f9f;
border-bottom: 1px solid transparent;
}
a.cart-line-product-quantity-down {
top: 18px;
background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='utf-8'?%3E%3Csvg width='1792' height='1792' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M1600 736v192q0 40-28 68t-68 28h-1216q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h1216q40 0 68 28t28 68z'/%3E%3C/svg%3E");
border: 1px solid #a39f9f;
}
.qty-box {
position: relative;
box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.2);
}
.cart-item:first-child {
border-top: 1px solid #c1c1c1;
}
.cart-item:not(:last-child) {
border-bottom: 1px solid #eeeeee;
}
.cart-item:last-child {
border-bottom: 1px solid #c1c1c1;
}
.product-price-section .product-price,
.product-price-section a {
color: black;
}
/*
================================================================================
Reassurance area
================================================================================
*/
.thecheckout-reassurance {
text-align: center;
}
.reassurance-section {
margin: 20px auto 30px;
}
.reassurance-section.security:after,
.reassurance-section.delivery:after {
content: "";
display: block;
width: 80%;
margin: 0 auto;
padding-top: 20px;
border-bottom: 2px solid #85cad9;
}
/* Checkboxes */
.page-content .custom-checkbox input[type=checkbox]:checked + span {
filter: brightness(0);
}
.country-call-prefix {
font-size: 1.2em;
margin-top: calc(1em - 2px);
height: 1.8em;
border-radius: unset;
}
input:placeholder-shown:not(:focus):not(:-webkit-autofill) ~ .country-call-prefix {
display: none;
}
/* no-header class treatment */
.checkout-block.no-header {
margin-top: -11px;
padding-top: 0;
overflow-y: hidden;
margin-right: -5px;
padding-right: 8px;
}
/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22home%5C%2Fpeter%5C%2Fwww%5C%2Fpresta_178%5C%2Fmodules%5C%2Fthecheckout%5C%2Fviews%5C%2Fcss%5C%2Fstyles%5C%2Fmodern.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3B%3B%3B%3B%3B%3B%3B%3BAASA%2CeAAe%2CIAAI%2CsBAAuB%3BEACxC%2C4CAAA%3BEACA%2CsCAAA%3BEACA%3B%3B%3B%3B%3B%3B%3BAASF%2CgBAAiB%3BAAAO%2CgBAAiB%2CKAAI%3BEAC3C%3BEACA%3BEACA%3BEACA%3BEACA%3BEAEA%2CmBAAA%3BEACA%3B%3BAAGF%2CgBAAiB%2CMAAK%2CkBAAkB%2CIAAI%2CQAAQ%2CIAAI%2CmBAAsB%2COAAI%3BAAClF%2CgBAAiB%2COAAM%2CkBAAkB%2CIAAI%2CQAAW%2COAAI%3BEAC1D%3BEACA%3BEACA%3BEACA%3B%3BAAGF%2CgBAAiB%2CMAAK%3BAAAe%2CgBAAiB%2COAAM%3BEAC1D%3BEACA%3BEACA%3BEACA%3BEACA%3BEACA%2C2CAAA%3BEACA%2CwBAAA%3B%3BAAGF%2CgBAAiB%3BAAAO%2CgBAAiB%3BEACvC%3BEACA%3BEACA%3BEACA%3BEACA%3BEACA%2C2CAAA%3B%3BAAGF%2COAAU%3BEACR%3B%3BAAGF%2C0BAA0B%3BAAC1B%2CyBAAyB%3BEACvB%2CsBAAA%3B%3B%3B%3B%3B%3B%3BAASF%2CeAAe%3BEACb%2CSAAS%2CEAAT%3BEACA%3BEACA%3BEACA%3BEACA%3BEACA%3BEACA%3BEACA%2CmBAAA%3BEACA%2C%2BBAAA%3BEACA%3B%3BAAGF%2CgBAAiB%2CMAAK%2CMAAS%2CkBAAe%3BAAC9C%2CgBAAiB%2COAAM%2CMAAS%2CkBAAe%3BEAC7C%2C4CAAA%3BEACA%2CoCAAA%3B%3BAAGF%3BEACE%3BIACE%2C0BAAA%3BIACA%3B%3B%3BAAIJ%3BEACE%3BIACE%2C0BAAA%3BIACA%3B%3B%3B%3B%3B%3B%3B%3BAAaJ%2CKAAK%3BEACH%2CWAAA%3BEAEA%2CYAAA%3BEACA%3BEACA%3BEACA%3B%3BAAGF%2CCAAC%3BAAAgC%2CCAAC%3BEAChC%3BEACA%3BEACA%2CYAAA%3BEACA%3BEACA%3B%3BEACA%2CwBAAA%3BEACA%3BEACA%3BEACA%3BEACA%3B%3BAAEA%2CCAZD%2C8BAYE%3BAAAD%2CCAZgC%2CgCAY%5C%2FB%3BEACC%2CgCAAA%3BEACA%3BEACA%2CwBAAA%3B%3BAAKJ%3BEACE%2CsBAAsB%2CiaAAtB%3B%3BAAGF%3BEACE%2CsBAAsB%2CwTAAtB%3B%3BAAGF%2CCAAC%3BEACC%3BEARA%2CsBAAsB%2CiaAAtB%3BEAYA%2CyBAAA%3BEACA%2CoCAAA%3B%3BAAIF%2CCAAC%3BEACC%2CSAAA%3BEAdA%2CsBAAsB%2CwTAAtB%3BEAkBA%2CyBAAA%3B%3BAAGF%3BEACE%3BEACA%2C4CAAA%3B%3BAAGF%2CUAAU%3BEACR%2C6BAAA%3B%3BAAGF%2CUAAU%2CIAAI%3BEACZ%2CgCAAA%3B%3BAAGF%2CUAAU%3BEACR%2CgCAAA%3B%3BAAGF%2CsBAAuB%3BAAAgB%2CsBAAuB%3BEAC5D%3B%3B%3B%3B%3B%3B%3BAASF%3BEACE%3B%3BAAGF%3BEACE%2CsBAAA%3B%3BAAGF%2CoBAAoB%2CSAAS%3BAAAQ%2CoBAAoB%2CSAAS%3BEAChE%2CSAAS%2CEAAT%3BEACA%3BEACA%3BEACA%2CcAAA%3BEACA%3BEACA%2CgCAAA%3B%3B%3BAAKF%2CaAAc%2CiBAAiB%2CMAAK%2CeAAe%2CQAAW%3BEAC5D%2CQAAQ%2CaAAR%3B%3BAAGF%3BEACE%3BEACA%2C2BAAA%3BEACA%3BEACA%3B%3BAAGF%2CKAAK%2CkBAAkB%2CIAAI%2CQAAQ%2CIAAI%2CmBAAsB%3BEAC3D%3B%3B%3BAAKF%2CeAAe%3BEACb%3BEACA%3BEACA%3BEACA%3BEACA%22%7D */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["home\/peter\/www\/presta_178\/modules\/thecheckout\/views\/css\/styles\/modern.less"],"names":[],"mappings":";;;;;;;;AASA,eAAe,IAAI,sBAAuB;EACxC,4CAAA;EACA,sCAAA;EACA;;;;;;;AASF,gBAAiB;AAAO,gBAAiB,KAAI;EAC3C;EACA;EACA;EACA;EACA;EAEA,mBAAA;EACA;;AAGF,gBAAiB,MAAK,kBAAkB,IAAI,QAAQ,IAAI,mBAAsB,OAAI;AAClF,gBAAiB,OAAM,kBAAkB,IAAI,QAAW,OAAI;EAC1D;EACA;EACA;EACA;;AAGF,gBAAiB,MAAK;AAAe,gBAAiB,OAAM;EAC1D;EACA;EACA;EACA;EACA;EACA,2CAAA;EACA,wBAAA;;AAGF,gBAAiB;AAAO,gBAAiB;EACvC;EACA;EACA;EACA;EACA;EACA,2CAAA;;AAGF,OAAU;EACR;;AAGF,0BAA0B;AAC1B,yBAAyB;EACvB,sBAAA;;;;;;;AASF,eAAe;EACb,SAAS,EAAT;EACA;EACA;EACA;EACA;EACA;EACA;EACA,mBAAA;EACA,+BAAA;EACA;;AAGF,gBAAiB,MAAK,MAAS,kBAAe;AAC9C,gBAAiB,OAAM,MAAS,kBAAe;EAC7C,4CAAA;EACA,oCAAA;;AAGF;EACE;IACE,0BAAA;IACA;;;AAIJ;EACE;IACE,0BAAA;IACA;;;;;;;;AAaJ,KAAK;EACH,WAAA;EAEA,YAAA;EACA;EACA;EACA;;AAGF,CAAC;AAAgC,CAAC;EAChC;EACA;EACA,YAAA;EACA;EACA;;EACA,wBAAA;EACA;EACA;EACA;EACA;;AAEA,CAZD,8BAYE;AAAD,CAZgC,gCAY\/B;EACC,gCAAA;EACA;EACA,wBAAA;;AAKJ;EACE,sBAAsB,iaAAtB;;AAGF;EACE,sBAAsB,wTAAtB;;AAGF,CAAC;EACC;EARA,sBAAsB,iaAAtB;EAYA,yBAAA;EACA,oCAAA;;AAIF,CAAC;EACC,SAAA;EAdA,sBAAsB,wTAAtB;EAkBA,yBAAA;;AAGF;EACE;EACA,4CAAA;;AAGF,UAAU;EACR,6BAAA;;AAGF,UAAU,IAAI;EACZ,gCAAA;;AAGF,UAAU;EACR,gCAAA;;AAGF,sBAAuB;AAAgB,sBAAuB;EAC5D;;;;;;;AASF;EACE;;AAGF;EACE,sBAAA;;AAGF,oBAAoB,SAAS;AAAQ,oBAAoB,SAAS;EAChE,SAAS,EAAT;EACA;EACA;EACA,cAAA;EACA;EACA,gCAAA;;;AAKF,aAAc,iBAAiB,MAAK,eAAe,QAAW;EAC5D,QAAQ,aAAR;;AAGF;EACE;EACA,2BAAA;EACA;EACA;;AAGF,KAAK,kBAAkB,IAAI,QAAQ,IAAI,mBAAsB;EAC3D;;;AAKF,eAAe;EACb;EACA;EACA;EACA;EACA"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

View File

@@ -1,11 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Warstwa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;}
.st1{fill:#A20401;}
</style>
<path class="st0" d="M0,0h24v24H0V0z"/>
<path class="st1" d="M9,16.2L4.8,12l-1.4,1.4L9,19L21,7l-1.4-1.4L9,16.2z"/>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" fill="#36b4d2"/>
</svg>

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

View File

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -380,6 +380,14 @@ function setForceEmailOverlay(makeInactive) {
}
}
function setPaypalExpressCheckoutState(makeInactive) {
if (makeInactive) {
$('[name=TC_paypal_express_checkout]').closest('.form-group').addClass('inactive');
} else {
$('[name=TC_paypal_express_checkout]').closest('.form-group').removeClass('inactive');
}
}
function setHash(hash) {
if ("onhashchange" in window) {
window.location.hash = '#' + hash;
@@ -403,7 +411,11 @@ function setConfigTabs() {
})
$('.page-head:first').append('<div id="tab-handles"></div>')
if ($('#content .page-head > .wrapper').length) {
$('.page-head:first').append('<div id="tab-handles"></div>');
} else {
$('.page-head:first').after('<div id="tab-handles"></div>');
}
$('#module_form > .panel').each(function() {
var label = $.trim($(this).find('.panel-heading').text());
$('#tab-handles').append('<div data-section-id="'+$(this).attr('id')+'">'+label+'</div>');
@@ -571,6 +583,8 @@ $(document).ready(function () {
setForceEmailOverlay(isPasswordRequired());
});
setPaypalExpressCheckoutState($('[name=tc_paypal_express_checkout_active]').val() != '1');
// Fix for big header on config page
window.onscroll = function () {

View File

@@ -83,19 +83,14 @@ body.is-virtual-cart #thecheckout-address-invoice
display: block;
}
/* // ---------------> Update labels here */
/* English and Danish versions, for other languages, add new rules .lang-xx prefix instead of .lang-en */
.lang-en .email-verification .field.error-msg.emails-do-not-match:before {
content: 'Emails do not match';
}
.lang-en .form-group.email-verification .field-label:before {
content: '(repeat)';
}
.lang-da .email-verification .field.error-msg.emails-do-not-match:before {
content: 'E-mail adresserne er ikke ens';
}
.lang-da .form-group.email-verification .field-label:before {
content: '(en gang til)';
}
2/ Add Custom JS in checkout module settings:
@@ -107,10 +102,10 @@ document.addEventListener('DOMContentLoaded', function(event) {
tc_confirmOrderValidations['email_verification'] = function() {
$(email_verif_selector +' .error-msg').remove();
if (
$(email_verif_selector + ' input[name=email]:visible').length &&
$(email_selector + ' input[name=email]').val() != $(email_verif_selector + ' input[name=email]').val()
$(email_verif_selector + ' input[name=email-verification]:visible').length &&
$(email_selector + ' input[name=email]').val() != $(email_verif_selector + ' input[name=email-verification]').val()
) {
$(email_verif_selector + ' label').addClass('-error');
$(email_verif_selector + ' label input').addClass('-error');
$(email_verif_selector + ' label input').after('<div class="field error-msg emails-do-not-match"></div>');
scrollToElement($(email_verif_selector));
return false;
@@ -120,9 +115,175 @@ document.addEventListener('DOMContentLoaded', function(event) {
}
$('.account-fields .form-group.email:visible').clone().addClass('email-verification').insertAfter('.account-fields .form-group.email');
$('.email-verification > input').attr('name', 'email-verification');
// ---------------> Update labels here
if (prestashop.language.iso_code == 'en') {
$(email_verif_selector + ' .field-label').html('Confirm e-mail ');
} else if (prestashop.language.iso_code == 'da') {
$(email_verif_selector + ' .field-label').html('Bekræft e-mail ');
}
});
});
// ##### Example 5 - checkout steps #####
// Validation expression (JS) to check filled in address
$('.address-fields, .account-fields').find('input.form-control[required]:visible').filter((k,v) => $(v).val() == '').length == 0
// Display cart-summary on each step, but have it styled differently in step 1 (full-width), add custom CSS:
.checkout-step-1 .checkout-area-4 {
display: block;
}
// ##### Example 6 - pre-tick checkboxes (on page load) #####
// Add to custom JS:
document.addEventListener('DOMContentLoaded', function(event) {
// Pre-tick terms and conditions and psgdpr checkboxes
$('[name^=conditions_to_approve], [name=psgdpr]').prop('checked', true);
});
// ##### Example 7 - validate phone input (9 numbers) #####
tc_confirmOrderValidations['phone_9_numbers'] = function () {
var phoneFields = $('.address-fields input[type=tel]:visible');
var errorMsg = 'Phone must have 9 digits';
phoneFields.removeClass('-error');
removeError(phoneFields.siblings('.error-msg'));
var allPhoneFieldsOK = true;
phoneFields.each(function() {
var phoneVal = $(this).val().trim();
if (phoneVal && phoneVal.replace(/[^0-9]/g, '').length !== 9) {
allPhoneFieldsOK = false;
$(this).addClass('-error');
$(this).after('<div class="field error-msg">' + errorMsg + '</div>');
}
});
if (!allPhoneFieldsOK) {
scrollToError();
}
return allPhoneFieldsOK;
};
// ##### Example 8 - validate address1 (street) to have 2+ non-numeric characters and 1 number #####
tc_confirmOrderValidations['street_non_numeric'] = function () {
var addressFields = $('.address-fields input[name=address1]:visible');
var errorMsg = 'Street name must be at least 2 characters and number';
addressFields.removeClass('-error');
removeError(addressFields.siblings('.error-msg'));
var allAddressFieldsOK = true;
addressFields.each(function() {
var addressVal = $(this).val();
if (addressVal !== '' && (addressVal.replace(/[^a-zA-Z]/g, '').length < 2 || addressVal.replace(/[^0-9]/g, '').length < 1)) {
allAddressFieldsOK = false;
$(this).addClass('-error');
$(this).after('<div class="field error-msg">' + errorMsg + '</div>');
}
});
if (!allAddressFieldsOK) {
scrollToError();
}
return allAddressFieldsOK;
};
// ##### Example 9 - using craftyclick module (for the UK) + shipping parcel points module #####
// Add custom JS
document.addEventListener('DOMContentLoaded', function(event) {
$('body').off('click.crafty').on('click.crafty', '[id$=_cp_button_id]', function() { setTimeout(function() { $('.address-fields [name=city]:visible').change(); }, 200); })
});
// ##### Example 10 - Add payment logos
// 1. Firstly, find and add logos to PS file structure, e.g. to /modules/thecheckout/views/img folder
// 2. Add custom CSS, this is example for ps_wirepayment method:
/* ps_wirepayment logo */
[data-payment-module=ps_wirepayment] .payment-logo {
background: left / contain no-repeat url('../modules/thecheckout/views/img/wirepayment.png');
width: 30px;
height: 30px;
margin-right: 5px;
}
// ##### Example 10 - limit delivery countries based on invoice country #####
document.addEventListener('DOMContentLoaded', function(event) {
//jQuery shall be loaded now
tc_confirmOrderValidations['restrict_delivery_country'] = function() {
const invoiceCountry = $('#thecheckout-address-invoice select[name=id_country]:visible option:selected').data('iso-code');
const deliveryCountry = $('#thecheckout-address-delivery select[name=id_country]:visible option:selected').data('iso-code') ?? invoiceCountry;
const deliveryBlockVisible = $('#thecheckout-address-delivery').is(':visible');
if (!deliveryBlockVisible) {
return true;
}
var canShip = true;
var errorMsg = 'Wrong delivery / invoice country combination';
if (invoiceCountry == 'CH' && deliveryCountry != 'CH') {
canShip = false;
errorMsg = 'Invoice address in Switzerland -> cannot ship outside of Switzerland.'
}
if (invoiceCountry != 'PL' && deliveryCountry == 'PL') {
canShip = false;
errorMsg = 'Delivery in Poland -> invoice must be in Poland.'
}
if (invoiceCountry == 'PL' && deliveryCountry != 'PL') {
canShip = false;
errorMsg = 'Invoice in Poland -> shipping must be in Poland.'
}
$('#thecheckout-address-delivery [name=id_country]').removeClass('-error');
removeError('#thecheckout-address-delivery .error-msg');
if (!canShip) {
$('#thecheckout-address-delivery [name=id_country]').addClass('-error');
$('#thecheckout-address-delivery [name=id_country]').after('<div class="field error-msg">' + errorMsg + '</div>');
scrollToError();
return false;
} else {
return true;
}
}
});
//# sourceURL=tc-custom.js
// ##### Example 11 - make one of business/private checkboxes always required #####
document.addEventListener('DOMContentLoaded', function(event) {
//jQuery shall be loaded now
tc_confirmOrderValidations['business_private_required'] = function() {
// do this check for both .business-private-checkboxes in #thecheckout-address-delivery and #thecheckout-address-invoice
let result = true;
['#thecheckout-address-delivery', '#thecheckout-address-invoice'].forEach(function (selector) {
const businessPrivateVisible = $(selector + ' .business-private-checkboxes input[type=checkbox]:visible').length > 0;
const businessPrivateChecked = $(selector + ' .business-private-checkboxes input[type=checkbox]:checked').length > 0;
$(selector + ' .business-private-checkboxes').removeClass('-error');
removeError(selector + ' .business-private-checkboxes .error-msg');
let errorMsg = 'Please select one of the options';
switch (prestashop?.language?.iso_code) {
case 'it':
errorMsg = 'Seleziona una delle opzioni';
break;
}
if (businessPrivateVisible && !businessPrivateChecked) {
$(selector + ' .business-private-checkboxes').addClass('-error');
// Add error in front of checkboxes
$(selector + ' .business-private-checkboxes').prepend('<div class="field error-msg">' + errorMsg + '</div>');
scrollToError();
result = false;
}
});
return result;
}
});
//# sourceURL=tc-custom.js

View File

@@ -93,7 +93,7 @@ $(document).ready(function () {
checkAndHideGlobalError();
});
$('body').on('change', '#js-delivery input', function () {
$('body').on('change', '#js-delivery .shipping-radio input', function () {
selectDeliveryOption($('#js-delivery')); // delivery form object as parameter
});
@@ -190,6 +190,12 @@ $(document).ready(function () {
});
$('body').on('change', '[data-link-action=x-ship-to-different-address]', function () {
// Hook to this:
// prestashop.on('thecheckout_changeSecondAddress', function(data) { console.log('second address block toggled!', data); })
prestashop.emit('thecheckout_changeSecondAddress', {
'addressType': 'delivery',
'isCollapsing': $('#thecheckout-address-delivery').is(':visible')
});
if ($('#thecheckout-address-delivery').is(':visible')) {
$(this).prop('checked', false);
@@ -210,6 +216,11 @@ $(document).ready(function () {
});
$('body').on('change', '[data-link-action=x-bill-to-different-address]', function () {
prestashop.emit('thecheckout_changeSecondAddress', {
'addressType': 'invoice',
'isCollapsing': $('#thecheckout-address-invoice').is(':visible')
});
if ($('#thecheckout-address-invoice').is(':visible')) {
$(this).prop('checked', false);
$('#thecheckout-address-invoice').hide(10, function () {
@@ -256,6 +267,7 @@ $(document).ready(function () {
if ($('#dni-placeholder').length && $('#thecheckout-address-invoice .business-field.dni').length) {
swapElements($('#dni-placeholder'), $('#thecheckout-address-invoice .business-field.dni'));
}
removeError('.business-private-checkboxes > .error-msg');
return false;
});
@@ -280,6 +292,7 @@ $(document).ready(function () {
if ($('#dni-placeholder-delivery').length && $('#thecheckout-address-delivery .business-field.dni').length) {
swapElements($('#dni-placeholder-delivery'), $('#thecheckout-address-delivery .business-field.dni'));
}
removeError('.business-private-checkboxes > .error-msg');
return false;
});
@@ -304,6 +317,7 @@ $(document).ready(function () {
if ($('#dni-placeholder-private').length && $('#thecheckout-address-invoice .private-field.dni').length) {
swapElements($('#dni-placeholder-private'), $('#thecheckout-address-invoice .private-field.dni'));
}
removeError('.business-private-checkboxes > .error-msg');
return false;
});
@@ -328,10 +342,37 @@ $(document).ready(function () {
if ($('#dni-placeholder-private-delivery').length && $('#thecheckout-address-delivery .private-field.dni').length) {
swapElements($('#dni-placeholder-private-delivery'), $('#thecheckout-address-delivery .private-field.dni'));
}
removeError('.business-private-checkboxes > .error-msg');
return false;
});
$('body').on('change', '[data-link-action^=x-i-am-private],[data-link-action^=x-i-am-business]', function () {
const linkAction = $(this).data('link-action');
const isBusiness = linkAction.startsWith('x-i-am-business');
const addressType = linkAction.endsWith('delivery') ? 'delivery' : 'invoice';
const isChecked = $(this).prop('checked');
// prestashop.on('thecheckout_businessPrivateChecked', function(data) { console.log('business or private checkbox selected!', data); })
prestashop.emit('thecheckout_businessPrivateChecked', {
addressType, isBusiness, isChecked
});
return false;
});
if (config_use_other_for_business_private) {
prestashop.on('thecheckout_businessPrivateChecked', function (data) {
const field = $(`#thecheckout-address-${data.addressType} [name=other]`);
const isBusinessMsg = i18_business ?? 'business';
const isPrivateMsg = i18_private ?? 'private';
let msg = '';
if (data.isChecked) {
msg = data.isBusiness ? isBusinessMsg : isPrivateMsg;
}
field.val(msg);
});
}
$('body').on('click', '[data-link-action=toggle-password-visibility]', function () {
var input = $(this).closest('label').find('input');
@@ -367,7 +408,10 @@ $(document).ready(function () {
});
$('body').on('click', '[data-link-action=x-update-cart-quantity-up]', function () {
var inputEl = $(this).parent().find('[data-link-action=x-update-cart-quantity]');
inputEl.val(parseInt(inputEl.val()) + 1).data('no-wait', 1); // .trigger('input');
const data = inputEl.data();
const qtyHave = parseInt(inputEl.val());
const qtyChange = data?.step ?? 1;
inputEl.val(qtyHave + qtyChange).data('no-wait', 1); // .trigger('input');
inputEl.get(0).dispatchEvent(new Event('input', {
bubbles: true
}))
@@ -375,8 +419,11 @@ $(document).ready(function () {
});
$('body').on('click', '[data-link-action=x-update-cart-quantity-down]', function () {
var inputEl = $(this).parent().find('[data-link-action=x-update-cart-quantity]');
if (parseInt(inputEl.attr('min')) < parseInt(inputEl.val())) {
inputEl.val(parseInt(inputEl.val()) - 1).data('no-wait', 1); // .trigger('input');
const data = inputEl.data();
const qtyHave = parseInt(inputEl.val());
const qtyChange = data?.step ?? 1;
if (parseInt(inputEl.attr('min')) <= qtyHave - qtyChange) {
inputEl.val(qtyHave - qtyChange).data('no-wait', 1); // .trigger('input');
inputEl.get(0).dispatchEvent(new Event('input', {
bubbles: true
}))
@@ -518,6 +565,11 @@ $(document).ready(function () {
$('[data-link-action="toggle-password-visibility"]').removeClass('hidden');
$(document).ajaxError(function myErrorHandler(event, xhr, ajaxOptions, thrownError) {
if (['abort', 'canceled'].includes(thrownError)) {
// console.log('Ajax aborted', ajaxOptions)
return;
}
console.info("Ajax error \n\nDetails:\nError thrown: " + thrownError + "\n" +
'event: ');
console.info(event);
@@ -534,6 +586,7 @@ $(document).ready(function () {
var modalTriggeredToBeShown = 0;
setTimeout( function() {
$(".js-terms a").off('click');
$(".dm_gdpr_active a.iframe").removeClass('iframe');
$("body#checkout").on("click", ".js-terms a", function (t) {
modalTriggeredToBeShown++;
setTimeout(function() { modalTriggeredToBeShown--; }, 1000);
@@ -597,7 +650,7 @@ $(document).ready(function () {
}
// Attach also loading-remove handler, when (this) ajax is finished
jqxhr.always(function() {
$(settings.customPropAffectedBlocks).find('.inner-area > .tc-ajax-loading').remove();
$(settings.customPropAffectedBlocks).find('.inner-area > .tc-ajax-loading').remove();
});
}
});
@@ -638,13 +691,14 @@ function initBlocksSelectors() {
}
function handleWindowResize(win) {
if (win.width() <= tcMobileViewThreshold && !tcIsMobileView) {
const winWidth = window.innerWidth; // win.width()
if (winWidth <= tcMobileViewThreshold && !tcIsMobileView) {
tcIsMobileView = true;
// Take out all checkout blocks from their desktop layout and put into new container for mobile sorting
$('.checkout-block').each(function () {
$(this).appendTo('#tc-container-mobile');
});
} else if (win.width() > tcMobileViewThreshold && tcIsMobileView) {
} else if (winWidth > tcMobileViewThreshold && tcIsMobileView) {
tcIsMobileView = false;
// Put .checkout-block containers back to desktop (out of mobile / single column layout)
$('.checkout-block').each(function () {
@@ -706,6 +760,13 @@ function checkAndHideGlobalError() {
function showGlobalError() {
$('#tc-payment-confirmation > .error-msg').show();
scrollToError();
if (typeof grecaptcha !== 'undefined' && typeof grecaptcha.reset === 'function') {
try {
grecaptcha.reset();
} catch (error) {
// intentionally empty
}
}
}
function scrollToError() {
@@ -779,6 +840,13 @@ function modifyRadioOption(radioElements) {
});
}
function printContextNotices(blockSel, notices) {
$.each(notices, function (index, value) {
$(blockSel + ' [name=' + index + ']').addClass('-notice');
$(blockSel + ' [name=' + index + ']').after('<div class="field notice-msg">' + value + '</div>');
});
}
function printContextErrors(blockSel, errors, triggerElement, dontShowGlobal) {
var highlightOnElements = [];
@@ -818,6 +886,13 @@ function printContextErrors(blockSel, errors, triggerElement, dontShowGlobal) {
if (switchToStep > 0 && typeof setHash === 'function') {
setHash(switchToStep);
}
// For invisible or non-existing fields, let's collect all errors inside 'general_error'
if (!$(blockSel + ' [name=' + index + ']').is(':visible')) {
value = index + ': ' + value;
index = 'general_error';
}
$(blockSel + ' [name=' + index + ']').addClass('-error');
if ($(blockSel + ' [name=' + index + ']').is(':checkbox') || $(blockSel + ' [name=' + index + ']').is(':radio')) {
$(blockSel + ' [name=' + index + ']').closest('.form-group').append('<div class="field error-msg">' + value + '</div>');
@@ -931,7 +1006,7 @@ function addVoucher() {
// so we need to fetch this again; only enable if voucher affect shipping cost
getShippingAndPaymentBlocks();
} else {
updateCheckoutBlocks(jsonData, true, false, false);
updateCheckoutBlocks(jsonData, true, false, false, true);
}
}
}
@@ -960,7 +1035,7 @@ function removeVoucher(data) {
if (tcGlobal_fetchAgainAfterVoucher) {
getShippingAndPaymentBlocks();
} else {
updateCheckoutBlocks(jsonData, true, true, tc_updatePaymentWithShipping);
updateCheckoutBlocks(jsonData, true, false, tc_updatePaymentWithShipping, true);
}
}
}
@@ -979,6 +1054,7 @@ function confirmOrder(confirmButtonEl) {
var validationFailed = false;
// clear shipping error before validations
$('#thecheckout-shipping .error-msg').not(':first-child').remove();
$('#thecheckout-shipping .error-msg').hide();
$.each(tc_confirmOrderValidations, function (validationName, validationCallback) {
@@ -1113,6 +1189,12 @@ function updateQuantityFromInput(el) {
// $('#thecheckout-cart-summary').prepend('<div class="error-msg">' + errMsg + '</div>')
// $('#thecheckout-cart-summary > .error-msg').show();
// }
prestashop.emit('updateCart', { reason: {
idProduct: data["idProduct"],
idProductAttribute: data["idProductAttribute"],
idProductCustomization: data["idCustomization"],
action: 'updateQuantity'
}, resp: jsonData });
updateCheckoutBlocks(jsonData, true, true, tc_updatePaymentWithShipping);
}
@@ -1213,6 +1295,12 @@ function checkEmail(accountFormSelector, triggerEl, callback) {
blockSel = ':is(#thecheckout-account, #thecheckout-data-privacy, #thecheckout-psgdpr)';
printContextErrors(blockSel, jsonData.errors, undefined, true);
} else {
blockSelAccount = ':is(#thecheckout-account)';
removeError(blockSelAccount + ' .field.notice-msg');
if (typeof jsonData.notices !== 'undefined' && jsonData.notices['email']) {
printContextNotices(blockSelAccount, jsonData.notices);
}
updateAccountToken(jsonData.newToken);
updateStaticToken(jsonData.newStaticToken);
// if out of some reason, shipping/payment blocks are still disallowed, maybe entering email
@@ -1358,6 +1446,10 @@ function _getExtraAccountParams() {
if ($('[name=colissimo_is_mobile_valid]').length) {
extraAccountParams += '&colissimo_is_mobile_valid=' + encodeURIComponent($('[name=colissimo_is_mobile_valid]').val());
}
// lpshipping module (terminal selection)
if ($('[name=lpshipping_express_terminal]').length) {
extraAccountParams += '&lpshipping_express_terminal=' + encodeURIComponent($('[name=lpshipping_express_terminal]').val());
}
// djtalbrazilianregister (CPF/CNPJ fields module)
if ($('[name=document_type]').length && $('[name=document_number]').length) {
$('input[name=document_type]:checked, input[name=document_number], input[name=rg], input[name=ie]').each( (key, item) => {
@@ -1368,6 +1460,19 @@ function _getExtraAccountParams() {
if ($('#parcel_codigo').length === 1) {
extraAccountParams += '&parcel[codigo]=' + encodeURIComponent($('#parcel_codigo').val());
}
// dpdbaltics
if ($('.carrier-extra-content.dpdbaltics:visible [name=dpd-phone]').length === 1) {
extraAccountParams += '&dpd-phone=' + encodeURIComponent($('.carrier-extra-content.dpdbaltics:visible [name=dpd-phone]').val());
}
if ($('.carrier-extra-content.dpdbaltics:visible [name=dpd-phone-area]').length === 1) {
extraAccountParams += '&dpd-phone-area=' + encodeURIComponent($('.carrier-extra-content.dpdbaltics:visible [name=dpd-phone-area]').val());
}
if ($('.carrier-extra-content.dpdbaltics:visible [name=dpd-city]').length === 1) {
extraAccountParams += '&dpd-city=' + encodeURIComponent($('.carrier-extra-content.dpdbaltics:visible [name=dpd-city]').val());
}
if ($('.carrier-extra-content.dpdbaltics:visible [name=dpd-street]').length === 1) {
extraAccountParams += '&dpd-street=' + encodeURIComponent($('.carrier-extra-content.dpdbaltics:visible [name=dpd-street]').val());
}
return extraAccountParams;
}
@@ -1403,8 +1508,8 @@ function modifyAccountAndAddress(triggerElement, callback) {
dataType: "json",
data: "modifyAccountAndAddress=1&ajax_request=1&action=modifyAccountAndAddress&trigger=" + triggerSection +
"&account=" + serializeVisibleFields('form.account-fields') +
"&invoice=" + encodeURIComponent($('#thecheckout-address-invoice form :visible').serialize()) +
"&delivery=" + encodeURIComponent($('#thecheckout-address-delivery form :visible').serialize()) +
"&invoice=" + encodeURIComponent($('#thecheckout-address-invoice form :visible, #thecheckout-address-invoice .use-other-for-business-private input').serialize()) +
"&delivery=" + encodeURIComponent($('#thecheckout-address-delivery form :visible, #thecheckout-address-delivery .use-other-for-business-private input').serialize()) +
"&passwordVisible=" + $('#thecheckout-account input[name=password]:visible').length +
"&passwordRequired=" + $('#thecheckout-account input[name=create-account]:checked').length +
"&invoiceVisible=" + $('#thecheckout-address-invoice form:visible').length +
@@ -1421,13 +1526,31 @@ function modifyAccountAndAddress(triggerElement, callback) {
// Go through account, invoice and delivery errors, show them all
if ("undefined" !== typeof jsonData.account && null !== jsonData.account) {
blockSel = ':is(#thecheckout-account, #thecheckout-data-privacy, #thecheckout-psgdpr)';
printContextErrors(blockSel, jsonData.account.errors);
if (typeof tc_steps !== 'undefined') {
// When steps are enabled, these checkboxes can be on different 'steps' pages, so we need to call printContextError with correct blockSel-ector
var checkboxes = ['data-privacy', 'psgdpr', 'required-checkbox-1', 'required-checkbox-2'];
var checkboxErrors = false
for (const checkboxName of checkboxes) {
if (jsonData.account.errors[checkboxName]?.length) {
printContextErrors(`#thecheckout-${checkboxName}`, jsonData.account.errors);
checkboxErrors = true
break;
}
}
if (!checkboxErrors) {
blockSel = ':is(#thecheckout-account)';
printContextErrors(blockSel, jsonData.account.errors);
}
} else {
blockSel = ':is(#thecheckout-account, #thecheckout-data-privacy, #thecheckout-psgdpr, #thecheckout-required-checkbox-1, #thecheckout-required-checkbox-2)';
printContextErrors(blockSel, jsonData.account.errors);
}
if (jsonData.account.hasErrors) {
if (debug_js_controller) {
var errMsg = formatErrors(jsonData.account.errors, triggerElement);
console.info('modifyAccountAndAddress: account has errros');
console.info('modifyAccountAndAddress: account has errors');
console.info(errMsg);
}
@@ -1515,7 +1638,7 @@ function modifyAccountAndAddress(triggerElement, callback) {
hideConfirmButtonLoader($('[data-link-action=x-save-account-overlay]'));
if ("undefined" !== typeof jsonData.shippingErrors && null !== jsonData.shippingErrors && "undefined" !== typeof jsonData.shippingErrors.errors) {
var errorsTxt = jsonData.shippingErrors.errors.join(', ');
var errorsTxt = Object.values(jsonData.shippingErrors.errors).join(', ');
$('<div class="error-msg shipping-errors">'+errorsTxt+'</div>').prependTo($('#thecheckout-shipping .inner-wrapper')).show();
noErrors = false;
showGlobalError();
@@ -1574,6 +1697,12 @@ function signIn() {
signedInUpdateForm();
}
},
error: function(jqXHR, textStatus, errorThrown) {
if(jqXHR.status === 500) {
console.error("Internal server error occurred: ", errorThrown);
}
location.reload();
}
});
}
@@ -1589,7 +1718,7 @@ function deleteFromCart(data, self) {
// Avanto an_productfields module support
var anGroupId = $(self).attr('href').match('an_group_id.*');
additionalData += (anGroupId)?'&'+anGroupId:'';
// url - implicitly using current
$.ajax({
customPropAffectedBlocks: '#thecheckout-shipping, #thecheckout-payment, #thecheckout-cart-summary',
@@ -1605,6 +1734,13 @@ function deleteFromCart(data, self) {
"&token=" + static_token + additionalData,
success: function (jsonData) {
prestashop.emit('updateCart', { reason: {
idProduct: data["idProduct"],
idProductAttribute: data["idProductAttribute"],
idProductCustomization: data["idCustomization"],
action: 'deleteFromCart'
}, resp: jsonData });
updateCheckoutBlocks(jsonData, true, true, tc_updatePaymentWithShipping);
}
@@ -1852,10 +1988,63 @@ function highlightSelectedPaymentMethod() {
}
}
function updateShippingPrices(shippingBlockHtml) {
if ('undefined' !== shippingBlockHtml && null !== shippingBlockHtml) {
var $parsedShippingBlock = $(shippingBlockHtml);
$parsedShippingBlock.find('.delivery-option').each(function() {
var $parsedDeliveryOption = $(this);
var carrierRef = $parsedDeliveryOption.attr('class').match(/carrier-ref-\d+/)[0];
// if carrierRef is not found, we cannot update prices, skip this .each() iteration
if (!carrierRef) {
return;
}
var $actualDeliveryOption = $('.delivery-options-list .delivery-option.' + carrierRef);
// if respective carrierRef delivery option is not available, skip this .each() iteration
if (!$actualDeliveryOption.length) {
return;
}
var priceTypes = ['carrier-price', 'carrier-price-with-tax-formatted', 'carrier-price-without-tax-formatted'];
priceTypes.forEach(function(priceType) {
var $parsedPrice = $parsedDeliveryOption.find('.delivery-option-detail span.' + priceType + ':first');
$actualDeliveryOption.find('span.' + priceType).each(function() {
var $currentActualPrice = $(this);
$currentActualPrice.text($parsedPrice.text());
});
});
});
}
}
function updateShippingBlock(shippingModulesList, html, checksum, triggerElementName) {
if ('undefined' !== html && null !== html && shippingBlockChecksum != checksum) {
html = parseShippingMethods(shippingModulesList, html);
// save shipping form text input fields and select boxes, so we can restore them after hook update
var shipping_fields_values = {};
shippingBlockElement.find('input[type=text], select, form input[type=radio]:checked, textarea').not('[name^=delivery_option]').each(function () {
if ("undefined" !== typeof $(this).attr('id') && !$(this).is(':radio')) {
shipping_fields_values['[id=' + $(this).attr('id') + ']'] = $(this).val();
} else if ("undefined" !== typeof $(this).attr('name')) {
shipping_fields_values['[name="' + $(this).attr('name') + '"]'] = $(this).val();
}
});
updateHtmlBlock(shippingBlockElement, html);
// restore shipping for input and select fields values
$.each(shipping_fields_values, function (index, value) {
if ($(index).is(':radio')) {
$(index+'[value="'+value+'"]').prop('checked', true);
} else {
$(index).val(value);
}
});
shippingBlockChecksum = checksum;
afterShippingLoadCallbacks(shippingModulesList, html, triggerElementName);
@@ -1882,7 +2071,9 @@ function updateShippingBlock(shippingModulesList, html, checksum, triggerElement
// E.g. packzkomaty (sensbitpaczkomatymap) needs to trigger radio button change in order
// to display list of pickup points; Chronopost and Mondial relay need it as well
// forceRefreshShipping: If ="1", it will always reload shipping methods, so we need to avoid triggering click to avoid endless loop
if ($(deliveryOptionSelector).length && !payment.isConfirmationTrigger(triggerElementName) && !forceRefreshShipping) {
// To disable carrier initialization and 'blink' effect, add Custom JS code: const tc_initCarrierJs = false;
if ((typeof tc_initCarrierJs !== 'undefined' ? tc_initCarrierJs : true) &&
$(deliveryOptionSelector).length && !payment.isConfirmationTrigger(triggerElementName) && !forceRefreshShipping) {
$(deliveryOptionSelector).prop('checked', false).trigger('click');
return true;
} else {
@@ -1940,7 +2131,7 @@ function updatePaymentBlock(paymentModulesList, html, checksum, triggerElementNa
// Shall be input[type=hidden] added here? It did not work with add_gopay_new
// then, we need an exception: .not('[data-payment-module=add_gopay_new] input[type=hidden]')
// Exception for hidden fields: input[name="issuer"] = mollie payments
paymentBlockElement.find('input[type=text], select, input[name="issuer"], input[name="transferGateway"], form input[type=radio]:checked, textarea').each(function () {
paymentBlockElement.find('input[type=text], select, input[name="issuer"], input[name="transferGateway"], form input[type=radio]:checked, textarea, input[type=date]').each(function () {
if ("undefined" !== typeof $(this).attr('id') && !$(this).is(':radio') && $(this).attr('name') !== 'pmethod') {
payment_fields_values['[id=' + $(this).attr('id') + ']'] = $(this).val();
} else if ("undefined" !== typeof $(this).attr('name')) {
@@ -1978,6 +2169,8 @@ function updatePaymentBlock(paymentModulesList, html, checksum, triggerElementNa
afterPaymentLoadCallbacks(paymentModulesList, html, triggerElementName);
// Hook to this:
// prestashop.on('thecheckout_updatePaymentBlock', function() { console.log('payment block updated!'); })
prestashop.emit('thecheckout_updatePaymentBlock', {
reason: 'update',
});
@@ -1985,7 +2178,7 @@ function updatePaymentBlock(paymentModulesList, html, checksum, triggerElementNa
// restore payment for input and select fields values
$.each(payment_fields_values, function (index, value) {
if ($(index).is(':radio')) {
$(index+'[value='+value+']').prop('checked', true);
$(index+'[value="'+value+'"]').prop('checked', true);
} else {
$(index).val(value);
}
@@ -1993,12 +2186,12 @@ function updatePaymentBlock(paymentModulesList, html, checksum, triggerElementNa
// Special molliepayments update - where we need to restore not only input/select value, but also special <button> (which replaces dropdown)
if ($('#mollie-issuer-dropdown-button').length && $('input[name="issuer"]').length && '' != $('input[name="issuer"]').val()) {
var selectedMolliePayment = $('input[name="issuer"]').val();
var selectedMolliePayment = $('input[name="issuer"]').val();
var aMollieEl = $('a[data-ideal-issuer='+selectedMolliePayment+']');
if (aMollieEl.length) {
$('#mollie-issuer-dropdown-button').text(aMollieEl.text());
}
}
}
}
// Init PS Checkout render
@@ -2105,7 +2298,7 @@ function updateAddressBlock(addressType, html, htmlAddressDropdown) {
}
}
// Hook to this:
// Hook to this (alternative of prestashop.emit only on thecheckout page):
// $(document).on('thecheckout_Address_Modified', function(event, { addressType }) {
// console.log('Address modified!', addressType);
// });
@@ -2116,7 +2309,7 @@ function updateAddressBlock(addressType, html, htmlAddressDropdown) {
var cartTotalWeight = 0; // will be changed in updateCheckoutBlocks and then used in updateCartSummaryBlock
function updateCheckoutBlocks(jsonData, updateSummary, updateShipping, updatePayment) {
function updateCheckoutBlocks(jsonData, updateSummary, updateShipping, updatePayment, updateShippingPricesOnly = false) {
if ("undefined" !== typeof jsonData.emptyCart && jsonData.emptyCart === true) {
$('body').addClass('is-empty-cart');
// if ("undefined" !== typeof prestashop && "undefined" !== typeof prestashop.urls) {
@@ -2135,6 +2328,10 @@ function updateCheckoutBlocks(jsonData, updateSummary, updateShipping, updatePay
var shippingBlockUpdated = false;
var paymentBlockUpdated = false;
if ('undefined' !== typeof updateShippingPricesOnly && updateShippingPricesOnly) {
updateShippingPrices(jsonData.shippingBlock);
}
if ('undefined' !== typeof updateShipping && updateShipping) {
shippingBlockUpdated = updateShippingBlock(jsonData.externalShippingModules, jsonData.shippingBlock, jsonData.shippingBlockChecksum, jsonData.triggerElementName);
}
@@ -2178,19 +2375,22 @@ function toggleGiftMessage() {
$(this).addClass('in show')
});
}
selectDeliveryOption($('#js-delivery'));
}
function selectDeliveryOption(deliveryForm) {
highlightSelectedShippingMethod();
// To support mondial relay v3.0+, allow a bit of time for widget markup appear in extra content
setTimeout(function () {
var selectedDeliveryOptionExtra = $(deliveryOptionSelector).closest('.delivery-option-row').next('.carrier-extra-content');
$('.carrier-extra-content').not(selectedDeliveryOptionExtra).hide();
if (selectedDeliveryOptionExtra.height()) {
selectedDeliveryOptionExtra.slideDown();
}
}, 100);
if (installedModules['mondialrelay']) {
setTimeout(function () {
var selectedDeliveryOptionExtra = $(deliveryOptionSelector).closest('.delivery-option-row').next('.carrier-extra-content');
$('.carrier-extra-content').not(selectedDeliveryOptionExtra).hide();
if (selectedDeliveryOptionExtra.height()) {
selectedDeliveryOptionExtra.slideDown();
}
}, 100);
}
// url - implicitly using current
$.ajax({
@@ -2225,3 +2425,97 @@ function setDeliveryMessage() {
}
});
}
const tc_ongoingXhrs = {}
const tc_getTimestamp = () => {
const now = new Date();
return [
now.getTime(),
`${now.getSeconds().toString().padStart(2, '0')}:${now.getMilliseconds().toString().padStart(3, '0')}`
]
}
const tc_getAction = (data) => {
const match = data.match(/action=([-\w]+)/)
if (!match) {
return null
}
// construct 'metaAction', set of actions that we don't want to run in parallel, so that they shall be treated
// as synchronous
const metaAction = {
'modifyAccountAndAddress': 'account-modification',
'checkEmail': 'account-modification',
}
if (typeof metaAction[match[1]] !== 'undefined') {
return metaAction[match[1]]
} else {
return match[1]
}
}
const tc_AJAX = {
SEND: ' send ',
COMPLETE: ' complete '
};
const tc_logAction = (method, action) => {
const [timestamp, timestamp_str] = tc_getTimestamp()
const ongoingXhr = typeof tc_ongoingXhrs[action] !== 'undefined'
if (method == tc_AJAX.COMPLETE && !ongoingXhr) {
return
}
let took = ''
if (method == tc_AJAX.SEND) {
// wait only 1s, if response is not received, release the lock and let the other (potential) xhr to continue
tc_ongoingXhrs[action] = { timestamp, maxWait: 1000 }
} else {
took = ` (took: ${timestamp - tc_ongoingXhrs[action]?.timestamp}ms)`
delete tc_ongoingXhrs[action]
}
if (debug_js_controller) {
console.log(`[${method}] '${action}' @ ${timestamp_str}s${took}`)
}
}
$( document ).on( "ajaxSend", function(event, jqxhr, settings) {
if (typeof settings.data === 'string') {
const action = tc_getAction(settings.data)
if (action) {
tc_logAction(tc_AJAX.SEND, action)
}
}
});
$( document ).on( "ajaxSuccess", function(event, jqxhr, settings) {
if (typeof settings.data === 'string') {
const action = tc_getAction(settings.data)
if (action) {
tc_logAction(tc_AJAX.COMPLETE, action)
}
}
});
/*
Disallow duplicate AJAX requests, but with max timeout (default 1s) to avoid endless waiting
*/
$.ajaxSetup({
beforeSend: function(jqXHR, settings) {
if (typeof settings.data === 'string') {
const action = tc_getAction(settings.data)
if (action && typeof tc_ongoingXhrs[action] !== 'undefined' && tc_ongoingXhrs[action]?.maxWait > 0) {
tc_ongoingXhrs[action].maxWait -= 200
setTimeout(function() {
$.ajax(settings);
}, 200);
return false;
}
}
}
});

View File

@@ -0,0 +1,17 @@
/*
* NOTICE OF LICENSE
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
* @author Peter Sliacky (Zelarg)
* @copyright Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* Copyright (c) 2021-2022
*/
// If we're in an iframe, let's do full page reload
var confirmationInIframe = (window.self !== window.top)
if (confirmationInIframe) {
window.top.location.href = window.location.href;
}

View File

@@ -31,4 +31,15 @@ if ("undefined" !== typeof amazon_ongoing_session && amazon_ongoing_session) {
formEl.addClass('amazon-visible');
additionalEl.addClass('amazon-visible');
titleEl.addClass('amazon-visible');
}
// Check if there's 'option' parameter in the url, if yes, let's hide everything except single payment method
var searchParams = new URLSearchParams(window.location.search);
var optionSet = searchParams.get('option');
if (optionSet) {
$('body').addClass('p3i-option-set');
// $('[id='+optionSet+'-container]').parent('div').addClass('p3i-visible-only');
$('[id^='+optionSet+'-]').addClass('p3i-visible-only');
setTimeout(function() {$('[id='+optionSet+']').trigger('click');}, 200);
$('[id^=conditions_to_approve]').prop('checked', false).trigger('click');
}

View File

@@ -34,6 +34,7 @@ var tc_facebookLogin = (function () {
function backendSignIn(access_token) {
$.ajax({
url: prestashop.urls.pages.order,
type: 'POST',
cache: false,
dataType: "json",
@@ -45,8 +46,15 @@ var tc_facebookLogin = (function () {
// TODO: better error handling
console.error(jsonData.errors);
} else if ('undefined' !== typeof jsonData.email && jsonData.email) {
signedInUpdateForm();
location.reload();
}
},
error: function(jqXHR, textStatus, errorThrown) {
if(jqXHR.status === 500) {
console.error("Internal server error occurred: ", errorThrown);
// Add any additional error handling logic here
}
location.reload();
}
});
}
@@ -132,6 +140,13 @@ var tc_googleLogin = (function () {
} else if ('undefined' !== typeof jsonData.email && jsonData.email) {
location.reload();
}
},
error: function(jqXHR, textStatus, errorThrown) {
if(jqXHR.status === 500) {
console.error("Internal server error occurred: ", errorThrown);
// Add any additional error handling logic here
}
location.reload();
}
});
}

View File

@@ -0,0 +1,55 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* Last tested on 11.8.2023 with apaczka 1.1.0 by Apaczka.pl */
tc_confirmOrderValidations['apaczka'] = function() {
if (
/* $('.delivery-option.apaczka input[type=radio]').is(':checked') && */
typeof apaczkaCarriers === 'object' &&
$('.apaczka-no-point').is(':visible')
) {
// Legacy selector, replace from Thecheckout v3.3.8+ with version below
// var shippingErrorMsg = $('#thecheckout-shipping > .inner-area > .error-msg');
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
shippingErrorMsg.text('Wybierz punkt dostawy');
shippingErrorMsg.show();
scrollToElement(shippingErrorMsg);
return false;
} else {
return true;
}
}
checkoutShippingParser.apaczka = {
after_load_callback: function(deliveryOptionIds) {
if (typeof apaczkaCarriers === 'object') {
// Apaczka would init map selector on window.load()
dispatchEvent(new Event('load'));
}
},
init_once: function (elements) {
if (debug_js_controller) {
console.info('[thecheckout-apaczka.js] init_once()');
}
},
delivery_option: function (element) {
if (debug_js_controller) {
console.info('[thecheckout-apaczka.js] delivery_option()');
}
},
extra_content: function (element) {
}
}

View File

@@ -0,0 +1,36 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* tested with Google Pay v2.0.0 - by Bonpresta - on 8.4.2024 */
checkoutPaymentParser.bongooglepay = {
container: function (element) {
payment.setPopupPaymentType(element);
element.find('input[name=payment-option]').addClass('binary'); // so that our 'pay' button in the popup disappears
// Add CSS rule to hide payment form in payment methods list
var cssEl = document.createElement('style'),sheet;
document.head.appendChild(cssEl);
cssEl.sheet.insertRule(`
.js-additional-information.bongooglepay > .bon-googlepay-required {
display: none;
}
`);
},
popup_onopen_callback: function () {
if ($('#bon-google-checkout').length) {
var script = document.createElement('script');
script.src = tcModuleBaseUrl+'/../bongooglepay/views/js/bongooglepay-front.js';
document.head.appendChild(script);
}
},
}

View File

@@ -18,6 +18,9 @@ checkoutPaymentParser.braintreeofficial = {
init_once: function(elements) {
// Change original .additional-information block to js-payment-option-form
const additionalInfoEl = elements.find('.additional-information');
if (additionalInfoEl.length === 0) {
return;
}
const formId = additionalInfoEl.attr('id').replace(/payment-option-(\d+)-.*/, 'pay-with-payment-option-$1-form');
additionalInfoEl.attr('id', formId).attr('class', 'js-payment-option-form ps-hidden').hide();
additionalInfoEl.find('.row > .col-md-10').removeClass('col-md-10');

View File

@@ -0,0 +1,26 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
checkoutPaymentParser.buckaroo3 = {
all_hooks_content: function (content) {
},
container: function (element) {
var paymentOption = element.attr('id').match(/payment-option-\d+/)[0];
var feeEl = element.find('label span.h6');
if ('undefined' !== typeof feeEl && feeEl) {
// parse out right-most number, in left side text, there can be number in 'B2B'
var feeNumber = feeEl.text().replace(/^.*?([\d,.]+)[€ ]*$/,'$1');
var fee = parseFloat(feeNumber.replace(',','.'));
element.last().append('<div class="payment-option-fee hidden" id="'+paymentOption+'-fee">'+fee+'</div>');
}
}
}

View File

@@ -13,9 +13,9 @@ checkoutPaymentParser.codpro = {
},
container: function (element) {
additionalInformation: function (element) {
var paymentOption = element.attr('id').match(/payment-option-\d+/)[0];
var feeEl = element.find('label span');
var feeEl = element.find('#codpro_fee');
if ('undefined' !== typeof feeEl && feeEl) {
var fee = parseFloat(feeEl.text().replace(/[^\d,]/g,'').replace(',','.'));
element.last().append('<div class="payment-option-fee hidden" id="'+paymentOption+'-fee">'+fee+'</div>');

View File

@@ -8,7 +8,24 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
// Default props so that widget can load without errors
colissimoDeliveryAddress = { 'address': '', 'zipcode': '', 'city': '' }
colissimoPreparationTime = 1;
checkoutShippingParser.colissimo = {
extra_content: function (element) {
const input = element.html();
// parse props and re-export to the window object
const colissimo_props = input.matchAll(/const ([^=]+)=([^;]+);/g)
for (const x of colissimo_props) {
[prop, value] = [x[1].trim(), x[2].trim()]
// console.log(`prop:${prop}, value:${value}`);
window[prop] = (value.indexOf('{') == 0) ?
JSON.parse(value.replace(/(['"])?([a-z0-9A-Z_]+)(['"])?:/g, '"$2": ').replace(/'/g,'"'))
: eval(value);
}
},
on_ready: function() {
setTimeout(function(){
if ($('.iti').length == 0 && 'undefined' !== typeof initMobileField) {

View File

@@ -0,0 +1,17 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
checkoutPaymentParser.datatranscw_mastercard = {
after_load_callback: function() {
prestashop.emit('steco_event_updated')
},
}

View File

@@ -0,0 +1,36 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* last tested 28.2.2024 with v4.0.193 - by customweb ltd */
checkoutPaymentParser.datatranscw_all = {
after_load_callback: function() {
$.getScript(tcModuleBaseUrl+'/../datatranscw/js/frontend.js')
.done(
function() {
setTimeout(function() { $('input[name=payment-option]:checked').click(); }, 500);
});
},
form: function (element) {
},
additionalInformation: function (element) {
}
}
// One call even for multiple datatranscw payment modules is OK - events are attached for all of them at once
checkoutPaymentParser.datatranscw_creditcard = checkoutPaymentParser.datatranscw_all;

View File

@@ -0,0 +1,276 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* Last tested on 10.1.2024 with dhlassistant v1.7 by DHL Parcel Polska */
tc_confirmOrderValidations['dhlassistant'] = function() {
if (
$('#dhlassistant_map_PL_CARRIER_POP').is(':visible') &&
!$('#dhlassistant_messages > .current-address').is(':visible')
) {
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
$('.shipping-validation-details').remove();
shippingErrorMsg.append('<span class="shipping-validation-details"> (DHL POP - punkt odbioru)</span>')
shippingErrorMsg.show();
scrollToElement(shippingErrorMsg);
return false;
} else {
return true;
}
}
var tc_load_dhlassistant_script = function() {
function shippingMethodChange() {
var activeRadio = $(".delivery-options input[type='radio']:checked");
var elValue = parseInt(activeRadio.val());
var carrierCode = $("#dhlassistant_carrier_code_" + elValue).val();
var requireSelection = $('#dhlassistant_need_selection_' + elValue).val();
var parcelIdent = $('#dhlassistant_parcel_ident_value_' + carrierCode).val();
if (requireSelection && (typeof parcelIdent === 'undefined' || "" === parcelIdent)) {
$('button[name="confirmDeliveryOption"]').attr('disabled', true);
console.log(carrierCode);
}
else if (carrierCode == ['PL_CARRIER_POP'] || carrierCode == ['PL_CARRIER_POP_COD'] || carrierCode == ['FOREIGN_CARRIER_PARCELSHOP']) {
$('button[name="confirmDeliveryOption"]').attr('disabled', true);
$( ".current-address" ).hide();
}
else {
$('button[name="confirmDeliveryOption"]').attr('disabled', false);
}
}
function parcelMapChange() {
$('button[name="confirmDeliveryOption"]').attr('disabled', true);
$( ".current-address" ).hide();
}
$(".delivery-options input[type='radio']").change(function (e) {
shippingMethodChange();
});
$('#dhlassistant_ps_checkbox').bind('change', parcelMapChange);
$('#dhlassistant_pl_checkbox').bind('change', parcelMapChange);
shippingMethodChange();
MapPointSelectListenerPlCarrierPop = function(msg)
{
var point = JSON.parse(msg.data);
$('#dhlassistant_parcel_ident_value_PL_CARRIER_POP').val(point.sap);
$('#dhlassistant_parcel_postal_code_value').val(point.zip);
$( "p.current-address" ).text(point.name+" "+point.street+" "+point.streetNo+" "+point.zip+" "+point.city);
SaveDhlCarrierOptionsPlCarrierPop();
}
SendToParcelShopChangePlCarrierPop = function()
{
$('#dhlassistant_ps_checkbox').parent().parent().removeClass('disabled');
var val = $('#dhlassistant_ps_checkbox').prop('checked');
if (val)
{
if (dhlassistant_require_postalcode_for_ps)
{
$('#dhlassistant_parcel_postal_code .label').html('Kod pocztowy Parcelshop:');
$('#dhlassistant_parcel_postal_code').show();
}
else
{
$('#dhlassistant_parcel_postal_code').hide();
}
$('#dhlassistant_pl_checkbox').prop('checked', false);
$('#dhlassistant_pl_checkbox').prop('disabled', true);
SendToParcelLockerChangePlCarrierPop();
$('#dhlassistant_parcel_ident').show();
$('#dhlassistant_map_PL_CARRIER_POP').html('<object data="'+dhlassistant_map_for_pl_url+'" style="width:100%;height:813px;" frameborder="0" scrolling="no" id="myFrame"></object>');
$('#dhlassistant_map_PL_CARRIER_POP').show();
}
else
{
if (!$('#dhlassistant_pl_checkbox').prop('checked'))
{
$('#dhlassistant_map_PL_CARRIER_POP').hide();
$('#dhlassistant_parcel_ident').hide();
$('#dhlassistant_parcel_postal_code').hide();
}
$('#dhlassistant_pl_checkbox').prop('disabled', false);
$('#dhlassistant_pl_checkbox').parent().parent().removeClass('disabled');
}
}
SendToParcelLockerChangePlCarrierPop = function()
{
$('#dhlassistant_pl_checkbox').parent().parent().removeClass('disabled');
var val = $('#dhlassistant_pl_checkbox').prop('checked');
if (val)
{
if (dhlassistant_require_postnummer_for_pl)
{
$('#dhlassistant_postnummer').show();
}
else
{
$('#dhlassistant_postnummer').hide();
}
if (dhlassistant_require_postalcode_for_pl)
{
$('#dhlassistant_parcel_postal_code .label').html('Kod pocztowy Parcelstation:');
$('#dhlassistant_parcel_postal_code').show();
}
else
{
$('#dhlassistant_parcel_postal_code').hide();
}
$('#dhlassistant_ps_checkbox').prop('checked', false);
$('#dhlassistant_ps_checkbox').prop('disabled', true);
SendToParcelShopChangePlCarrierPop();
$('#dhlassistant_parcel_ident').show();
$('#dhlassistant_map_PL_CARRIER_POP').show();
}
else
{
if (!$('#dhlassistant_ps_checkbox').prop('checked'))
{
$('#dhlassistant_map_PL_CARRIER_POP').hide();
$('#dhlassistant_parcel_ident').hide();
$('#dhlassistant_parcel_postal_code').hide();
}
$('#dhlassistant_ps_checkbox').prop('disabled', false);
$('#dhlassistant_ps_checkbox').parent().parent().removeClass('disabled');
$('#dhlassistant_postnummer').hide();
}
}
SaveDhlCarrierOptionsPlCarrierPop = function()
{
$('#dhlassistant_messages .success').hide();
$('#dhlassistant_messages .error').hide();
$('#HOOK_PAYMENT').html('');
var ajax_data = {};
var val_ps = $('#dhlassistant_ps_checkbox').prop('checked');
var val_pl = $('#dhlassistant_pl_checkbox').prop('checked');
var val_parcel_ident = $('#dhlassistant_parcel_ident_value_PL_CARRIER_POP').val();
var val_postnummer = $('#dhlassistant_postnummer_value').val();
var val_parcel_postal_code = $('#dhlassistant_parcel_postal_code_value').val();
if (val_ps)
ajax_data.ParcelShop = val_ps;
if (val_pl)
ajax_data.ParcelLocker = val_pl;
if (val_parcel_ident)
ajax_data.ParcelIdent = val_parcel_ident;
if (val_postnummer)
ajax_data.Postnummer = val_postnummer;
if (val_parcel_postal_code)
ajax_data.ParcelPostalCode = val_parcel_postal_code;
$.ajax({
type: "POST",
headers: { "cache-control": "no-cache" },
url: dhlassistant_ajax_catcher_url,
data: ajax_data,
context: document.body,
dataType : "json",
success: function(message)
{
if (message == 'Success')
$('#dhlassistant_messages .success').slideDown('slow');
else
$('#dhlassistant_messages .error').slideDown('slow');
if (typeof(updatePaymentMethodsDisplay) !== "undefined")
{
$('#uniform-cgv').parent().show();
if ($('#cgv').prop('checked'))
updatePaymentMethodsDisplay();
}
$('button[name="confirmDeliveryOption"]').attr('disabled', false);
var scrollToMessage = document.getElementById("SCROLL_TO_PL_CARRIER_POP");
scrollToMessage.scrollIntoView();
},
error: function()
{
scrollToMessage.slideDown('slow');
scrollToMessage.scrollIntoView();
}
});
}
DhlOptionsInitPlCarrierPop = function(){
dhlassistant_ajax_catcher_url = $("#PL_CARRIER_POP_dhlassistant_ajax_catcher_url").val();
dhlassistant_carrier_id = $("#PL_CARRIER_POP_dhlassistant_carrier_id").val();
dhlassistant_is_ps_available = !!+$("#PL_CARRIER_POP_dhlassistant_is_ps_available").val();
dhlassistant_is_ps_only_service = !!+$("#PL_CARRIER_POP_dhlassistant_is_ps_only_service").val();
dhlassistant_is_pl_available = !!+$("#PL_CARRIER_POP_dhlassistant_is_pl_available").val();
dhlassistant_is_map_for_parcel_available = !!+$("#PL_CARRIER_POP_dhlassistant_is_map_for_parcel_available").val();
dhlassistant_map_for_ps_url = $("#PL_CARRIER_POP_dhlassistant_map_for_ps_url").val();
dhlassistant_map_for_pl_url = $("#PL_CARRIER_POP_dhlassistant_map_for_pl_url").val();
dhlassistant_require_postnummer_for_pl = !!+$("#PL_CARRIER_POP_dhlassistant_require_postnummer_for_pl").val();
dhlassistant_require_postalcode_for_ps = !!+$("#PL_CARRIER_POP_dhlassistant_require_postalcode_for_ps").val();
dhlassistant_require_postalcode_for_pl = !!+$("#PL_CARRIER_POP_dhlassistant_require_postalcode_for_pl").val();
dhlassistant_ok = ($('#delivery_option_' + dhlassistant_carrier_id).val() == (dhlassistant_carrier_id+','));
if (dhlassistant_ok)
{
if (dhlassistant_is_ps_only_service) /* jeśli musi być podany nr. PS aby przejść dalej*/
{
$('#uniform-cgv').parent().hide();
$('#HOOK_PAYMENT').html('');
}
if ((dhlassistant_is_ps_available || dhlassistant_is_pl_available) && dhlassistant_is_map_for_parcel_available)
{
if (window.addEventListener)
{
window.addEventListener("message", MapPointSelectListenerPlCarrierPop, false);
}
else
{
window.attachEvent("onmessage", MapPointSelectListenerPlCarrierPop);
}
}
SendToParcelShopChangePlCarrierPop();
SendToParcelLockerChangePlCarrierPop();
$('#dhlassistant_ps_checkbox').bind('change', SendToParcelShopChangePlCarrierPop);
$('#dhlassistant_pl_checkbox').bind('change', SendToParcelLockerChangePlCarrierPop);
$('#dhlassistant_PL_CARRIER_POP').show();
}
};
/* init */
if (document.readyState !== 'complete')
$(DhlOptionsInitPlCarrierPop);
else
DhlOptionsInitPlCarrierPop();
}
checkoutShippingParser.dhlassistant = {
after_load_callback: function(deliveryOptionIds) {
if (typeof tc_load_dhlassistant_script === 'function') {
tc_load_dhlassistant_script();
}
},
init_once: function (elements) {
if (debug_js_controller) {
console.info('[thecheckout-dhlassistant.js] init_once()');
}
},
delivery_option: function (element) {
if (debug_js_controller) {
console.info('[thecheckout-dhlassistant.js] delivery_option()');
}
},
extra_content: function (element) {
}
}

View File

@@ -17,7 +17,7 @@ checkoutPaymentParser.dm_cashondelivery = {
var paymentOption = element.attr('id').match(/payment-option-\d+/)[0];
var feeHtml = element.find('label span').html();
var fee = payment.parsePrice(feeHtml);
if (!isNaN(fee)) {
if (!isNaN(fee) && fee !== 0) {
element.last().append('<div class="payment-option-fee hidden" id="'+paymentOption+'-fee">'+fee+'</div>');
}
},
@@ -26,7 +26,7 @@ checkoutPaymentParser.dm_cashondelivery = {
var paymentOption = element.attr('id').match(/payment-option-\d+/)[0];
var feeHtml = element.find('section p').html();
var fee = payment.parsePrice(feeHtml);
if (!isNaN(fee)) {
if (!isNaN(fee) && fee !== 0) {
element.last().append('<div class="payment-option-fee hidden" id="' + paymentOption + '-fee">' + fee + '</div>');
}
}

View File

@@ -27,7 +27,10 @@ tc_confirmOrderValidations['dpdpoland'] = function() {
checkoutShippingParser.dpdpoland = {
after_load_callback: function(deliveryOptionIds) {
// nothing necessary here; just make an update to dpdpoland/views/templates/hook/pudo.tpl, placing code in <script> in condition:
/*
nothing necessary here; just make an update to dpdpoland/views/templates/hook/pudo.tpl,
placing code in <script> (starting with 'const iframe = document.createElement("iframe");') in condition:
*/
// if ('undefined' === typeof iframe) { /* original code here */ }
},
}

View File

@@ -0,0 +1,19 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
checkoutShippingParser.estimateddelivery= {
init_once: function (elements) {
// This variable is handled from estimateddelivery module
if (typeof ed_refresh !== 'undefined' && dynamic_refresh === false)
{
dynamic_refresh = true;
}
}
}

View File

@@ -0,0 +1,39 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*
* Last tested on 04.04.2024 with Floapay v1.2.4 by 202 ecommerce
*/
checkoutPaymentParser.floapay = {
after_load_callback: function() {
if (typeof floaDisplayPaymentSummary === 'function') {
floaDisplayPaymentSummary();
}
if (typeof floaDisplayPaymentReportDateField === 'function') {
floaDisplayPaymentReportDateField();
}
if (typeof setFloaEvents === 'function') {
setFloaEvents();
}
},
form: function (element) {
let form = element.find('.payment-form');
if (typeof form !== 'undefined' && form?.attr('action')?.search('floapay/eligibility'))
{
let onSubmitAction = 'return floaLaunchEligibility($("#confirm_order"));';
form.attr('action', 'javascript:void(0);');
form.attr('onsubmit', onSubmitAction);
}
}
}

View File

@@ -0,0 +1,50 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
tc_confirmOrderValidations['fspickupatstore'] = function () {
if (
$('.fspas-information:visible').length > 0 && $('.fspas-information:visible').text().indexOf('-') > 3 && $('.fspas-information:visible').text().indexOf('-') < 15
) {
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
$('.shipping-validation-details').remove();
shippingErrorMsg.append('<span class="shipping-validation-details"> (изберете офис)</span>')
shippingErrorMsg.show();
scrollToElement(shippingErrorMsg);
return false;
} else {
return true;
}
}
checkoutShippingParser.fspickupatstore = {
after_load_callback: function(deliveryOptionIds) {
$.getScript(tcModuleBaseUrl + '/../fspickupatstore/views/js/carrier-extra.js');
// Add CSS rule
// var cssEl = document.createElement('style'),sheet;
// document.head.appendChild(cssEl);
// cssEl.sheet.insertRule(`
// .delivery-option.latvijaspastsexpresspastspostterminalslv > label {
// flex-wrap: wrap;
// }
// `);
},
init_once: function (elements) {
},
delivery_option: function (element) {
},
extra_content: function (element) {
}
}

View File

@@ -0,0 +1,28 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
checkoutPaymentParser.generic_iframe_parser = {
popup_onopen_callback: function (optionId) {
$('.popup-payment-content .popup-embed').prop('src', '?p3i&option='+optionId);
$('.popup-payment-content').addClass('iframe');
},
popup_onclose_callback: function () {
$('.popup-payment-content .popup-embed').prop('src', '');
$('.popup-payment-content').removeClass('iframe');
},
container: function(element) {
payment.setPopupPaymentType(element);
element.find('input[name=payment-option]').addClass('binary');
},
}

View File

@@ -0,0 +1,36 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* Last tested on 07.06.2024 with geodisofficiel v1.0.3 by GEODIS */
let geodisLoaded = false;
checkoutShippingParser.geodisofficiel = {
after_load_callback: function(deliveryOptionIds) {
if (!geodisLoaded && typeof GeodisCarrierSelector === 'function') {
$.getScript(tcModuleBaseUrl+'/../geodisofficiel/views/js/lib/intlTel/utils.js');
$.getScript(tcModuleBaseUrl+'/../geodisofficiel/views/js/GeodisCarrierSelectorBootstrap.js');
geodisLoaded = true;
}
},
init_once: function (elements) {
},
delivery_option: function (element) {
},
extra_content: function (element) {
}
}

View File

@@ -0,0 +1,35 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* Last tested on 10.07.2024 with globkuriermodule v3.0.1 by GlobKurier.pl */
// let globKurierModuleLoaded = false;
checkoutShippingParser.globkuriermodule = {
after_load_callback: function(deliveryOptionIds) {
if (!globKurierModuleLoaded && typeof inpost_carrier_id !== 'undefined') {
$.getScript(tcModuleBaseUrl+'/../globkuriermodule/views/js/inpost-front-17.js');
// globKurierModuleLoaded = true;
}
},
init_once: function (elements) {
},
delivery_option: function (element) {
},
extra_content: function (element) {
}
}

View File

@@ -9,10 +9,17 @@
*/
/* (!) IMPORTANT (!)
It's necessary to comment-out following line in: modules/itellashipping/views/js/front.js, like this:
// $master_container.find('#itella-ps17-extra').remove();
*/
tc_confirmOrderValidations['itellashipping'] = function() {
if (
$('.delivery-option.itellashipping input[name^=delivery_option]').is(':checked') &&
!$('#itella_pickup_point_id').val()
$('.delivery-option.itellashipping input[name^=delivery_option]:checked').closest('.delivery-option.itellashipping').next('.carrier-extra-content.itellashipping').length > 0 &&
$('.delivery-option.itellashipping input[name^=delivery_option]:checked').closest('.delivery-option.itellashipping').next('.carrier-extra-content.itellashipping').find('#itella_pickup_point_id').length > 0 &&
$('.delivery-option.itellashipping input[name^=delivery_option]:checked').closest('.delivery-option.itellashipping').next('.carrier-extra-content.itellashipping').find('#itella_pickup_point_id').val() == ''
) {
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
shippingErrorMsg.show();

View File

@@ -0,0 +1,52 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
tc_confirmOrderValidations['latvijaspastsexpresspastspostterminalslv'] = function() {
if (
$('.latvijaspasts_carrier.terminals').is(':visible') &&
$('[name=terminals]')?.val() == '0'
) {
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
shippingErrorMsg.text(shippingErrorMsg.text() + ' (piegādes punkts)');
shippingErrorMsg.show();
scrollToElement(shippingErrorMsg);
return false;
} else {
return true;
}
}
checkoutShippingParser.latvijaspastsexpresspastspostterminalslv = {
after_load_callback: function(deliveryOptionIds) {
$.getScript(tcModuleBaseUrl + '/../latvijaspasts/views/js/carrier_script.js');
// Add CSS rule
var cssEl = document.createElement('style'),sheet;
document.head.appendChild(cssEl);
cssEl.sheet.insertRule(`
.delivery-option.latvijaspastsexpresspastspostterminalslv > label {
flex-wrap: wrap;
}
`);
},
init_once: function (elements) {
},
delivery_option: function (element) {
},
extra_content: function (element) {
}
}

View File

@@ -0,0 +1,23 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
tc_confirmOrderValidations['lpshipping'] = function() {
if (
$('#lpshipping_express_terminal').is(':visible') &&
( "" == $('#lpshipping_express_terminal').val() || '-1' === $('#lpshipping_express_terminal').val())
) {
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
shippingErrorMsg.show();
scrollToElement(shippingErrorMsg);
return false;
} else {
return true;
}
}

View File

@@ -0,0 +1,84 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* Last tested on 22.03.2024 with mijoravenipak v1.1.4 by mijora.lt */
// var tc_tmjs = null;
// var tc_venipak_custom_modal = function() {
// let mjvp_map_container = document.getElementById('mjvp-pickup-select-modal');
// let tmjs = null;
// if (typeof(mjvp_map_container) != 'undefined' && mjvp_map_container != null) {
// tc_tmjs = new TerminalMappingMjvp('https://venipak.uat.megodata.com/ws');
// tmjs = tc_tmjs;
// tmjs.setImagesPath(mjvp_imgs_url);
// tmjs.setTranslation(mjvp_terminal_select_translates);
// tmjs.dom.setContainerParent(document.getElementById('mjvp-pickup-select-modal'));
// // tmjs.terminals_cache = null;
// tmjs.init({
// country_code: mjvp_country_code,
// identifier: '',
// isModal: true,
// hideContainer: false,
// hideSelectBtn: false,
// postal_code: mjvp_postal_code,
// city: mjvp_city
// });
// tmjs.sub('tmjs-ready', function(data) {
// let selected_terminal = document.getElementById("mjvp-selected-terminal")?.value;
// let selected_location = tmjs.map?.getLocationById(parseInt(selected_terminal));
// if (typeof(selected_location) != 'undefined' && selected_location != null) {
// tmjs.publish('terminal-selected', selected_location);
// document.querySelector('.tmjs-selected-terminal').innerHTML = '<span class="mjvp-tmjs-terminal-name">' + selected_location.name + '</span> <span class="mjvp-tmjs-terminal-address">(' + selected_location.address + ')</span> <span class="mjvp-tmjs-terminal-comment">' + selected_location.city + '.</span>';
// }
// });
// tmjs.sub('terminal-selected', function(data) {
// document.getElementById("mjvp-selected-terminal").value = data.id;
// mjvp_registerSelection('mjvp-selected-terminal');
// tmjs.publish('close-map-modal');
// document.querySelector('.tmjs-selected-terminal').innerHTML = '<span class="mjvp-tmjs-terminal-name">' + data.name + '</span> <span class="mjvp-tmjs-terminal-address">(' + data.address + ')</span> <span class="mjvp-tmjs-terminal-comment">' + data.city + '.</span>';
// });
// }
// if (typeof window['venipak_custom_modal'] !== 'undefined') {
// window['venipak_custom_modal'].tmjs = tmjs;
// }
// }
checkoutShippingParser.mijoravenipak = {
after_load_callback: function(deliveryOptionIds) {
// check every 500ms at most for 3 seconds when length > 0 and if so, call venipak_custom_modal()
const conditionallyInitializeMJVP = () => {
let counter = 0;
let checkInterval = setInterval(function() {
if (mjvp_terminals.length > 0) {
venipak_custom_modal();
clearInterval(checkInterval);
} else {
console.log('[tc-mijoravenipak] mjvp_terminals empty, wait 500ms...');
counter++;
if (counter >= 6) {
clearInterval(checkInterval);
}
}
}, 500);
}
if (typeof venipak_custom_modal === 'function') {
setTimeout(conditionallyInitializeMJVP, 500);
}
},
}

View File

@@ -10,6 +10,33 @@
checkoutPaymentParser.mollie = {
container: function (element) {
payment.setPopupPaymentType(element);
// Add CSS rule to hide payment form in payment methods list
var cssEl = document.createElement('style'),sheet;
document.head.appendChild(cssEl);
cssEl.sheet.insertRule(`
section#checkout-payment-step [data-payment-module=mollie] > .additional-information > .mollie-iframe-container {
display: none!important;
}
`);
cssEl.sheet.insertRule(`
button.btn.btn-primary.center-block.disabled {
pointer-events: all;
opacity: 1;
}
`);
},
popup_onopen_callback: function () {
if ($('.additional-information.mollie > .mollie-iframe-container').length) {
var script = document.createElement('script');
script.src = tcModuleBaseUrl+'/../mollie/views/js/front/mollie_iframe.js';
document.head.appendChild(script);
}
},
form: function (element) {
var paymentOption = element.attr('id').match(/payment-option-\d+/)[0];

View File

@@ -8,6 +8,8 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* Last tested on 13.7.2023 with mondialrelay 3.3.7 by ScaleDEV */
tc_confirmOrderValidations['mondialrelay'] = function() {
if (
/*$('#mondialrelay_widget').is(':visible')*/
@@ -25,6 +27,17 @@ tc_confirmOrderValidations['mondialrelay'] = function() {
}
checkoutShippingParser.mondialrelay = {
after_load_callback: function(deliveryOptionIds) {
// reinit only when widget is already initialized = that means, mondialrelay module won't try to init it again, but we have to.
if (typeof mondialrelayWidget !== 'undefined' && mondialrelayWidget.initialized === true) {
$.getScript(tcModuleBaseUrl + '/../mondialrelay/views/js/front/checkout/checkout-17.js');
if (typeof MONDIALRELAY_ADDRESS_OPC !== 'undefined') {
MONDIALRELAY_ADDRESS_OPC = true;
}
}
},
init_once: function (elements) {
if (debug_js_controller) {
console.info('[thecheckout-mondialrelay.js] init_once()');
@@ -39,7 +52,7 @@ checkoutShippingParser.mondialrelay = {
// Uncheck mondialrelay item, so that it can be manually selected
//element.after("<script>$('.delivery-option.mondialrelay input[name^=delivery_option]').prop('checked', false)</script>");
// Mondial v3.0+ by 202 ecommerce
element.append("<script>$(document).ready(setTimeout(function(){$('#js-delivery').find('[name^=\"delivery_option\"]:checked').trigger('change');},500)); prestashop.emit(\"updatedDeliveryForm\",{dataForm:$('#js-delivery').serializeArray(),deliveryOption:$('#js-delivery').find('[name^=\"delivery_option\"]:checked')});</script>");
// element.append("<script>$(document).ready(setTimeout(function(){$('#js-delivery').find('[name^=\"delivery_option\"]:checked').trigger('change');},500)); prestashop.emit(\"updatedDeliveryForm\",{dataForm:$('#js-delivery').serializeArray(),deliveryOption:$('#js-delivery').find('[name^=\"delivery_option\"]:checked')});</script>");
},
extra_content: function (element) {

View File

@@ -23,6 +23,25 @@ tc_confirmOrderValidations['packetery'] = function() {
}
checkoutShippingParser.packetery = {
after_load_callback: function(deliveryOptionIds) {
// if ('undefined' !== typeof initializePacketaWidget && $(".zas-box").length)
// initializePacketaWidget();
// if ('undefined' !== typeof tools){
// tools.fixextracontent(country);
// if ('undefined' !== typeof tools && 'undefined' !== typeof tools.readAjaxFields) {
// tools.readAjaxFields();
// }
// var packeteryEl = $('.carrier-extra-content.packetery');
// if (packeteryEl.length) {
// var extra = packeteryEl.parent();
// if ('undefined' !== typeof packetery && 'undefined' !== typeof packetery.widgetGetCities) {
// packetery.widgetGetCities(extra);
// }
// }
// }
},
init_once: function (elements) {
},

View File

@@ -8,7 +8,49 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
Modify please /modules/paynow/controllers/front/payment.php, remove lines:
if ($id_customer != $this->context->customer->id) {
Tools::redirect('index.php?controller=order&step=1');
}
*/
tc_confirmOrderValidations['paynow'] = function () {
if (
$('.paynow-payment-option-container #paynow_blik_code').is(':visible') &&
$('.paynow-payment-option-container #paynow_blik_code').val() == ''
) {
var paymentErrorMsg = $('#thecheckout-payment .dynamic-content > .inner-wrapper > .error-msg');
$('.payment-validation-details').remove();
paymentErrorMsg.append('<span class="payment-validation-details"> (BLIK kod)</span>')
paymentErrorMsg.show();
scrollToElement(paymentErrorMsg);
return false;
} else {
return true;
}
}
checkoutPaymentParser.paynow = {
container: function(element) {
const isBlikPaymentOption = element.next('.js-payment-option-form').find('form.paynow-blik-form').length == 1
if (isBlikPaymentOption) {
payment.setPopupPaymentType(element);
}
// Add CSS rule to hide blik form in payment methods list when T&C checkbox is ticked;
// but keep it visible in the popup
var cssEl = document.createElement('style'),sheet;
document.head.appendChild(cssEl);
cssEl.sheet.insertRule(`
section#checkout-payment-step .paynow-blik-form {
display: none;
}
`);
},
after_load_callback: function() {
$.getScript(tcModuleBaseUrl+'/../paynow/views/js/front.js')
.done(
@@ -16,6 +58,9 @@ checkoutPaymentParser.paynow = {
setTimeout(function() {
if (typeof enableBlikSupport !== 'undefined') { enableBlikSupport(); }
if (typeof enablePblSupport !== 'undefined') { enablePblSupport(); }
if (typeof paynow !== 'undefined' && typeof paynow.config !== 'undefined') {
paynow.config.validateTerms = false; // because if T&C are disabled in PS settings, BLIK will not confirm
}
}, 300);
});
// if ("undefined" !== typeof enableBlikSupport) {
@@ -24,15 +69,16 @@ checkoutPaymentParser.paynow = {
},
form: function (element) {
var blikPayButtonSelector = "form.paynow-blik-form .paynow-payment-option-container button.btn-primary";
if (element.find('.paynow-blik-form').length) {
element.find('.payment-form').attr('onsubmit', '$("'+blikPayButtonSelector+'").click(); return false;');
}
// Add CSS rule to hid blickPayButton
var element = document.createElement('style'),sheet;
document.head.appendChild(element);
element.sheet.insertRule(blikPayButtonSelector + '{ display: none; }');
// var blikPayButtonSelector = "form.paynow-blik-form .paynow-payment-option-container button.btn-primary";
// if (element.find('.paynow-blik-form').length) {
// element.find('.payment-form').attr('onsubmit', '$("'+blikPayButtonSelector+'").click(); return false;');
// element.find(blikPayButtonSelector).prop('disabled', false);
// }
//
// // Add CSS rule to hide blickPayButton
// var element = document.createElement('style'),sheet;
// document.head.appendChild(element);
// element.sheet.insertRule(blikPayButtonSelector + '{ display: none; }');
},
}

View File

@@ -12,6 +12,7 @@
/*
IMPORTANT: In paypal v5.8.0, make sure to disable 'Put the PayPal button at the end of the order page' option!
If using Giropay, Sofort, SEPA - also set in Paypal configuration 'Redirection' mode, instead of 'In-Context'
*/
checkoutPaymentParser.paypal = {
@@ -37,7 +38,7 @@ checkoutPaymentParser.paypal = {
additionalInfoElement = $(containerElement).next('[id$=-additional-information]');
// If embedded mode (=data-container-express-checkout button exists), set popup payment type and make it binary
if (additionalInfoElement.find('[data-container-express-checkout]').length || additionalInfoElement.find('[data-container-bnpl]').length) {
if (additionalInfoElement.find('[data-container-express-checkout]').length || additionalInfoElement.find('[data-container-bnpl]').length || additionalInfoElement.find('[paypal-acdc-card-wrapper]').length) {
payment.setPopupPaymentType($(containerElement), true);
additionalInfoElement.addClass('paypal').addClass('paypal-hide-pp-info-and-button');
additionalInfoElement.find('.pp-info').prependTo(additionalInfoElement);
@@ -80,6 +81,11 @@ checkoutPaymentParser.paypal = {
}
}
// New Paypal (5.7+) card payment (acdc)
if ($(paymentContent).find('[paypal-acdc-wrapper]').length) {
var acdcRadio = $(paymentContent).find('.payment-option');
payment.setPopupPaymentType(acdcRadio);
}
});
var express_checkout_make_visible = '<script>\
@@ -130,6 +136,14 @@ checkoutPaymentParser.paypal = {
element.append(additional_script_tag);
}
}
}
},
popup_onopen_callback: function () {
if ($('#bon-google-checkout').length) {
var script = document.createElement('script');
script.src = tcModuleBaseUrl+'/../bongooglepay/views/js/bongooglepay-front.js';
document.head.appendChild(script);
}
},
}

View File

@@ -0,0 +1,34 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
checkoutPaymentParser.pm_applepay = {
popup_onopen_callback: function () {
console.info('[pm_applepay] popup_onopen_callback');
if (typeof (pmApplePayPlugin) !== 'undefined' && typeof (initPmApplePayEventsListeners) !== 'undefined') {
initPmApplePayEventsListeners();
}
},
after_load_callback: function() {
$('.dynamic-content .pm-apple-pay-container').appendTo('#pm_applepay-popup-container');
},
container: function(element) {
// // Create additional information block, informing user that payment will be processed after confirmation
// var paymentOptionId = element.attr('id').match(/payment-option-\d+/);
//
// if (paymentOptionId && 'undefined' !== typeof paymentOptionId[0]) {
// paymentOptionId = paymentOptionId[0];
// element.after('<div id="'+paymentOptionId+'-additional-information" class="stripe_official popup-notice js-additional-information definition-list additional-information ps-hidden" style="display: none;"><section><p>'+i18_popupPaymentNotice+'</p></section></div>')
// }
payment.setPopupPaymentType(element);
}
}

View File

@@ -8,6 +8,11 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/** Important - change this:
* in modules/pm_subscription/models/Dispatcher/MainCase.php, in method includeAssetsOfPaymentModules():
$isOrderController = $this->context->controller instanceof OrderController || $this->context->controller instanceof OrderOpcController || $this->context->controller->page_name == "module-thecheckout-order";
*/
checkoutPaymentParser.pm_subscription_popup = {

View File

@@ -9,7 +9,7 @@
*/
/* (!)
postfinancecheckout v1.2.3 - by Customweb
Tested on 4.3.2024, with postfinancecheckout v1.2.34 - by Customweb
in modules/postfinancecheckout/views/js/frontend/checkout.js, change (!) on 2 places:
if (current_method.data("module-name") == "postfinancecheckout") {

View File

@@ -0,0 +1,53 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* Payment is done in popup, because since the Blik input initialization, we have a limitted time until the order must be finished, so we'd rather init in the popup */
checkoutPaymentParser.przelewy24 = {
container: function(element) {
const isBlikPaymentOption = element.find('[data-module-name=przelewy24-method-181]').length == 1;
if (isBlikPaymentOption) {
payment.setPopupPaymentType(element);
element.find('input[name=payment-option]').addClass('binary'); // so that our 'pay' button disappears
}
// Add CSS rule to hide blik form in payment methods list when T&C checkbox is ticked;
// but keep it visible in the popup
var cssEl = document.createElement('style'),sheet;
document.head.appendChild(cssEl);
cssEl.sheet.insertRule(`
section#checkout-payment-step #p24-blik-section {
display: none!important;
}
`);
},
popup_onopen_callback: function () {
$.getScript(tcModuleBaseUrl+'/../przelewy24/views/js/p24_inside.js')
.done(
function() {
setTimeout(function() {
$('[name=payment-option]:checked').change(); // invoke blik code input initialization
setTimeout(function() {
const paymentFormEl = $('.popup-payment-form').find('.js-additional-information');
$('#p24-blik-section').prependTo(paymentFormEl);
}, 200);
}, 300);
});
},
form: function (element) {
},
}

View File

@@ -9,6 +9,7 @@
*/
/* Tested with ps_checkout v2.21.0 (12.01.2023) */
/* Tested with ps_checkout v8.4.0 - commented out payment form removal (29.04.2024) */
window.tc_ps_checkout = {
init: false
};
@@ -80,7 +81,7 @@ checkoutPaymentParser.ps_checkout = {
}
// Disable weird 'click' emitted by _dev\js\front\src\components\1_7\payment-options.component.js in renderPaymentOptionItems() method
$('body').off('click.ps_checkout').on('click.ps_checkout', '[data-module-name=ps_checkout-paypal]', (e) => {
$('body').off('click.ps_checkout').on('click.ps_checkout', '[data-module-name^=ps_checkout-paypal]', (e) => {
let stackTrace = JSON.stringify(Error().stack);
if (stackTrace && stackTrace.match('modules/ps_checkout/views/js/front.js')) {
console.log('triggered by ps_checkout paypal fundingSource HTMLElement.click(), skip selected payment toggle');
@@ -115,12 +116,12 @@ checkoutPaymentParser.ps_checkout = {
},
form: function (element, triggerElementName) {
if (!payment.isConfirmationTrigger(triggerElementName)) {
if (debug_js_controller) {
console.info('[ps_checkout parser] Not confirmation trigger, removing payment form');
}
element.remove();
}
// if (!payment.isConfirmationTrigger(triggerElementName)) {
// if (debug_js_controller) {
// console.info('[ps_checkout parser] Not confirmation trigger, removing payment form');
// }
// element.remove();
// }
},
additionalInformation: function (element) {

View File

@@ -0,0 +1,29 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
tc_confirmOrderValidations['pshugls'] = function() {
if (
$('.carrier-extra-content.pshugls:visible').is(':visible') &&
$('.delivery-option.pshugls.selected').length === 1 &&
(
$('.delivery-option.pshugls.selected ~ .carrier-extra-content.pshugls').find('#gls-map-success-parcel-shop:visible').length === 0 &&
$('.delivery-option.pshugls.selected ~ .carrier-extra-content.pshugls').find('#gls-map-success-parcel-locker:visible').length === 0
)
) {
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
shippingErrorMsg.find('.err-pshugls').remove();
shippingErrorMsg.append('<span class="err-pshugls"> (pickup point)</span>');
shippingErrorMsg.show();
scrollToElement(shippingErrorMsg);
return false;
} else {
return true;
}
}

View File

@@ -0,0 +1,43 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
checkoutPaymentParser.redsysinsite = {
container: function(element) {
payment.setPopupPaymentType(element);
element.find('input[name=payment-option]').addClass('binary'); // so that our 'pay' button in the popup disappears
// Add CSS rule to hide payment form in payment methods list
// but keep it visible in the popup
var cssEl = document.createElement('style'),sheet;
document.head.appendChild(cssEl);
cssEl.sheet.insertRule(`
section#checkout-payment-step .redsysinsite_form_container [id^='redsysinsite_card_form_container'] {
display: none!important;
}
`);
cssEl.sheet.insertRule(`
.popup-payment-form [id^=ri-messages] {
display: none;
}
`);
},
popup_onopen_callback: function () {
},
form: function (element) {
},
}

View File

@@ -9,6 +9,23 @@
*/
/* popup mode last tested on 15.4.2023 with revolutpayment v2.2.4 */
/* popup/direct(=embedded)/redirect modes tested on 1.5.2024 with revolutpayment v2.8.6 */
/* Update please \revolutpayment\views\js\version17\revolut.payment.js, method initCheckoutUpsellBanner():
function initCheckoutUpsellBanner() {
let upsellBannerElement = document.getElementById("revolut-upsell-banner");
// Thecheckout module update begin
if (upsellBannerElement === null) { return; }
// Thecheckout module udpate end
And for revolutpay button, also update stopLoading() method, like so:
function stopLoading() {
// Thecheckout module update BEGIN
if (typeof $.unblockUI === 'function') {
$.unblockUI();
}
// Thecheckout module update END
}
*/
checkoutPaymentParser.revolutpayment = {
@@ -20,6 +37,25 @@ checkoutPaymentParser.revolutpayment = {
},
after_load_callback: function() {
// Update card logos, by default only VISA is shown
if (typeof logo_path === "undefined") {
return;
}
let visa_logo = `<img class="visa-logo" src="${logo_path}visa-logo.svg"/>`;
let mastercard_logo = `<img class="mastercard-logo" src="${logo_path}master-card-logo.svg">`;
let amex_logo = `<img class="amex-logo" style="display:none" src="${logo_path}amex.svg">`;
$(`img[src="${logo_path}visa-logo.svg"] ~ .tc-rev-logos`).remove();
$(`img[src="${logo_path}visa-logo.svg"]`).after(`${visa_logo}<span class="tc-rev-logos">${mastercard_logo}${amex_logo}</span>`).remove();
$(`img[src="${revpay_logo}"]`).after(`${visa_logo}${mastercard_logo}${amex_logo}`).css({ width: "30px" });
if (amex_availability) {
$(".amex-logo").show();
}
},
initPayment: function() {
// revolut_card container present, but fields not yet initiated
if ($('#revolut_card').length && !($('#revolut_card.rc-card-field').length)) {
@@ -31,12 +67,28 @@ checkoutPaymentParser.revolutpayment = {
// Create additional information block, informing user that payment will be processed after confirmation
var paymentOptionId = element.attr('id').match(/payment-option-\d+/);
let isRevolutPay = element.next().find('#revolutPayForm').length === 1;
let isRevolutCard = element.next().find('#revolutPay').length === 1; // not used now
if (isRevolutPay) {
element.find('input[name=payment-option]').addClass('binary'); // so that our 'pay' button disappears
}
if (paymentOptionId && 'undefined' !== typeof paymentOptionId[0]) {
paymentOptionId = paymentOptionId[0];
element.after('<div id="'+paymentOptionId+'-additional-information" class="stripe_official popup-notice js-additional-information definition-list additional-information ps-hidden" style="display: none;"><section><p>'+i18_popupPaymentNotice+'</p></section></div>')
element.after('<div id="'+paymentOptionId+'-additional-information" class="revolutpayment popup-notice js-additional-information definition-list additional-information ps-hidden" style="display: none;"><section><p>'+i18_popupPaymentNotice+'</p></section></div>')
}
payment.setPopupPaymentType(element);
// Add CSS rule
var cssEl = document.createElement('style'),sheet;
document.head.appendChild(cssEl);
cssEl.sheet.insertRule(`
[data-payment-module=revolutpayment] .amex-logo ~ .tc-rev-logos {
display: none;
}
`);
},
form: function (element, triggerElementName) {

View File

@@ -8,6 +8,18 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/*
Tested with sendcloud v2.0.9 (09.05.2024)
(!) important, update /modules/sendcloudv2/sendcloudv2.php, method hookDisplayHeader(..), change $allowedControllers to:
$allowedControllers = [
'HistoryController',
'OrderConfirmationController',
'OrderController',
'OrderOpcController',
'TheCheckoutModuleFrontController'
];
*/
tc_confirmOrderValidations['sendcloud'] = function() {
if (
/*$('#mondialrelay_widget').is(':visible')*/

View File

@@ -11,6 +11,25 @@
var shaim_shipping_modules_present = ('undefined' !== typeof exists_opc);
if (shaim_shipping_modules_present) {
document.addEventListener('DOMContentLoaded', function(event) {
if (typeof CheckHardPplparcelshop === 'function') {
prestashop.on('thecheckout_updateDeliveryOption', function () {
setTimeout(function () {
var ppl_parcelshop_iframe = document.getElementById('ppl_parcelshop_iframe');
if (typeof ppl_parcelshop_iframe !== 'undefined' && ppl_parcelshop_iframe && typeof iframeListenerPplparcelshop === 'function') {
var idoc_ppl_parcelshop = ppl_parcelshop_iframe.contentWindow || ppl_parcelshop_iframe.contentDocument;
idoc_ppl_parcelshop.document.addEventListener('ppl-parcelshop-map', function (e) {
iframeListenerPplparcelshop(e);
});
}
}, 1500);
});
}
});
tc_confirmOrderValidations['shaim_shipping_modules'] = function () {
/* openservis - WEDO - begin */
@@ -95,5 +114,3 @@ if (shaim_shipping_modules_present) {
/* openservis - Zásilkovna - end */
}
}

View File

@@ -8,10 +8,12 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* popup mode last tested on 15.4.2023 with stripe_official v3.0.2 */
/* popup mode last tested on 15.03.2024 with stripe_official v3.2.0 */
/* (!) Set 'Payment Form Position' to 'With the Prestashop payment methods' in Stripe configuration
/* redirect mode last tested on 12.12.2023 with stripe_official v3.1.3 (removed JS redirect, it's supported now natively in stripe_official module through config option) */
checkoutPaymentParser.stripe_official_inline = {
checkoutPaymentParser.stripe_official_redirect = {
all_hooks_content: function (content) {
@@ -19,76 +21,10 @@ checkoutPaymentParser.stripe_official_inline = {
container: function (element) {
//payment.setPopupPaymentType(element);
// Add logos to payment method
// Img path:
var stripe_base_url = '';
if ('undefined' !== typeof prestashop && 'undefined' !== prestashop.urls && 'undefined' !== prestashop.urls.base_url) {
stripe_base_url = prestashop.urls.base_url;
}
element.find('label').append('<img src="' + stripe_base_url + '/modules/stripe_official/views/img/logo-payment.png">');
},
form: function (element) {
// First, set the 'form' action to be our background confirmation button click
// On this background confirmation button, stripe action is hooked
let form = element.find('form');
let onSubmitAction = '$(\'#payment-confirmation button\').click();';
form.attr('action', 'javascript:void(0);');
form.attr('onsubmit', onSubmitAction);
// And now, let's put Stripe's form into static container, so that it's not being refreshed
var paymentOptionForm = element;
var staticContentContainer = $('#thecheckout-payment .static-content');
// Now create new block with original Id and place it inside of static-content block
if (!staticContentContainer.find('.stripe-payment-form').length) {
$('<div class="stripe-payment-form"></div>').appendTo(staticContentContainer);
paymentOptionForm.clone().appendTo(staticContentContainer.find('.stripe-payment-form'));
staticContentContainer.find('.stripe-payment-form script').remove();
// Formatted version - KEEP it
// Init only once - when we're first time moving CC form
// let stripe_orig_script_tag = `
// <script>
// if ($('#stripe-card-element').length && !$('#stripe-card-element.StripeElement').length) {
// var stripe_base_url = '';
// if ('undefined' !== typeof prestashop && 'undefined' !== prestashop.urls && 'undefined' !== prestashop.urls.base_url) {
// stripe_base_url = prestashop.urls.base_url;
// }
// $.getScript(stripe_base_url + '/modules/stripe_official/views/js/payments.js');
// }
// </script>
// `;
// https://babeljs.io/repl
var stripe_orig_script_tag = "\n <script>\n if (($('#stripe-card-element').length && !$('#stripe-card-element.StripeElement').length) || ($('#stripe-card-number').length && !$('#stripe-card-number.StripeElement').length)) {\n var stripe_base_url = '';\n if ('undefined' !== typeof prestashop && 'undefined' !== prestashop.urls && 'undefined' !== prestashop.urls.base_url) {\n stripe_base_url = prestashop.urls.base_url;\n }\n $.getScript(stripe_base_url + '/modules/stripe_official/views/js/payments.js');\n }\n </script>\n ";
//
staticContentContainer.find('.stripe-payment-form').append(stripe_orig_script_tag);
}
// Remove stripe payment form from actual .js-payment-option-form container and keep only "dynamic" part,
// which is <script> tag with dynamically created variables
var scriptTag = paymentOptionForm.find('script');
// stripe_official can have multiple payment options, make sure move only card payment to static-container
if (paymentOptionForm.find('#stripe-card-payment').length) {
paymentOptionForm.find('*').remove();
paymentOptionForm.prepend(scriptTag);
// Update ID of fixed form, so that it's displayed/hidden automatically with payment method selection
var origId = paymentOptionForm.attr('id');
staticContentContainer.find('.stripe-payment-form .js-payment-option-form').attr('id', origId);
// Remove tag ID and class from original form
paymentOptionForm.attr('id', 'stripe-script-tag-container');
paymentOptionForm.removeClass('js-payment-option-form');
}
}
}
@@ -108,12 +44,36 @@ checkoutPaymentParser.stripe_official_popup = {
if (($('#stripe-card-element').length && !$('#stripe-card-element.StripeElement').length) ||
($('#stripe-card-number').length && !$('#stripe-card-number.StripeElement').length) ||
($('#js-stripe-payment-element').length && !$('#js-stripe-payment-element.StripeElement').length)) {
// var stripe_base_url = '';
// if ('undefined' !== typeof prestashop && 'undefined' !== prestashop.urls && 'undefined' !== prestashop.urls.base_url) {
// stripe_base_url = prestashop.urls.base_url;
// }
$.getScript(tcModuleBaseUrl+'/../stripe_official/views/js/checkout.js');
// $.getScript(stripe_base_url + '/modules/stripe_official/views/js/payments.js');
// $.getScript(tcModuleBaseUrl+'/../stripe_official/views/js/checkout.js');
var script = document.createElement('script');
script.src = tcModuleBaseUrl+'/../stripe_official/views/js/checkout.js';
// If we unselect payment option, checkout.js would click it by its own when loaded - it would click 1st option, I guess they
// somehow made sure they're always at first position; but, it is necessary only when there are multiple payment methods!
if (document.querySelectorAll('input[name="payment-option"]').length > 1) {
document.querySelector('input[name="payment-option"]:checked').checked = false;
}
script.addEventListener('load', function() {
setTimeout(function() {
// If #js-stripe-payment-form is located outside of payment-form (this can be set in Stripe options - 'Payment Form Position'
// This is only workaround, if preferably set 'Payment Form Position' to 'With the Prestashop payment methods'
const stripeForm = $('.payment-options > #js-stripe-payment-form');
if (stripeForm.length) {
$('.popup-payment-content[data-payment-module=stripe_official] .js-payment-option-form').append(stripeForm);
}
},1000);
// console.log(' -- checkout.js loaded, now lets dispatch change event to payment option');
// var radioButton = document.querySelector('input[name="payment-option"]:checked');
// if (radioButton) {
// radioButton.dispatchEvent(new Event('change'));
// console.log('dispatched change event to payment option', radioButton);
// }
});
document.head.appendChild(script);
}
},
@@ -136,20 +96,27 @@ checkoutPaymentParser.stripe_official_popup = {
payment.setPopupPaymentType(element);
var cssEl = document.createElement('style'),sheet;
document.head.appendChild(cssEl);
cssEl.sheet.insertRule(`
.popup-payment-content[data-payment-module=stripe_official] .js-payment-option-form {
display: block!important;
}
`);
},
form: function (element, triggerElementName) {
if (!payment.isConfirmationTrigger(triggerElementName)) {
if (debug_js_controller) {
console.info('[stripe_official parser] Not confirmation trigger, removing payment form');
}
element.remove();
} else {
// var stripe_orig_script_tag = "\n <script>\n if (($('#stripe-card-element').length && !$('#stripe-card-element.StripeElement').length) || ($('#stripe-card-number').length && !$('#stripe-card-number.StripeElement').length)) {\n var stripe_base_url = '';\n if ('undefined' !== typeof prestashop && 'undefined' !== prestashop.urls && 'undefined' !== prestashop.urls.base_url) {\n stripe_base_url = prestashop.urls.base_url;\n }\n $.getScript(stripe_base_url + '/modules/stripe_official/views/js/payments.js');\n }\n </script>\n ";
// element.append(stripe_orig_script_tag);
// checkoutPaymentParser.stripe_official_popup.initPayment();
}
// if (!payment.isConfirmationTrigger(triggerElementName)) {
// // Integrated payment form
// if (debug_js_controller) {
// console.info('[stripe_official parser] Not confirmation trigger, removing payment form');
// }
// element.remove();
// } else {
// // empty
// }
return;
}
@@ -157,7 +124,8 @@ checkoutPaymentParser.stripe_official_popup = {
}
// Default Stripe parser
//checkoutPaymentParser.stripe_official = checkoutPaymentParser.stripe_official_inline;
checkoutPaymentParser.stripe_official = checkoutPaymentParser.stripe_official_popup;
if (typeof stripe_payment_elements_enabled !== "undefined" && stripe_payment_elements_enabled === "1") {
checkoutPaymentParser.stripe_official = checkoutPaymentParser.stripe_official_popup;
} else {
checkoutPaymentParser.stripe_official = checkoutPaymentParser.stripe_official_redirect;
}

View File

@@ -8,52 +8,37 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
checkoutPaymentParser.stripejs_removed = {
/* tested with Stripe Payment Pro v4.6.0 - by NTS - on 12.03.2024, when embedded payment is enabled */
checkoutPaymentParser.stripejs = {
initiatePayment: function() {
if (typeof StripePubKey !=='undefined') {
var stripe = Stripe(StripePubKey,{locale: lang_iso_code});
var stripe_pm = document.getElementById('selected_pm').value;
var quickPay = ((stripe_pm!=1) ? 1 : 0);
// after_load_callback: function() {
// if (typeof initiateStripePayment !== 'undefined') {
// initiateStripePayment();
// }
// },
$('input[name=payment-option]:checked').focus();
$('#stripe-ajax-loader,#stripe-payment-form').toggle();
$('#payment-confirmation button[type=submit]').prop("disabled", true);
var toggle_selector = '#stripe-ajax-loader,#stripe-payment-form';
var error_selector = '#card-errors';
container: function (element) {
payment.setPopupPaymentType(element);
handlePI('checkout', function(res_status){
if(res_status.code==1) {
$('#checkout-success').show();
stripe.redirectToCheckout({
sessionId: res_status.sess_id
}).then(function (result) {
$('#checkout-success').hide();
var err_msg = showStripePayError(toggle_selector, 0, result.error.message, error_selector);
alert(result.error.message);
});
}
});
// Add CSS rule to hide payment form in payment methods list
var cssEl = document.createElement('style'),sheet;
document.head.appendChild(cssEl);
cssEl.sheet.insertRule(`
section#checkout-payment-step [data-payment-module=stripejs] > .additional-information {
display: none!important;
}
`);
},
popup_onopen_callback: function () {
if (typeof initiateStripePayment !== 'undefined') {
// out of some reason stripe_allow_prbutton is always false on initial page load
if ($('[data-module-name^=stripePRButton]').length && typeof stripe_allow_prbutton !== 'undefined') {
stripe_allow_prbutton = true;
}
initiateStripePayment();
}
},
after_load_callback: function() {
// $.getScript(tcModuleBaseUrl + '/../stripejs/views/js/stripe-prestashop.js');
},
all_hooks_content: function (content) {
},
container: function (element) {
},
form: function (element) {
let form = element.find('form');
let onSubmitAction = 'javascript:checkoutPaymentParser.stripejs.initiatePayment()';
form.attr('action', 'javascript:void(0);');
form.attr('onsubmit', onSubmitAction);
}
}

View File

@@ -0,0 +1,39 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
tc_confirmOrderValidations['tpay'] = function () {
if (
$('ul.tpay-payment-gateways:visible').length &&
$('[name=tpay_transfer_id]:checked').length == 0
) {
var paymentErrorMsg = $('#thecheckout-payment .dynamic-content > .inner-wrapper > .error-msg');
$('.payment-validation-details').remove();
paymentErrorMsg.append('<span class="payment-validation-details"> (Tpay channel)</span>')
paymentErrorMsg.show();
scrollToElement(paymentErrorMsg);
return false;
} else {
return true;
}
}
checkoutPaymentParser.tpay = {
after_load_callback: function() {
$.getScript(tcModuleBaseUrl+'/../tpay/views/js/main.min.js')
.done(
function() {
console.log('tpay loaded');
});
},
form: function (element) {
// intentionally empty
},
}

View File

@@ -8,6 +8,14 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/*
Update file: /modules/upsservice/upsservice.php, change in hookDisplayHeader():
from:
if (($this->context->controller instanceof OrderController) || ($this->context->controller instanceof OrderOpcController)) {
to:
if (($this->context->controller instanceof OrderController) || ($this->context->controller instanceof OrderOpcController) || $this->context->controller instanceof TheCheckoutModuleFrontController) {
*/
checkoutShippingParser.upsservice = {
after_load_callback: function(deliveryOptionIds) {

View File

@@ -4,20 +4,41 @@
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @author Veebipoed.ee | Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
tc_confirmOrderValidations['vp_omniva'] = function() {
if (
$('.vp_omniva select[name=terminals]').is(':visible') &&
'0' == $('.vp_omniva select[name=terminals]').val()
) {
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
shippingErrorMsg.show();
scrollToElement(shippingErrorMsg);
return false;
} else {
return true;
tc_confirmOrderValidations['vp_omniva'] = function() {
let selectedDeliveryOption = $('.delivery-option-row.selected');
if (selectedDeliveryOption && 0 !== selectedDeliveryOption.length) {
if (selectedDeliveryOption[0].classList.contains('vp_omniva') ||
selectedDeliveryOption[0].classList.contains('vp_omniva_latvia') ||
selectedDeliveryOption[0].classList.contains('vp_omniva_lietuva')) {
let nextElement = selectedDeliveryOption[0].nextElementSibling;
if (nextElement && 0 !== nextElement.children.length) {
let selectElements = $(nextElement).find('select');
if (2 === selectElements.length) {
if (selectElements[1][0].selected) {
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
shippingErrorMsg.show();
scrollToElement(shippingErrorMsg);
return false;
} else {
return true;
}
} else {
if (selectElements[0][0].selected) {
var shippingErrorMsg = $('#thecheckout-shipping .inner-wrapper > .error-msg');
shippingErrorMsg.show();
scrollToElement(shippingErrorMsg);
return false;
} else {
return true;
}
}
}
}
}
}
return true; // default when validations are not needed
}

View File

@@ -67,9 +67,9 @@ var payment = (function () {
if (0 == $(selectedOption).length) {
// Only now try to select by default set in checkout options
// Changed to 'starts with' selector, e.g. paypal module has data-module-name=paypal_plus
selectedOption = '[data-module-name^=' + config_default_payment_method + ']';
selectedOption = '[data-module-name^=' + config_default_payment_method + ' i]';
}
if (0 == $(selectedOption).length) {
if (0 == $(selectedOption).length && config_default_payment_method != '') {
selectedOption = '.' + config_default_payment_method + ' [name=payment-option]:first';
}
@@ -180,7 +180,7 @@ var payment = (function () {
var paymentOption = getPaymentOptionSelector(option);
$(paymentOption).slideDown();
if (!dont_remove_confirmation_button) {
// self.confirmationButton.hide();
self.confirmationButton.hide();
}
}
@@ -242,7 +242,7 @@ var payment = (function () {
loadPaymentPopupLibrary(function() {
popupContainer.paymentpopup({
onopen: function () {
popupCallback(paymentMethodName)
popupCallback(paymentMethodName, option)
},
onclose: function() {
popupCloseCallback(paymentMethodName);
@@ -282,11 +282,11 @@ var payment = (function () {
}
}
function popupCallback(paymentMethodName) {
function popupCallback(paymentMethodName, optionId) {
if ('undefined' !== typeof checkoutPaymentParser[paymentMethodName]
&& 'undefined' !== typeof checkoutPaymentParser[paymentMethodName].popup_onopen_callback) {
console.info('popup open callback for ' + paymentMethodName + ' called');
checkoutPaymentParser[paymentMethodName].popup_onopen_callback();
checkoutPaymentParser[paymentMethodName].popup_onopen_callback(optionId);
}
}

View File

@@ -40,6 +40,12 @@ var tc_facebookLogin = (function () {
} else if ('undefined' !== typeof jsonData.email && jsonData.email) {
signedInUpdateForm();
}
},
error: function(jqXHR, textStatus, errorThrown) {
if(jqXHR.status === 500) {
console.error("Internal server error occurred: ", errorThrown);
}
location.reload();
}
});
}
@@ -103,7 +109,7 @@ var tc_googleLogin = (function () {
// Display the Sign In With Google Button
google.accounts.id.renderButton(
document.getElementById(customBtnId),
{ theme: 'outline', size: 'large' }
{ theme: 'outline', size: 'large', width: 240 }
);
}
@@ -124,6 +130,12 @@ var tc_googleLogin = (function () {
} else if ('undefined' !== typeof jsonData.email && jsonData.email) {
signedInUpdateForm();
}
},
error: function(jqXHR, textStatus, errorThrown) {
if(jqXHR.status === 500) {
console.error("Internal server error occurred: ", errorThrown);
}
location.reload();
}
});
}

View File

@@ -0,0 +1,27 @@
### [shipping] fedexdotcom
Add postcode to Shipping required fields (The Checkout configuration)
Edit /modules/fedexdotcom/classes/FedExDotComHandler.php, in method getShippingAddresses(...)
Change:
if (!Validate::isLoadedObject($customer)) {
return false;
}
To:
if (!Validate::isLoadedObject($customer)) {
$customer_email = '';
// return false;
} else {
$customer_email = $customer->email;
}
And few lines below:
Change: (notice customer->email vs. customer_email)
'EMailAddress' => (isset($this->destination_address['EMailAddress']) ? $this->destination_address['EMailAddress'] : $customer->email),
To:
'EMailAddress' => (isset($this->destination_address['EMailAddress']) ? $this->destination_address['EMailAddress'] : $customer_email),

View File

@@ -63,12 +63,12 @@
</fieldset>
{elseif "size" === $key} {*intentionally empty*}
{else}
{if 0 === $key|strpos:'flex-split'}
{if 0 === strpos($key,'flex-split')}
<fieldset class="checkout-block-container" data-default-size="{$data.size}">
<div class="{$key}">
{/if}
{blockContainer data=$sub_block}
{if 0 === $key|strpos:'flex-split'}
{if 0 === strpos($key,'flex-split')}
</div>
</fieldset>
{/if}

View File

@@ -32,7 +32,7 @@
{if $product.cover}
<img src="{$product.cover.bySize.cart_default.url}" alt="{$product.name|escape:'quotes'}">
{else}
<img src="{$urls.no_picture_image.bySize.cart_default.url}" />
<img src="{$urls.no_picture_image.bySize.cart_default.url|escape:'javascript':'UTF-8'}" />
{/if}
{/if}
</span>
@@ -42,95 +42,115 @@
<div class="product-line-body">
<div class="product-line-desc">
<div class="product-line-info product-title">
<a class="label" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
<a class="label" href="{$product.url|escape:'javascript':'UTF-8'}"
data-id_customization="{$product.id_customization|intval}">{$product.name|escape:'javascript':'UTF-8'}</a>
</div>
<div class="product-line-info product-price h5 {if $product.has_discount}has-discount{/if} 11">
{if $product.has_discount}
<div class="product-line-info product-price h5 {if $product.has_discount}has-discount{/if}">
{if $product.has_discount|escape:'javascript':'UTF-8'}
<div class="product-discount">
<span class="regular-price">{$product.regular_price}</span>
<span class="regular-price">{$product.regular_price|escape:'javascript':'UTF-8'}</span>
{if $product.discount_type === 'percentage'}
<span class="discount discount-percentage">
-{$product.discount_percentage_absolute}
-{$product.discount_percentage_absolute|escape:'javascript':'UTF-8'}
</span>
{else}
<span class="discount discount-amount">
-{$product.discount_to_display}
-{$product.discount_to_display|escape:'javascript':'UTF-8'}
</span>
{/if}
</div>
{/if}
<div class="current-price">
<span class="price">{$product.price}</span>
<span class="price">{$product.price|escape:'javascript':'UTF-8'}</span>
{if $product.unit_price_full}
<div class="unit-price-cart">{$product.unit_price_full}</div>
<div class="unit-price-cart">{$product.unit_price_full|escape:'javascript':'UTF-8'}</div>
{/if}
</div>
</div>
<br />
<br/>
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info product-attribute">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
<span class="label">{$attribute|escape:'htmlall':'UTF-8'}:</span>
<span class="value">{$value|escape:'htmlall':'UTF-8'}</span>
</div>
{/foreach}
{if $tc_config->show_product_stock_info} {*tc module config*}
<div class="product-line-info quantity-info">
<span class="{if $product.quantity_available <= 0 && !$product.allow_oosp}qty-label label-warning{else}qty-label label-success{/if}
{if $z_tc_config->show_product_stock_info} {*tc module config*}
<div class="product-line-info quantity-info">
<span class="{if $product.quantity_available <= 0 && !$product.allow_oosp}qty-label label-warning{else}qty-label label-success{/if}
{if $product.quantity_available <= 0} label-later{/if}">
{if $product.quantity_available <= 0}
{if $product.allow_oosp}
{if isset($product.available_later) && $product.available_later}
{$product.available_later}
{if $product.quantity_available <= 0}
{if $product.allow_oosp}
{if isset($product.available_later) && $product.available_later}
{$product.available_later|escape:'htmlall':'UTF-8'}
{else}
{*{$product.availability_message}*}
{l s='In supplier stock' mod='thecheckout'}
{/if}
{else}
{l s='Out of stock' mod='thecheckout'}
{/if}
{else}
{*{$product.availability_message}*}
{l s='In supplier stock' mod='thecheckout'}
{if isset($product.available_now) && $product.available_now}
{$product.available_now|escape:'htmlall':'UTF-8'}
{else}
{l s='In stock' d='Shop.Theme.Catalog'}
{/if}
{/if}
{else}
{l s='Out of stock' mod='thecheckout'}
{/if}
{else}
{if isset($product.available_now) && $product.available_now}
{$product.available_now}
{else}
{l s='In stock' d='Shop.Theme.Catalog'}
{/if}
{/if}
</span>
<div class='qty-insufficient-stock{if $product.quantity_available>=$product.quantity || $product.quantity_available<=0} hidden{/if}'>
<span class='qty-in-stock-only'>{l s='In stock only' mod='thecheckout'} {$product.quantity_available} {l s='pcs.' mod='thecheckout'}</span>
{if $product.allow_oosp}
<span class='qty-remaining-on'>{l s='Remaining pcs. in' mod='thecheckout'} {$product.available_later}</span>
{else}
<span class='qty-remaining-on no-longer-available'>{l s='Please adjust quantity' mod='thecheckout'}</span>
{/if}
</div>{*hook h="displayProductDeliveryTime" product=$product*}
</div>
{/if}
</span>
<div class='qty-insufficient-stock{if $product.quantity_available>=$product.quantity || $product.quantity_available<=0} hidden{/if}'>
<span class='qty-in-stock-only'>{l s='In stock only' mod='thecheckout'} {$product.quantity_available|escape:'htmlall':'UTF-8'} {l s='pcs.' mod='thecheckout'}</span>
{if $product.allow_oosp}
<span class='qty-remaining-on'>{l s='Remaining pcs. in' mod='thecheckout'} {$product.available_later|escape:'htmlall':'UTF-8'}</span>
{else}
<span class='qty-remaining-on no-longer-available'>{l s='Please adjust quantity' mod='thecheckout'}</span>
{/if}
</div>{*hook h="displayProductDeliveryTime" product=$product*}</div>
{/if}
{if $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
<div class="product-customization-line row">
<div class="col-12">
{$field.label}:
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
<a href="#" data-toggle="modal"
data-target="#product-customizations-modal-{$customization.id_customization|escape:'javascript':'UTF-8'}">{l s='Product customization' d='Shop.Theme.Catalog'}</a>
<div class="modal fade customization-modal"
id="product-customizations-modal-{$customization.id_customization|escape:'javascript':'UTF-8'}" tabindex="-1" role="dialog"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">{l s='Product customization' d='Shop.Theme.Catalog'}</h4>
</div>
<div class="modal-body">
{foreach from=$customization.fields item="field"}
<div class="product-customization-line row">
<div class="col-sm-3 col-xs-4 label">
{$field.label|escape:'htmlall':'UTF-8'}
</div>
<div class="col-sm-9 col-xs-8 value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text|escape:'htmlall':'UTF-8'}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url|escape:'javascript':'UTF-8'}">
{/if}
</div>
</div>
{/foreach}
</div>
</div>
</div>
{/foreach}
</div>
{/foreach}
{/block}
{/if}
@@ -139,32 +159,59 @@
<!-- product left body: description -->
<div class="product-line-actions">
<div class="product-line-qty" data-qty-control="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}">
<div class="product-line-qty"
data-qty-control="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}">
<div class="qty-container">
<div class="qty-box">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input class="cart-line-product-quantity" data-link-action="x-update-cart-quantity" data-update-url="{$product.update_quantity_url}" data-id-product="{$product.id_product|escape:'javascript':'UTF-8'}" data-id-product-attribute="{$product.id_product_attribute|escape:'javascript':'UTF-8'}" data-id-customization="{$product.id_customization|escape:'javascript':'UTF-8'}" data-qty-orig="{$product.quantity|escape:'javascript':'UTF-8'}" type="text" value="{$product.quantity}" name="product-quantity-spin" min="{$product.minimal_quantity}" />
<a class="cart-line-product-quantity-up" href="{$product.up_quantity_url}" data-link-action="x-update-cart-quantity-up">{*Up*}</a>
<a class="cart-line-product-quantity-down" href="{$product.down_quantity_url}" data-link-action="x-update-cart-quantity-down">{*Down*}</a>
<input
class="cart-line-product-quantity"
data-link-action="x-update-cart-quantity"
data-update-url="{$product.update_quantity_url}"
data-id-product="{$product.id_product|escape:'javascript':'UTF-8'}"
data-id-product-attribute="{$product.id_product_attribute|escape:'javascript':'UTF-8'}"
data-id-customization="{$product.id_customization|escape:'javascript':'UTF-8'}"
data-qty-orig="{$product.quantity|escape:'javascript':'UTF-8'}"
{* data-step="{$product.minimal_quantity|escape:'javascript':'UTF-8'}"*}
type="text"
value="{$product.quantity}"
name="product-quantity-spin"
min="{$product.minimal_quantity}"
/>
<a class="cart-line-product-quantity-up"
href="{$product.up_quantity_url}"
data-link-action="x-update-cart-quantity-up">{*Up*}</a>
<a class="cart-line-product-quantity-down"
href="{$product.down_quantity_url}"
data-link-action="x-update-cart-quantity-down">{*Down*}</a>
{/if}
</div>
</div>
</div>
<div class="product-line-price">
<span class="product-price">
<strong>
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</span>
<span class="product-price">
<strong>
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</span>
</div>
<div class="product-line-delete">
<a class="remove-from-cart" rel="nofollow" href="{$product.remove_from_cart_url}" data-link-action="x-delete-from-cart" data-id-product="{$product.id_product|escape:'javascript':'UTF-8'}" data-id-product-attribute="{$product.id_product_attribute|escape:'javascript':'UTF-8'}" data-id-customization="{$product.id_customization|escape:'javascript':'UTF-8'}" title="{l s='Delete' d='Shop.Theme.Actions'}">
<a
class="remove-from-cart"
rel="nofollow"
href="{$product.remove_from_cart_url}"
data-link-action="x-delete-from-cart"
data-id-product="{$product.id_product|escape:'javascript':'UTF-8'}"
data-id-product-attribute="{$product.id_product_attribute|escape:'javascript':'UTF-8'}"
data-id-customization="{$product.id_customization|escape:'javascript':'UTF-8'}"
title="{l s='Delete' d='Shop.Theme.Actions'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<i class="material-icons delete-from-cart float-xs-left">delete</i>
<span class="non-material-icon delete-from-cart"></span>
@@ -178,4 +225,4 @@
{/block}
</div>
</div>
</div>

View File

@@ -31,15 +31,15 @@
<div class="card-block">
{foreach from=$cart.subtotals item="subtotal"}
{if isset($subtotal.value) && $subtotal.value && $subtotal.type !== 'tax'}
<div class="cart-summary-line{if $waitForShippingCls && 'products' != $subtotal.type}{$waitForShippingCls}{/if}{if !$subtotal.amount} free{/if}" id="cart-subtotal-{$subtotal.type}">
<div class="cart-summary-line{if $waitForShippingCls && 'products' != $subtotal.type}{$waitForShippingCls|escape:'javascript':'UTF-8'}{/if}{if !$subtotal.amount} free{/if}" id="cart-subtotal-{$subtotal.type|escape:'javascript':'UTF-8'}">
<span class="label{if 'products' === $subtotal.type} js-subtotal{/if}">
{if 'products' == $subtotal.type}
{$cart.summary_string}
{$cart.summary_string|escape:'htmlall':'UTF-8'}
{else}
{$subtotal.label}
{$subtotal.label|escape:'htmlall':'UTF-8'}
{/if}
</span>
<span class="value">{$subtotal.value}</span>
<span class="value">{$subtotal.value|escape:'htmlall':'UTF-8'}</span>
{if $subtotal.type === 'shipping'}
<div>
<small class="value">{hook h='displayCheckoutSubtotalDetails' subtotal=$subtotal}</small>
@@ -48,6 +48,7 @@
</div>
{/if}
{/foreach}
{hook h="displayPaymentRuleCartSummary"}
</div>
{block name='cart_voucher'}
@@ -59,34 +60,53 @@
<div class="card-block">
{if (isset($cart.subtotals.tax) && $cart.subtotals.tax.amount > 0) || (!$configuration.display_prices_tax_incl && $configuration.taxes_enabled) }
{* tax displayed in cart summary, we show Total (tax excl.), Tax and Total (tax incl.) *}
<div class="cart-summary-line cart-total-tax-excluded{$waitForShippingCls}">
<span class="label">{$cart.totals.total_excluding_tax.label}</span>
<span class="value">{$cart.totals.total_excluding_tax.value}</span>
<div class="cart-summary-line cart-total-tax-excluded{$waitForShippingCls|escape:'javascript':'UTF-8'}">
<span class="label">{$cart.totals.total_excluding_tax.label|escape:'htmlall':'UTF-8'}</span>
<span class="value">{$cart.totals.total_excluding_tax.value|escape:'htmlall':'UTF-8'}</span>
</div>
{if isset($cart.subtotals.tax)}
<div class="cart-summary-line cart-total-tax{$waitForShippingCls}">
<span class="label">{$cart.subtotals.tax.label}</span>
<span class="value">{$cart.subtotals.tax.value}</span>
<div class="cart-summary-line cart-total-tax{$waitForShippingCls|escape:'javascript':'UTF-8'}">
<div class="label" style="display: inline">{$cart.subtotals.tax.label|escape:'javascript':'UTF-8'}
{if $cart.totals.total_excluding_tax.amount > 0}
{math equation='(a/b)*100' a=$cart.subtotals.tax.amount b=$cart.totals.total_excluding_tax.amount assign='effective_tax_rate'}
{math equation='abs(round(a)-a)' a=$effective_tax_rate assign='rounding_delta'}
{if $rounding_delta < 0.09}
{math equation='round(a)' a=$effective_tax_rate assign='effective_tax_rate_rounded'}
{else}
{math equation='a' a=$effective_tax_rate assign='effective_tax_rate_rounded' format="%.1f"}
{/if}
<span class="effective-tax-rate">({$effective_tax_rate_rounded|escape:'javascript':'UTF-8'}%)</span>
{/if}
</div>
<span class="value">{$cart.subtotals.tax.value|escape:'javascript':'UTF-8'}</span>
</div>
{/if}
{* tax is set and non-zero cart summary, we show Total (tax incl.) *}
<div class="cart-summary-line cart-total cart-total-tax-included{$waitForShippingCls}">
<span class="label">{$cart.totals.total_including_tax.label}</span>
<span class="value">{$cart.totals.total_including_tax.value}</span>
<div class="cart-summary-line cart-total cart-total-tax-included{$waitForShippingCls|escape:'javascript':'UTF-8'}">
<span class="label">{$cart.totals.total_including_tax.label|escape:'htmlall':'UTF-8'}</span>
<span class="value">{$cart.totals.total_including_tax.value|escape:'htmlall':'UTF-8'}</span>
</div>
{else}
{* tax is zero or not used in cart summary, we show Total (tax_label) *}
<div class="cart-summary-line cart-total cart-total-auto-tax{$waitForShippingCls}">
<span class="label">{$cart.totals.total.label} {if isset($configuration) && $configuration.taxes_enabled}{$cart.labels.tax_short}{/if}</span>
<span class="value">{$cart.totals.total.value}</span>
<div class="cart-summary-line cart-total cart-total-auto-tax{$waitForShippingCls|escape:'javascript':'UTF-8'}">
<span class="label">{$cart.totals.total.label|escape:'htmlall':'UTF-8'}{if isset($configuration) && $configuration.taxes_enabled}<span class="tax-lbl"> {$cart.labels.tax_short|escape:'htmlall':'UTF-8'}</span>{/if}</span>
<span class="value">{$cart.totals.total.value|escape:'htmlall':'UTF-8'}</span>
</div>
{if isset($cart.subtotals.tax)}
<div class="cart-summary-line cart-total-tax{$waitForShippingCls}">
<span class="label">{$cart.subtotals.tax.label}</span>
<span class="value">{$cart.subtotals.tax.value}</span>
<div class="cart-summary-line cart-total-tax{$waitForShippingCls|escape:'javascript':'UTF-8'}">
<div class="label" style="display: inline">{$cart.subtotals.tax.label|escape:'javascript':'UTF-8'}
<span class="effective-tax-rate">(0%)</span>
</div>
<span class="value">{$cart.subtotals.tax.value|escape:'javascript':'UTF-8'}</span>
</div>
{/if}
{/if}
{if $cart.totals.total_excluding_tax.amount == $cart.totals.total.amount && $configuration.taxes_enabled}
<div style="display: none;" class="cart-summary-line vat-exempt">
<span class="label">{l s='Your order is now 0% VAT' mod='thecheckout'}</span>
</div>
{/if}
{assign var='ps_freeshipping_price' value=Configuration::get('PS_SHIPPING_FREE_PRICE')}
@@ -97,10 +117,10 @@
{math equation='a-b' a=$ps_freeshipping_price b=$total_without_shipping assign='remaining_to_spend'}
{math equation='(100*a)/b' a=$total_without_shipping b=$ps_freeshipping_price assign='completed_percentage'}
{if $remaining_to_spend > 0}
<div class="remaining-amount-to-free-shipping-container">
<div class="remaining-amount-to-free-shipping-container{if isset($cart.subtotals) && isset($cart.subtotals.shipping) && isset($cart.subtotals.shipping.amount) && $cart.subtotals.shipping.amount == 0} free{/if}">
<div class="remaining-amount-msg">{l s='Remaining amount to get free shipping: ' mod='thecheckout'} <span class="remaining-amount">{Tools::displayPrice($remaining_to_spend,$currency)}</span></div>
<div class="remaining-amount-progress">
<div class="inside-bar" style="width: {$completed_percentage}%"></div>
<div class="inside-bar" style="width: {$completed_percentage|escape:'javascript':'UTF-8'}%"></div>
</div>
</div>
{/if}

View File

@@ -22,7 +22,8 @@
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_detailed_product'}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
<!-- <div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}"> -->
<div class="cart-overview js-cart">
{if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}

View File

@@ -30,10 +30,10 @@
<ul class="promo-name card-block">
{foreach from=$cart.vouchers.added item=voucher}
<li class="cart-summary-line">
<span class="label">{$voucher.name}</span>
<a href="{$voucher.delete_url}" data-discount-id="{$voucher.id_cart_rule}" data-link-action="x-remove-voucher"><span class="icon-delete"></span></a>
<span class="label">{$voucher.name|escape:'htmlall':'UTF-8'}</span>
<a href="{$voucher.delete_url|escape:'javascript':'UTF-8'}" data-discount-id="{$voucher.id_cart_rule|escape:'javascript':'UTF-8'}" data-link-action="x-remove-voucher"><span class="icon-delete"></span></a>
<div class="float-xs-right">
{$voucher.reduction_formatted}
{$voucher.reduction_formatted|escape:'htmlall':'UTF-8'}
</div>
</li>
{/foreach}
@@ -41,20 +41,20 @@
{/block}
{/if}
<p class="{if $cart.discounts|count > 0}hidden{/if}">
<a class="collapse-button promo-code-button" data-bs-toggle="collapse" data-bs-target="#promo-code" data-toggle="collapse" href="#promo-code" aria-expanded="false" aria-controls="promo-code">
<p class="{if $cart.discounts|count > 0}hidden because-have-highlighted-discounts{/if}">
<a class="collapse-button promo-code-button collapsed" data-bs-toggle="collapse" data-bs-target="#promo-code" data-toggle="collapse" href="#promo-code" aria-expanded="false" aria-controls="promo-code">
{l s='Have a promo code?' d='Shop.Theme.Checkout'}
</a>
</p>
<div class="promo-code collapse{if $cart.discounts|count > 0} in{/if}" id="promo-code">
<div class="promo-code collapse{if $cart.discounts|count > 0} in show{/if}" id="promo-code">
{block name='cart_voucher_form'}
<form method="post">
<input type="hidden" name="token" value="{$static_token}">
<input type="hidden" name="token" value="{$static_token|escape:'javascript':'UTF-8'}">
<input type="hidden" name="addDiscount" value="1">
<div class="promo-input-button d-f">
<input class="promo-input" type="text" name="discount_name" placeholder="{l s='Promo code' d='Shop.Theme.Checkout'}">
<button data-link-action="x-add-voucher" type="submit" class="btn btn-primary"><span>Dodaj</span></button>
<button data-link-action="x-add-voucher" type="submit" class="btn btn-primary"><span>{l s='Add' d='Shop.Theme.Actions'}</span></button>
</div>
</form>
{/block}
@@ -73,7 +73,7 @@
<ul class="js-discount card-block promo-discounts">
{foreach from=$cart.discounts item=discount}
<li class="cart-summary-line">
<span class="label"><span class="code">{$discount.code}</span> - {$discount.name}</span>
<span class="label"><span class="code">{$discount.code|escape:'htmlall':'UTF-8'}</span> - {$discount.name|escape:'htmlall':'UTF-8'}</span>
</li>
{/foreach}
</ul>

View File

@@ -24,7 +24,7 @@
{if $field.type == 'hidden'}
{block name='form_field_item_hidden'}
<input type="hidden" class="orig-field" name="{$field.name}" value="{$field.value}">
<input type="hidden" class="orig-field" name="{$field.name|escape:'javascript':'UTF-8'}" value="{$field.value|escape:'javascript':'UTF-8'}">
{/block}
{else}
@@ -32,7 +32,7 @@
{assign var="passwordShallBeVisible" value=false} {* default value, which we may change below *}
{assign var="class" value="{if (true == $field.live)} live{/if}"}
{if $field.type === 'password' && isset($parentTplName) && $parentTplName === 'account'}
{assign var=show_create_account_checkbox value=$ps_config.PS_GUEST_CHECKOUT_ENABLED && $tc_config->create_account_checkbox && (!$customer.is_logged || $customer.is_guest)}
{assign var=show_create_account_checkbox value=$ps_config.PS_GUEST_CHECKOUT_ENABLED && $z_tc_config->create_account_checkbox && (!$customer.is_logged || $customer.is_guest)}
{if $show_create_account_checkbox}
{assign var="passwordShallBeVisible" value=(isset($opc_form_checkboxes['create-account']) && 'true' == $opc_form_checkboxes['create-account'])}
<div id="create_account" class="form-group checkbox">
@@ -57,21 +57,21 @@
{capture name="form_group_classes"}
form-group
{$field.name}
{$field.name|escape:'htmlall':'UTF-8'}
{if isset($checkoutSection) && ('invoice' === $checkoutSection || 'delivery' === $checkoutSection) && in_array($field.name, $businessFieldsList)}business-field{/if}
{if isset($checkoutSection) && ('invoice' === $checkoutSection || 'delivery' === $checkoutSection) && in_array($field.name, $privateFieldsList)}private-field{/if}
{if isset($checkoutSection) && ('invoice' === $checkoutSection || 'delivery' === $checkoutSection) && in_array($field.name, $businessDisabledFieldsList)}business-disabled-field{/if}
{$field.type}
{$field.type|escape:'htmlall':'UTF-8'}
{if (false == $field.visible) && !($field.type === 'password' && $passwordShallBeVisible)} hidden{/if}
{if !empty($field.errors)} has-error{/if}
{if $field.type === 'select' && empty($field.availableValues)} hidden{/if}
{if $field.name==='address1' && $field.value|strlen>3 && !'/\d+/'|preg_match:$field.value}missing-street-number{/if}
{if $field.css_class} {$field.css_class}{/if}
{if $field.name==='address1' && $field.value|strlen>3 && !preg_match('/\d+/',$field.value)}missing-street-number{/if}
{if $field.css_class} {$field.css_class|escape:'htmlall':'UTF-8'}{/if}
{/capture}
<div
class="{$smarty.capture.form_group_classes|strip|trim}"
style="flex-basis: {$field.width}%"
class="{$smarty.capture.form_group_classes|strip|trim|escape:'javascript':'UTF-8'}"
style="flex-basis: {$field.width|escape:'javascript':'UTF-8'}%"
>
{if $field.type === 'radio-buttons' || $field.type === 'checkbox' || $field.type === 'date' || $field.type === 'birthday'}
@@ -81,7 +81,7 @@
{/if}
<label class="{$effectType}{if $field.required && $field.css_class != 'need-dni'} required{/if}"
<label class="{$effectType|escape:'javascript':'UTF-8'}{if $field.required && $field.css_class != 'need-dni'} required{/if}"
{if $field.name==='address1'}data-missing-street-nr-notice="{l s='Missing street number?' mod='thecheckout'}"{/if}
>
@@ -89,11 +89,11 @@
{if $field.type === 'select'}
{block name='form_field_item_select'}
<select class="form-control orig-field form-control-select{$class}" name="{$field.name}"
<select class="form-control orig-field form-control-select{$class|escape:'javascript':'UTF-8'}" name="{$field.name|escape:'javascript':'UTF-8'}"
{if $field.required}required{/if}>
<option value disabled selected>{l s='-- please choose --' d='Shop.Forms.Labels'}</option>
{foreach from=$field.availableValues key="value" item="label"}
<option value="{$value}" {if $value eq $field.value} selected {/if}>{$label}</option>
<option value="{$value|escape:'javascript':'UTF-8'}" {if $value eq $field.value} selected {/if}>{$label|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
{/block}
@@ -102,20 +102,20 @@
{block name='form_field_item_country'}
<select
class="form-control orig-field form-control-select js-country{$class}"
name="{$field.name}"
class="form-control orig-field form-control-select js-country{$class|escape:'javascript':'UTF-8'}"
name="{$field.name|escape:'javascript':'UTF-8'}"
{if $field.required}required{/if}
>
<option value disabled selected>{l s='-- please choose --' d='Shop.Forms.Labels'}</option>
{foreach from=$field.availableValues key="option_value" item="label"}
{if is_array($label)}
{assign var="label_label" value=$label.label}
{assign var="option_data" value=$label.option_data}
{assign var="label_label" value=$label.label|escape:'javascript':'UTF-8'}
{assign var="option_data" value=$label.option_data|escape:'javascript':'UTF-8'}
{else}
{assign var="label_label" value=$label}
{assign var="option_data" value=""}
{/if}
<option {$option_data} value="{$option_value}" {if $option_value eq $field.value} selected {/if}>{$label_label}</option>
<option {$option_data|escape:'javascript':'UTF-8'} value="{$option_value|escape:'javascript':'UTF-8'}" {if $option_value eq $field.value} selected {/if}>{$label_label|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
{/block}
@@ -124,23 +124,23 @@
{block name='form_field_item_radio'}
<span class="field-label">
{$field.label}
{$field.label|escape:'htmlall':'UTF-8'}
</span>
<div class="available-values {$field.name}">
<div class="available-values {$field.name|escape:'javascript':'UTF-8'}">
{foreach from=$field.availableValues item="label" key="value"}
<label class="radio-inline">
<span class="custom-radio">
<input
name="{$field.name}"
name="{$field.name|escape:'javascript':'UTF-8'}"
type="radio"
value="{$value}"
value="{$value|escape:'javascript':'UTF-8'}"
class="orig-field"
{if $field.required}required{/if}
{if $value eq $field.value} checked {/if}
>
<span></span>
</span>
{$label}
{$label|escape:'htmlall':'UTF-8'}
</label>
{/foreach}
</div>
@@ -150,7 +150,7 @@
{block name='form_field_item_checkbox'}
<span class="custom-checkbox">
<input class="orig-field" name="{$field.name}" type="checkbox" value="1"
<input class="orig-field" name="{$field.name|escape:'javascript':'UTF-8'}" type="checkbox" value="1"
{if $field.value}checked="checked"{/if} {if $field.required}required{/if}>
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
{*
@@ -164,11 +164,11 @@
{elseif $field.type === 'date'}
{block name='form_field_item_date'}
<input name="{$field.name}" class="form-control orig-field" type="date" value="{$field.value}"
placeholder="{if isset($field.availableValues.placeholder)}{$field.availableValues.placeholder}{/if}">
<input name="{$field.name|escape:'javascript':'UTF-8'}" class="form-control orig-field" type="date" value="{$field.value|escape:'javascript':'UTF-8'}"
placeholder="{if isset($field.availableValues.placeholder)}{$field.availableValues.placeholder|escape:'javascript':'UTF-8'}{/if}">
{if isset($field.availableValues.comment)}
<span class="form-control-comment">
{$field.availableValues.comment}
{$field.availableValues.comment|escape:'htmlall':'UTF-8'}
</span>
{/if}
{/block}
@@ -176,11 +176,11 @@
{elseif $field.type === 'birthday'}
{block name='form_field_item_birthday'}
<div class="js-parent-focus">
{$field.label}
{$field.label|escape:'htmlall':'UTF-8'}
{html_select_date
field_order=DMY
time={$field.value}
field_array={$field.name}
time={$field.value|escape:'javascript':'UTF-8'}
field_array={$field.name|escape:'javascript':'UTF-8'}
prefix=false
reverse_years=true
field_separator='<br>'
@@ -200,7 +200,7 @@
{block name='form_field_item_password'}
<input
class="form-control orig-field"
name="{$field.name}"
name="{$field.name|escape:'javascript':'UTF-8'}"
type="password"
value=""
pattern=".{literal}{{/literal}5,{literal}}{/literal}"
@@ -213,7 +213,7 @@
{else} {* standard text inputs *}
{if $field.name === 'birthday' && isset($field.availableValues.placeholder)}
{assign var='placeholder' value="{$field.availableValues.placeholder}" }
{assign var='placeholder' value="{$field.availableValues.placeholder|escape:'javascript':'UTF-8'}" }
{else}
{assign 'placeholder' ' '}
{/if}
@@ -229,27 +229,27 @@
{* Remove call prefix from phone number - for display purposes, if prefix is shown separately *}
{* Part 1 *}
{if $tc_config->show_call_prefix && ($field.name === 'phone' || $field.name === 'phone_mobile')}
{if $z_tc_config->show_call_prefix && ($field.name === 'phone' || $field.name === 'phone_mobile')}
{assign 'callPrefix' '+'|cat:$field.custom_data['call_prefix']}
{$field.value = $field.value|replace:{$callPrefix}:''}
{$field.value = $field.value|replace:{$callPrefix|escape:'javascript':'UTF-8'}:''}
{/if}
{block name='form_field_item_other'}
<input
class="form-control orig-field{$class}"
name="{$field.name}"
type="{$field.type}"
value="{$field.value}"
placeholder="{$placeholder}"
{if $field.autoCompleteAttribute}autocomplete="{$field.autoCompleteAttribute}"{/if}
{if $field.maxLength}maxlength="{$field.maxLength}"{/if}
name="{$field.name|escape:'javascript':'UTF-8'}"
type="{$field.type|escape:'javascript':'UTF-8'}"
value="{$field.value|escape:'htmlall':'UTF-8'}"
placeholder="{$placeholder|escape:'javascript':'UTF-8'}"
{if $field.autoCompleteAttribute}autocomplete="{$field.autoCompleteAttribute|escape:'javascript':'UTF-8'}"{/if}
{if $field.maxLength}maxlength="{$field.maxLength|escape:'javascript':'UTF-8'}"{/if}
{if $field.required}required{/if}
>
{/block}
{* Part 2, displayed after input field, due to 'modern' theme, which uses placeholder shown CSS selectors *}
{if $tc_config->show_call_prefix && ($field.name === 'phone' || $field.name === 'phone_mobile')}
<span class="country-call-prefix">{$callPrefix}</span>
{if $z_tc_config->show_call_prefix && ($field.name === 'phone' || $field.name === 'phone_mobile')}
<span class="country-call-prefix">{$callPrefix|escape:'htmlall':'UTF-8'}</span>
{/if}
{/if}
@@ -259,7 +259,7 @@
{if $field.type !== 'checkbox' && $field.type !== 'radio-buttons' && $field.type !== 'birthday'}
<span class="field-label"{if !$field.required} data-optional-label="{l s='(optional)' mod='thecheckout'}"{/if}>
{$field.label}
{$field.label|escape:'htmlall':'UTF-8'}
</span>
{/if}

View File

@@ -14,33 +14,34 @@
{assign var='addressesCombobox' value=$addressesList.delivery}
{/if}
{*otherwise, addressCombobox won't be set and we won't continue*}
{if isset($addressesCombobox) && $addressesCombobox|@count > 0}
{assign var='hideAddressesSelection' value=($addressesCombobox|@count == 1 &&
(("invoice" == $addressType && $idAddressInvoice|array_key_exists:$addressesCombobox)
|| ("delivery" == $addressType && $idAddressDelivery|array_key_exists:$addressesCombobox)))}
(("invoice" == $addressType && array_key_exists($idAddressInvoice, $addressesCombobox))
|| ("delivery" == $addressType && array_key_exists($idAddressDelivery, $addressesCombobox))))}
<div class="customer-addresses{if $addressesCombobox|@count == 1} hidden-1{/if}">
{if $hideAddressesSelection}
<a class="custom-link" data-link-action="x-add-new-address">{l s='Add a new address' d='Shop.Theme.Actions'}</a>
{/if}
<div class="addresses-selection{if $hideAddressesSelection} hidden{/if}">
<span class="saved-addresses-label">{l s='Saved addresses:' mod='thecheckout'}</span>
<select class="not-extra-field" data-link-action="x-{$addressType}-addresses">
<select class="not-extra-field" data-link-action="x-{$addressType|escape:'javascript':'UTF-8'}-addresses">
{* <option value="-1">{l s='New' d='Shop.Theme.Catalog'}{l s='...' mod='thecheckout'}</option>*}
<option value="-1">{l s='Add a new address' d='Shop.Theme.Actions'}</option>
{foreach $addressesCombobox as $address}
<option value="{$address.id}"
<option value="{$address.id|escape:'javascript':'UTF-8'}"
{if "invoice" == $addressType}
{if $address.id == $idAddressInvoice && ($isInvoiceAddressPrimary || $idAddressInvoice != $idAddressDelivery )} selected{/if}
{if $address.id == $lastOrderInvoiceAddressId && $address.id != $idAddressDelivery && (!$isInvoiceAddressPrimary && $idAddressInvoice == $idAddressDelivery )} selected{/if}
{if $address.id == $idAddressDelivery && $idAddressInvoice != $idAddressDelivery} disabled{/if}
{* {if $address.id == $idAddressDelivery && $idAddressInvoice != $idAddressDelivery} disabled{/if}*}
{if $address.id == $idAddressDelivery} disabled{/if}
{else}
{if $address.id == $idAddressDelivery && (!$isInvoiceAddressPrimary || $idAddressInvoice != $idAddressDelivery )} selected{/if}
{if $address.id == $lastOrderDeliveryAddressId && $address.id != $idAddressInvoice && ($isInvoiceAddressPrimary && $idAddressInvoice == $idAddressDelivery )} selected{/if}
{if $address.id == $idAddressInvoice && $idAddressInvoice != $idAddressDelivery} disabled{/if}
{* {if $address.id == $idAddressInvoice && $idAddressInvoice != $idAddressDelivery} disabled{/if}*}
{if $address.id == $idAddressInvoice} disabled{/if}
{/if}
>{$address.alias}</option>
>{$address.alias|escape:'htmlall':'UTF-8'}{* /id-this:{$address.id}-idInv:{$idAddressInvoice}-idDlv:{$idAddressDelivery}*}</option>
{/foreach}
<option value="-1">{l s='Add a new address' d='Shop.Theme.Actions'}</option>
</select>
</div>
</div>

View File

@@ -10,24 +10,45 @@
{literal}
<script async
src="https://maps.googleapis.com/maps/api/js?key={/literal}{$tc_config->google_maps_api_key}{literal}&libraries=places&callback=googlePlacesScriptLoadCallback">
src="https://maps.googleapis.com/maps/api/js?key={/literal}{$z_tc_config->google_maps_api_key|escape:'javascript':'UTF-8'}{literal}&libraries=places&loading=async&callback=googlePlacesScriptLoadCallbackOnce">
</script>
<script>
function tc_reInitGooglePlaces() {
googlePlacesScriptLoadCallback();
}
var tc_autocomplete = {}
var debug_google_places = 0;
function googlePlacesScriptLoadCallback() {
if (debug_google_places == 1) {
console.log('googlePlacesScriptLoadCallback');
<script>
function googlePlacesScriptLoadCallbackOnce() {
if (typeof googlePlacesScriptLoadCallbackOnce.called === 'undefined') {
googlePlacesScriptLoadCallbackOnce.called = true;
googlePlacesScriptLoadCallback();
}
}
addEventListener('DOMContentLoaded', (event) => {
function tc_reInitGooglePlaces() {
googlePlacesScriptLoadCallback();
}
function isAddressController() {
return document.querySelector('body#address') !== null;
}
var tc_autocomplete = {}
var debug_google_places = 0;
var isoCodes = [];
try {
if (typeof tc_countriesIsoCodes !== 'undefined' && tc_countriesIsoCodes.length) {
isoCodes = JSON.parse(tc_countriesIsoCodes);
}
} catch (e) {
console.warn('Countries ISO codes parsing failed!');
}
function googlePlacesScriptLoadCallback() {
if (debug_google_places == 1) {
console.log('googlePlacesScriptLoadCallback');
}
// addEventListener('DOMContentLoaded', (event) => {
/* global google */
if (google) {
for (const tc_addr_type of ['invoice', 'delivery']) {
// console.log('Attempt to bind ' + tc_addr_type, document.querySelector(`[data-address-type=${tc_addr_type}] [name=address1]`))
tc_autocomplete[tc_addr_type] = new google.maps.places.Autocomplete(document.querySelector(`[data-address-type=${tc_addr_type}] [name=address1]`), {
if (isAddressController()) {
// When included for Prestashop's address edit controller
tc_autocomplete['address'] = new google.maps.places.Autocomplete(document.querySelector(`[name=address1]`), {
fields: ['address_components'],
strictBounds: false,
types: ['address'],
@@ -35,80 +56,182 @@
// TODO: what about US states?
// componentRestrictions: { country: ['sk'] },
});
tc_autocomplete[tc_addr_type].addListener('place_changed', () => googlePlaceChanged(tc_addr_type, tc_autocomplete[tc_addr_type].getPlace()));
tc_autocomplete['address'].addListener('place_changed', () => googlePlaceChanged('address', tc_autocomplete['address'].getPlace()));
const initialIso = $(`[data-address-type=${tc_addr_type}] [name=id_country]`).children('option').filter(':selected').attr('data-iso-code');
tc_autocomplete[tc_addr_type].setComponentRestrictions({'country': initialIso});
$('body').off('googlePlacesScriptLoadCallback').on('change.componentRestrictions', `[data-address-type=${tc_addr_type}] [name=id_country]`, function() {
console.log('Google places, change.componentRestrictions change listener called');
if (tc_autocomplete && tc_autocomplete[tc_addr_type]) {
const iso = $(this).children('option').filter(':selected').attr('data-iso-code');
if (debug_google_places == 1) {
console.log(`setting '${iso}' as component/country restriction`)
}
tc_autocomplete[tc_addr_type].setComponentRestrictions({'country': iso});
// jQuery version
// const idCountry = $(`[name=id_country]`).val();
// Vanilla JS version
const idCountry = document.querySelector(`[name=id_country]`).value;
const matchingCountry = isoCodes.find(x => x.id_country == idCountry);
if (typeof matchingCountry !== undefined && matchingCountry !== null) {
const initialIso = matchingCountry?.iso_code;
tc_autocomplete['address'].setComponentRestrictions({'country': initialIso});
}
if (typeof prestashop?.on === 'function') {
prestashop.on('updatedAddressForm', function () {
tc_reInitGooglePlaces();
})
}
} else {
// When included for TheCheckout module
for (const tc_addr_type of ['invoice', 'delivery']) {
// console.log('Attempt to bind ' + tc_addr_type, document.querySelector(`[data-address-type=${tc_addr_type}] [name=address1]`))
tc_autocomplete[tc_addr_type] = new google.maps.places.Autocomplete(document.querySelector(`[data-address-type=${tc_addr_type}] [name=address1]`), {
fields: ['address_components'],
strictBounds: false,
types: ['address'],
// TODO: component restriction based on selected country
// TODO: what about US states?
// componentRestrictions: { country: ['sk'] },
});
tc_autocomplete[tc_addr_type].addListener('place_changed', () => googlePlaceChanged(tc_addr_type, tc_autocomplete[tc_addr_type].getPlace()));
// jQuery version
// const initialIso = $(`[data-address-type=${tc_addr_type}] [name=id_country]`).children('option').filter(':selected').attr('data-iso-code');
// Vanilla JS version
const initialIso = document.querySelector(`[data-address-type=${tc_addr_type}] [name=id_country] option:checked`)?.dataset?.isoCode
if (initialIso !== undefined && initialIso !== null) {
tc_autocomplete[tc_addr_type].setComponentRestrictions({'country': initialIso});
}
});
// jQuery version
// $('body').off('googlePlacesScriptLoadCallback').on('change.componentRestrictions', `[data-address-type=${tc_addr_type}] [name=id_country]`, function() {
// // console.log('Google places, change.componentRestrictions change listener called');
// if (tc_autocomplete && tc_autocomplete[tc_addr_type]) {
// const iso = $(this).children('option').filter(':selected').attr('data-iso-code');
// if (debug_google_places == 1) {
// console.log(`setting '${iso}' as component/country restriction`)
// }
// tc_autocomplete[tc_addr_type].setComponentRestrictions({'country': iso});
// }
// });
// Vanilla JS version
document.body.addEventListener('change', function(event) {
if (event.target.matches(`[data-address-type=${tc_addr_type}] [name=id_country]`)) {
if (tc_autocomplete && tc_autocomplete[tc_addr_type]) {
const iso = event.target.querySelector('option:checked')?.dataset?.isoCode;
if (debug_google_places == 1) {
console.log(`setting '${iso}' as component/country restriction (vanilla JS)`)
}
tc_autocomplete[tc_addr_type].setComponentRestrictions({'country': iso});
}
}
});
}
}
}
});
}
// });
}
function googlePlaceChanged(addressType, place) {
if (place.address_components) {
if (debug_google_places == 1) {
console.log(addressType, place);
}
const placeDetails = place.address_components.reduce((acc, x) => ({...acc, [x.types[0]]: x.long_name}), {});
if (debug_google_places == 1) {
console.log('Place details: ', placeDetails);
}
function googlePlaceChanged(addressType, place) {
if (place.address_components) {
if (debug_google_places == 1) {
console.log(addressType, place);
}
const placeDetails = place.address_components.reduce((acc, x) => ({...acc, [x.types[0]]: x.long_name}), {});
if (debug_google_places == 1) {
console.log('Place details: ', placeDetails);
}
const streetNumberFirst = ['US', 'GB', 'AU'].includes(tc_autocomplete[addressType]?.componentRestrictions?.country);
const streetNumberFirst = ['US', 'GB', 'AU'].includes(tc_autocomplete[addressType]?.componentRestrictions?.country);
const stateFromAdministrativeArea2 = ['IT'].includes(tc_autocomplete[addressType]?.componentRestrictions?.country);
const tc_place_address = {};
if (streetNumberFirst) {
tc_place_address.street = `${placeDetails?.street_number || ''} ${placeDetails?.route || ''}`;
} else {
tc_place_address.street = `${placeDetails?.route || ''} ${placeDetails?.street_number || ''}`;
}
tc_place_address.city = placeDetails?.locality || placeDetails?.sublocality_level_1 || '';
tc_place_address.postcode = placeDetails?.postal_code || '';
tc_place_address.state = placeDetails?.administrative_area_level_1 || '';
const tc_place_address = {};
if (streetNumberFirst) {
tc_place_address.street = `${placeDetails?.street_number || placeDetails?.premise || ''} ${placeDetails?.route || ''}`;
} else {
tc_place_address.street = `${placeDetails?.route || placeDetails?.locality} ${placeDetails?.street_number || placeDetails?.premise || ''}`;
}
//
// if (streetNumberFirst) {
// tc_place_address.street = `${placeDetails?.street_number || ''} ${placeDetails?.route || ''}`;
// } else {
// tc_place_address.street = `${placeDetails?.route || ''} ${placeDetails?.street_number || ''}`;
// }
tc_place_address.city = placeDetails?.locality || placeDetails?.sublocality_level_1 || '';
tc_place_address.postcode = placeDetails?.postal_code || '';
if (debug_google_places == 1) {
console.log(tc_place_address);
}
if (stateFromAdministrativeArea2) {
var provincia = placeDetails?.administrative_area_level_2 || placeDetails?.administrative_area_level_1 || '';
tc_place_address.state = provincia.replace(/^.*? di /, '');
} else {
tc_place_address.state = placeDetails?.administrative_area_level_1 || '';
}
var mapPlacePropsToFields = {
address1: 'street',
city: 'city',
postcode: 'postcode',
id_state: 'state'
}
if (debug_google_places == 1) {
console.log(tc_place_address);
}
var el;
var stateEl;
for (const [fieldName, propName] of Object.entries(mapPlacePropsToFields)) {
el = $(`[data-address-type=${addressType}] [name=${fieldName}]`);
if (tc_place_address && tc_place_address[propName]) {
if (propName === 'state') {
stateEl = el.find('option').filter(function() {
return $.trim($(this).text()).toLowerCase() === (tc_place_address[propName] || '').toLowerCase();
});
if (stateEl && stateEl.length) {
stateEl.attr('selected', true).trigger('change');
}
var mapPlacePropsToFields = {
address1: 'street',
city: 'city',
postcode: 'postcode',
id_state: 'state'
}
var el;
var stateEl;
for (const [fieldName, propName] of Object.entries(mapPlacePropsToFields)) {
// jQuery version
// if (isAddressController()) {
// el = $(`[name=${fieldName}]`);
// } else {
// el = $(`[data-address-type=${addressType}] [name=${fieldName}]`);
// }
// if (tc_place_address && tc_place_address[propName]) {
// if (propName === 'state') {
// stateEl = el.find('option').filter(function() {
// return $.trim($(this).text()).toLowerCase().replace(/[^a-z]/g,'') === (tc_place_address[propName] || '').toLowerCase().replace(/[^a-z]/g,'');
// });
// if (stateEl && stateEl.length) {
// stateEl.attr('selected', true).trigger('change');
// }
// } else {
// el.val(tc_place_address[propName] || '');
// setTimeout(function (thisEl) {
// // console.log('el.val', thisEl.val())
// thisEl.change();
// }, 100, el);
// }
// }
// Vanilla JS version
if (isAddressController()) {
el = document.querySelector(`[name=${fieldName}]`);
} else {
el.val(tc_place_address[propName] || '');
setTimeout(function (thisEl) {
// console.log('el.val', thisEl.val())
thisEl.change();
}, 100, el);
el = document.querySelector(`[data-address-type=${addressType}] [name=${fieldName}]`);
}
if (tc_place_address && tc_place_address[propName] && el) {
if (propName === 'state') {
stateEl = el.querySelector('option:checked');
stateEl = Array.from(el.querySelectorAll('option')).filter(x =>
x.innerText.trim().toLowerCase().replace(/[^a-z]/g, '') === (tc_place_address[propName] || '').toLowerCase().replace(/[^a-z]/g, ''));
if (stateEl && stateEl.length) {
stateEl[0].selected = true;
stateEl[0].dispatchEvent(new Event('change'));
}
} else {
el.value = tc_place_address[propName] || '';
setTimeout(function (thisEl) {
// console.log('el.val', thisEl.val())
// Prefer jquery call so that attached event handlers are properly executed
if (typeof $ === 'function' && typeof $(thisEl) !== 'undefined' && typeof $(thisEl).change === 'function') {
$(thisEl).change();
} else {
thisEl.dispatchEvent(new Event('change'));
}
}, 100, el);
}
}
}
}
}
}
</script>
{/literal}
</script>
{/literal}

View File

@@ -10,7 +10,7 @@
<div id="payment-confirmation">
<div class="ps-shown-by-js">
<button type="submit" class="btn btn-primary center-block">
{l s='Pay' mod='thecheckout'} <span class="pay-amount">{$cart.totals.total_including_tax.value}</span>
{l s='Pay' mod='thecheckout'} <span class="pay-amount">{$cart.totals.total_including_tax.value|escape:'htmlall':'UTF-8'}</span>
</button>
</div>
</div>

View File

@@ -7,9 +7,9 @@
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*}
{assign secure_url $secure_protocol|cat:'/'|cat:'/'|cat:$tc_config->author}
{assign product_path $tc_config->trial_tld|cat:$tc_config->trial_lang|cat:$tc_config->trial_prod_id|cat:$tc_config->trial_prod_name}
{assign secure_url $secure_protocol|cat:'/'|cat:'/'|cat:$z_tc_config->author}
{assign product_path $z_tc_config->trial_tld|cat:$z_tc_config->trial_lang|cat:$z_tc_config->trial_prod_id|cat:$z_tc_config->trial_prod_name}
<div id="tc_secure_notice" style="display:none;"> {*Visible only in trial mode, otherwise hidden*}
<a href="{$secure_url}.{$tc_config->trial_tld}"
target="_blank"{if 0==$url_len%4} rel="nofollow"{/if}>{if 0==$url_len%7}{$secure_url}.{$tc_config->trial_tld}{elseif 0==$url_len%2}{$tc_config->author|capitalize}{else}{$tc_config->author}.{$tc_config->trial_tld}{/if}</a>
<a href="{$secure_url|escape:'javascript':'UTF-8'}.{$z_tc_config->trial_tld|escape:'javascript':'UTF-8'}"
target="_blank"{if 0==$url_len%4} rel="nofollow"{/if}>{if 0==$url_len%7}{$secure_url|escape:'javascript':'UTF-8'}.{$z_tc_config->trial_tld|escape:'javascript':'UTF-8'}{elseif 0==$url_len%2}{$z_tc_config->author|capitalize|escape:'javascript':'UTF-8'}{else}{$z_tc_config->author|escape:'javascript':'UTF-8'}.{$z_tc_config->trial_tld|escape:'javascript':'UTF-8'}{/if}</a>
</div>

View File

@@ -9,15 +9,15 @@
*}
<style>
/* BEGIN Custom CSS styles from config page */
{$tc_config->custom_css nofilter}
{$z_tc_config->custom_css nofilter}
/* END Custom CSS styles from config page */
</style>
<script>
/* BEGIN Custom JS code from config page */
{$tc_config->custom_js nofilter}
{$z_tc_config->custom_js nofilter}
/* END Custom JS code from config page */
var amazon_ongoing_session = ("{$amazon_ongoing_session}" == "1");
var amazon_ongoing_session = ("{$amazon_ongoing_session|escape:'javascript':'UTF-8'}" == "1");
</script>
<div style="display: none;">
{* Inner container will be taken out by JS in separate-payment.js *}
@@ -25,7 +25,7 @@
<div class="customer-block-container">
<div id="customer-block">
{$customer.firstname} {$customer.lastname} - {$customer.email}
{$customer.firstname|escape:'htmlall':'UTF-8'} {$customer.lastname|escape:'htmlall':'UTF-8'} - {$customer.email|escape:'htmlall':'UTF-8'}
</div>
</div>
@@ -46,22 +46,24 @@
<div id="shipping-method">
<span class="shipping-method-header">{l s='Shipping Method' d='Shop.Theme.Checkout'}</span>
{if $shipping_logo}
<img src="{$shipping_logo}" />
<img src="{$shipping_logo|escape:'javascript':'UTF-8'}" />
{/if}
{$shipping_method->name} - {$shipping_method->delay[$language.id]}
{$shipping_method->name|escape:'htmlall':'UTF-8'} - {$shipping_method->delay[$language.id]|escape:'htmlall':'UTF-8'}
</div>
{if $delivery_message}
<div id="delivery-message">
<span class="delivery-message-header">{l s='Message' d='Shop.Forms.Labels'}</span>
{$delivery_message}
{$delivery_message|escape:'htmlall':'UTF-8'}
</div>
{/if}
</div>
<div id="edit-button-block">
<button id="x-checkout-edit" data-href="{$urls.pages.order}" class="btn btn-primary">{l s='Edit' d='Shop.Theme.Actions'}</button>
<button id="x-checkout-edit" data-href="{$urls.pages.order|escape:'javascript':'UTF-8'}" class="btn btn-primary">{l s='Edit' d='Shop.Theme.Actions'}</button>
</div>
<div class="layout-right html_box_4" style="display: none;">
{$z_tc_config->html_box_4 nofilter}
</div>
</section>
</div>

View File

@@ -13,7 +13,7 @@
function tc_fbAsyncInit() {
window.fbAsyncInit = function () {
FB.init({
appId: '{/literal}{$tc_config->social_login_fb_app_id}{literal}',
appId: '{/literal}{$z_tc_config->social_login_fb_app_id|escape:'javascript':'UTF-8'}{literal}',
cookie: true,
xfbml: true,
oauth: true,
@@ -28,7 +28,7 @@
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/{/literal}{$iso}{literal}/sdk.js";
js.src = "https://connect.facebook.net/{/literal}{$iso|escape:'javascript':'UTF-8'}{literal}/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}
@@ -39,6 +39,7 @@
// window.addEventListener('DOMContentLoaded', tc_fbAsyncInit);
// }
window.addEventListener('DOMContentLoaded', tc_fbAsyncInit);
// $(document).ready(tc_fbAsyncInit);
</script>
{/literal}

View File

@@ -15,7 +15,7 @@
var attemptsLeft = 15;
function tc_initGoogleWithDelay() {
if ('undefined' !== typeof tc_googleLogin) {
tc_googleLogin.init('{/literal}{$tc_config->social_login_google_client_id}{literal}');
tc_googleLogin.init('{/literal}{$z_tc_config->social_login_google_client_id|escape:'javascript':'UTF-8'}{literal}');
} else if (attemptsLeft-- > 0) {
// console.log('attempt: ' + (15-attemptsLeft));
setTimeout(tc_initGoogleWithDelay, 300);

View File

@@ -9,10 +9,10 @@
*}
<div id="static-customer-info-container">
{if !$s_customer.is_guest && $s_customer.is_logged}
<a class="edit-customer-info" href="{$urls.pages.identity}">
<a class="edit-customer-info" href="{$urls.pages.identity|escape:'javascript':'UTF-8'}">
<div class="static-customer-info" data-edit-label="{l s='Edit' d='Shop.Theme.Actions'}">
<div class="customer-name">{$s_customer.firstname} {$s_customer.lastname}</div>
<div class="customer-email">{$s_customer.email}</div>
<div class="customer-name">{$s_customer.firstname|escape:'htmlall':'UTF-8'} {$s_customer.lastname|escape:'htmlall':'UTF-8'}</div>
<div class="customer-email">{$s_customer.email|escape:'htmlall':'UTF-8'}</div>
</div>
</a>
{/if}

View File

@@ -9,16 +9,17 @@
*}
<div class="block-header account-header">
{l s='Personal Information' d='Shop.Theme.Checkout'}
{if isset($customer) && ($customer.is_logged && !$customer.is_guest)}{l s='Personal Information' d='Shop.Theme.Checkout'}
{else}{l s='Create an account' mod='thecheckout'}{/if}
</div>
<div class="inner-wrapper">
{if $tc_config->move_login_to_account && !($customer.is_logged && !$customer.is_guest)}
{if $z_tc_config->move_login_to_account && !($customer.is_logged && !$customer.is_guest)}
<div class="login-block-moved">
{include file='module:thecheckout/views/templates/front/blocks/login-form.tpl'}
</div>
{/if}
<div id="hook_displayPersonalInformationTop">{$hook_displayPersonalInformationTop nofilter}</div>
<form class="account-fields">
<div id="hook_displayPersonalInformationTop">{$hook_displayPersonalInformationTop nofilter}</div>
{block name="account_form_fields"}
<section class="form-fields">
{block name='form_fields'}
@@ -34,7 +35,7 @@
</section>
{/block}
</form>
{if $tc_config->show_button_save_personal_info}
{if $z_tc_config->show_button_save_personal_info}
<button id="tc_save_account" class="btn btn-primary">{l s='Save Personal Information' mod='thecheckout'}</button>
{/if}
</div>
</div>

View File

@@ -7,7 +7,7 @@
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*}
{if $tc_config->show_i_am_business_delivery}
{if $z_tc_config->show_i_am_business_delivery}
<style>
{if $hideBusinessFieldsDelivery}
{literal}
@@ -29,7 +29,7 @@
{/if}
</style>
{/if}
{if $tc_config->show_i_am_private_delivery}
{if $z_tc_config->show_i_am_private_delivery}
<style>
{if $hidePrivateFieldsDelivery}
{literal}
@@ -52,24 +52,28 @@
<div class="inner-wrapper">
<a style="display: none;" href="javascript:void(0);" class="amazonpay-change-address">{l s='Change address' mod='thecheckout'}</a>
{if $tc_config->show_i_am_business_delivery}
<div class="business-customer">
<span class="custom-checkbox">
<input id="i_am_business_delivery" type="checkbox" data-link-action="x-i-am-business-delivery"
{if !$hideBusinessFieldsDelivery}checked="checked"{/if} disabled="disabled">
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
<label for="i_am_business_delivery">{l s='I am a business customer' mod='thecheckout'}</label>
</span>
</div>
{/if}
{if $tc_config->show_i_am_private_delivery}
<div class="private-customer">
<span class="custom-checkbox">
<input id="i_am_private_delivery" type="checkbox" data-link-action="x-i-am-private-delivery"
{if !$hidePrivateFieldsDelivery}checked="checked"{/if} disabled="disabled">
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
<label for="i_am_private_delivery">{l s='I am a private customer' mod='thecheckout'}</label>
</span>
{if $z_tc_config->show_i_am_business || $z_tc_config->show_i_am_private}
<div class="business-private-checkboxes form-group">
{if $z_tc_config->show_i_am_business_delivery}
<div class="business-customer">
<span class="custom-checkbox">
<input id="i_am_business_delivery" type="checkbox" data-link-action="x-i-am-business-delivery"
{if !$hideBusinessFieldsDelivery}checked="checked"{/if} disabled="disabled">
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
<label for="i_am_business_delivery">{l s='I am a business customer' mod='thecheckout'}</label>
</span>
</div>
{/if}
{if $z_tc_config->show_i_am_private_delivery}
<div class="private-customer">
<span class="custom-checkbox">
<input id="i_am_private_delivery" type="checkbox" data-link-action="x-i-am-private-delivery"
{if !$hidePrivateFieldsDelivery}checked="checked"{/if} disabled="disabled">
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
<label for="i_am_private_delivery">{l s='I am a private customer' mod='thecheckout'}</label>
</span>
</div>
{/if}
</div>
{/if}
@@ -78,10 +82,10 @@
{block name="address_delivery_form_fields"}
<section class="form-fields">
{block name='form_fields'}
{if $tc_config->show_i_am_business_delivery}
{if $z_tc_config->show_i_am_business_delivery}
<div class="business-fields-container"><div class="business-fields-separator"></div></div>
{/if}
{if $tc_config->show_i_am_private_delivery}
{if $z_tc_config->show_i_am_private_delivery}
<div class="private-fields-container"><div class="private-fields-separator"></div></div>
{/if}
{foreach from=$formFieldsDelivery item="field"}

View File

@@ -8,7 +8,7 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*}
{if $tc_config->show_i_am_business}
{if $z_tc_config->show_i_am_business}
<style>
{if $hideBusinessFields}
{literal}
@@ -30,7 +30,7 @@
{/if}
</style>
{/if}
{if $tc_config->show_i_am_private}
{if $z_tc_config->show_i_am_private}
<style>
{if $hidePrivateFields}
{literal}
@@ -51,25 +51,29 @@
{/if}
<div class="block-header address-name-header">{l s='Billing address' mod='thecheckout'}</div>
<div class="inner-wrapper">
{if $tc_config->show_i_am_business}
<div class="business-customer">
<span class="custom-checkbox">
<input id="i_am_business" type="checkbox" data-link-action="x-i-am-business"
{if !$hideBusinessFields}checked="checked"{/if} disabled="disabled">
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
<label for="i_am_business">{l s='I am a business customer' mod='thecheckout'}</label>
</span>
</div>
{/if}
{if $tc_config->show_i_am_private}
<div class="private-customer">
<span class="custom-checkbox">
<input id="i_am_private" type="checkbox" data-link-action="x-i-am-private"
{if !$hidePrivateFields}checked="checked"{/if} disabled="disabled">
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
<label for="i_am_private">{l s='I am a private customer' mod='thecheckout'}</label>
</span>
</div>
{if $z_tc_config->show_i_am_business || $z_tc_config->show_i_am_private}
<div class="business-private-checkboxes form-group">
{if $z_tc_config->show_i_am_business}
<div class="business-customer">
<span class="custom-checkbox">
<input id="i_am_business" type="checkbox" data-link-action="x-i-am-business"
{if !$hideBusinessFields}checked="checked"{/if} disabled="disabled">
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
<label for="i_am_business">{l s='I am a business customer' mod='thecheckout'}</label>
</span>
</div>
{/if}
{if $z_tc_config->show_i_am_private}
<div class="private-customer">
<span class="custom-checkbox">
<input id="i_am_private" type="checkbox" data-link-action="x-i-am-private"
{if !$hidePrivateFields}checked="checked"{/if} disabled="disabled">
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
<label for="i_am_private">{l s='I am a private customer' mod='thecheckout'}</label>
</span>
</div>
{/if}
</div>
{/if}
<form class="address-fields" data-address-type="invoice" id="invoice-address">
@@ -77,10 +81,10 @@
{block name="address_invoice_form_fields"}
<section class="form-fields">
{block name='form_fields'}
{if $tc_config->show_i_am_business}
{if $z_tc_config->show_i_am_business}
<div class="business-fields-container"><div class="business-fields-separator"></div></div>
{/if}
{if $tc_config->show_i_am_private}
{if $z_tc_config->show_i_am_private}
<div class="private-fields-container"><div class="private-fields-separator"></div></div>
{/if}
{foreach from=$formFieldsInvoice item="field"}

View File

@@ -11,11 +11,11 @@
{if isset($js_custom_vars) && $js_custom_vars|@count}
<script type="text/javascript">
{foreach from=$js_custom_vars key=var_name item=var_value}
if ('object' === typeof {$var_name}{literal}) {
if ('object' === typeof {$var_name|escape:'javascript':'UTF-8'}{literal}) {
{/literal}
jQuery.extend({$var_name}, {$var_value|json_encode nofilter});
jQuery.extend({$var_name|escape:'javascript':'UTF-8'}, {$var_value|json_encode nofilter});
{literal}
} {/literal} else if ('undefined' !== typeof {$var_name}{literal}) {
} {/literal} else if ('undefined' !== typeof {$var_name|escape:'javascript':'UTF-8'}{literal}) {
{/literal}
{$var_name} = {$var_value|json_encode nofilter};
{literal}
@@ -33,7 +33,12 @@
<div class="block-header shopping-cart-header">{l s='Shopping Cart' d='Shop.Theme.Checkout'}</div>
<div class="cart-inner-wrapper">
{if $cartQuantityError}
<div class="error-msg visible">{$cartQuantityError}</div>
<div class="error-msg visible">{$cartQuantityError|escape:'htmlall':'UTF-8'}</div>
{/if}
{if $otherErrors}
{foreach $otherErrors as $moduleName => $errorMsg}
<div class="error-msg visible">{$moduleName|escape:'htmlall':'UTF-8'}: {$errorMsg|escape:'htmlall':'UTF-8'}</div>
{/foreach}
{/if}
<div class="cart-grid row">

View File

@@ -17,10 +17,14 @@
{hook h='displayHeurekaNeSouhlas'}
{* openservis - Heureka - NeSouhlas - end *}
{* caleydon (prestashop.sk) - Heureka - begin *}
{hook h='displayCmHeurekaConsent'}
{* caleydon (prestashop.sk) - Heureka - end *}
{* Prestashop v8 - new hook for various order confirmation constents *}
{hook h='displayCheckoutBeforeConfirmation'}
{if $conditions_to_approve|count && !$tc_config->separate_payment}
{if $conditions_to_approve|count && !$z_tc_config->separate_payment}
<div class="terms-and-conditions">
<div class="error-msg">{l s='Please accept terms and conditions' mod='thecheckout'}</div>
@@ -37,9 +41,9 @@
<li>
<div class="float-xs-left">
<span class="custom-checkbox">
{assign "condition_full_name" "conditions_to_approve[{$condition_name}]"}
<input id="conditions_to_approve[{$condition_name}]"
name="conditions_to_approve[{$condition_name}]"
{assign "condition_full_name" "conditions_to_approve[{$condition_name|escape:'javascript':'UTF-8'}]"}
<input id="conditions_to_approve[{$condition_name|escape:'javascript':'UTF-8'}]"
name="conditions_to_approve[{$condition_name|escape:'javascript':'UTF-8'}]"
required
type="checkbox"
class="ps-shown-by-js"
@@ -51,7 +55,7 @@
</span>
</div>
<div class="condition-label">
<label class="js-terms" for="conditions_to_approve[{$condition_name}]">
<label class="js-terms" for="conditions_to_approve[{$condition_name|escape:'javascript':'UTF-8'}]">
{$condition nofilter}
</label>
</div>
@@ -67,7 +71,7 @@
<button id="confirm_order" type="button" class="btn btn-primary center-block" data-link-action="x-confirm-order" >
<div class="minimal-purchase-error-msg"></div>
<div class="tc-loader"><div class="lds-ellipsis-m"><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div></div></div>
{if !$tc_config->separate_payment}
{if !$z_tc_config->separate_payment}
{l s='Order with an obligation to pay' d='Shop.Theme.Checkout'}
{else}
{l s='Continue' d='Shop.Theme.Actions'}
@@ -94,7 +98,7 @@
<div class="ps-hidden-by-js">
{if isset($selected_payment_option) && $selected_payment_option and $all_conditions_approved}
<label
for="pay-with-{$selected_payment_option}">{l s='Order with an obligation to pay' d='Shop.Theme.Checkout'}</label>
for="pay-with-{$selected_payment_option|escape:'javascript':'UTF-8'}">{l s='Order with an obligation to pay' d='Shop.Theme.Checkout'}</label>
{/if}
</div>
</div>

View File

@@ -22,34 +22,37 @@
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='login_form'}
{if !$tc_config->move_login_to_account}<div class="inner-wrapper">{/if}
{if !$z_tc_config->move_login_to_account}<div class="inner-wrapper">{/if}
<div class="offer-login">
<div class="already-account-label">
{l s='Already have an account?' d='Shop.Theme.Customeraccount'}
</div>
<div class="classic-login">
<a class="log-in" href="#" data-link-action="x-offer-login">
{l s='Zaloguj się' d='Shop.Theme.Customeraccount'}
{l s='Log in instead!' d='Shop.Theme.Customeraccount'}
</a>
</div>
{if isset($HOOK_OASL_CUSTOM)}
<div class="social-login" data-trans-or="{l s='OR' mod='thecheckout'}">
{$HOOK_OASL_CUSTOM nofilter}
</div>
{elseif ($tc_config->social_login_fb || $tc_config->social_login_google) }
{elseif ($z_tc_config->social_login_fb || $z_tc_config->social_login_google || $paypal_express_checkout) }
<div class="social-login" data-trans-or="{l s='OR' mod='thecheckout'}">
{if $tc_config->social_login_fb && $tc_config->social_login_fb_app_id && $tc_config->social_login_fb_app_secret}
{if $paypal_express_checkout}
<div id="tc-paypal-express-checkout">{$paypal_express_checkout nofilter}</div>
{/if}
{if $z_tc_config->social_login_fb && $z_tc_config->social_login_fb_app_id && $z_tc_config->social_login_fb_app_secret}
{*<div class="fb-login-button" data-max-rows="1" data-onlogin="fb_checkLoginState();" data-size="medium" data-button-type="login_with" data-show-faces="false" data-auto-logout-link="false" data-use-continue-as="false"></div>*}
<div id="tc-facebook-signin" class="tc-social-login-btn"><span class="social-logo"><span class="facebook-logo"></span></span>{l s='Sign in with Facebook' mod='thecheckout'}</div>
{/if}
{if $tc_config->social_login_google && $tc_config->social_login_google_client_id && $tc_config->social_login_google_client_secret}
{if $z_tc_config->social_login_google && $z_tc_config->social_login_google_client_id && $z_tc_config->social_login_google_client_secret}
{*Google+ login <div class="g-signin2" data-onsuccess="tc_onSignIn"></div>*}
<div id="tc-google-signin"></div>
{/if}
</div>
{/if}
</div>
<form id="login-form" action="{block name='login_form_actionurl'}{$action}{/block}" method="post">
<form id="login-form" action="{block name='login_form_actionurl'}{$action|escape:'javascript':'UTF-8'}{/block}" method="post">
<section class="form-fields">
{block name='login_form_fields'}
@@ -76,7 +79,7 @@
{/block}
<div class="forgot-password">
<a href="{$urls.pages.password}" rel="nofollow">
<a href="{$urls.pages.password|escape:'javascript':'UTF-8'}" rel="nofollow">
{l s='Forgot your password?' d='Shop.Theme.Customeraccount'}
</a>
</div>
@@ -89,5 +92,5 @@
</button>
<div class="error-enter-email" style="display: none">{l s='Please enter your email address to proceed with order.' mod='thecheckout'}</div>
</div>
{if !$tc_config->move_login_to_account}</div>{/if}
{if !$z_tc_config->move_login_to_account}</div>{/if}
{/block}

View File

@@ -19,7 +19,7 @@
<span>{l s='First, please enter your: ' mod='thecheckout'}
<ul>
{foreach $payment_block_wait_for_address as $field_name}
<li>{$field_name}</li>
<li>{$field_name|escape:'htmlall':'UTF-8'}</li>
{/foreach}
</ul>
</span>
@@ -40,7 +40,7 @@
{if isset($payment_data)}
<div id="payment_data">
{foreach from=$payment_data key="data_key" item="data_item"}
<input type="hidden" id="payment_data_{$data_key}" value="{$data_item}">
<input type="hidden" id="payment_data_{$data_key|escape:'javascript':'UTF-8'}" value="{$data_item|escape:'javascript':'UTF-8'}">
{/foreach}
</div>
{/if}
@@ -48,11 +48,11 @@
{foreach from=$payment_options key="module_name" item="module_options"}
{foreach from=$module_options item="option" name="multioptions"}
<div
id="{$option.id}-main-title"
id="{$option.id|escape:'javascript':'UTF-8'}-main-title"
class="tc-main-title"
data-payment-module="{$module_name}"
data-payment-module="{$module_name|escape:'javascript':'UTF-8'}"
>
<div id="{$option.id}-container" class="payment-option clearfix">
<div id="{$option.id|escape:'javascript':'UTF-8'}-container" class="payment-option clearfix">
{* This is the way an option should be selected when Javascript is enabled *}
<span class="custom-radio float-xs-left">
{if ''!=$option.module_name}
@@ -62,8 +62,8 @@
{/if}
<input
class="ps-shown-by-js {if $option.binary} binary {/if}"
id="{$option.id}"
data-module-name="{if ''!=$option.module_name}{$option.module_name|regex_replace:"/[^a-zA-Z-_]/":""}{else}{$module_name|regex_replace:"/[^a-zA-Z-_]/":""}{/if}{if $smarty.foreach.multioptions.index>0 && $prev_option_name == $actual_option_name}-{$smarty.foreach.multioptions.index}{/if}"
id="{$option.id|escape:'javascript':'UTF-8'}"
data-module-name="{if ''!=$option.module_name}{$option.module_name|regex_replace:"/[^a-zA-Z-_0-9]/":""}{else}{$module_name|regex_replace:"/[^a-zA-Z-_]/":""}{/if}{$option.call_to_action_text_md5}"
name="payment-option"
type="radio"
required
@@ -74,24 +74,23 @@
<span></span>
</span>
<label for="{$option.id}">
<span class="h6">{$option.call_to_action_text}</span>
{if $option.logo}
<img src="{$option.logo}">
{/if}
<label for="{$option.id|escape:'javascript':'UTF-8'}">
<div class="payment-logo">{if isset($option.logo) && $option.logo}<img src="{$option.logo|escape:'javascript':'UTF-8'}">{/if}</div>
<div class="payment-call-to-action-and-logo">
<span class="h6">{$option.call_to_action_text|escape:'javascript':'UTF-8'}</span>
</div>
</label>
</div>
{if $option.additionalInformation}
{if isset($option.additionalInformation) && $option.additionalInformation}
<div
id="{$option.id}-additional-information"
class="js-additional-information definition-list additional-information {$module_name}{if $option.id != $selected_payment_option} ps-hidden{/if}"
id="{$option.id|escape:'javascript':'UTF-8'}-additional-information"
class="js-additional-information definition-list additional-information {$module_name|escape:'javascript':'UTF-8'}{if $option.id != $selected_payment_option} ps-hidden{/if}"
>
{$option.additionalInformation nofilter}
</div>
{/if}
<div
id="pay-with-{$option.id}-form"
id="pay-with-{$option.id|escape:'javascript':'UTF-8'}-form"
class="js-payment-option-form {if $option.id != $selected_payment_option} ps-hidden {/if}"
>
{if $option.form}
@@ -99,9 +98,9 @@
{else}
<form class="payment-form" method="POST" action="{$option.action nofilter}">
{foreach from=$option.inputs item=input}
<input type="{$input.type}" name="{$input.name}" value="{$input.value}">
<input type="{$input.type|escape:'javascript':'UTF-8'}" name="{$input.name|escape:'javascript':'UTF-8'}" value="{$input.value|escape:'htmlall':'UTF-8'}">
{/foreach}
<button style="display:none" id="pay-with-{$option.id}" type="submit"></button>
<button style="display:none" id="pay-with-{$option.id|escape:'javascript':'UTF-8'}" type="submit"></button>
</form>
{/if}
</div>
@@ -118,16 +117,6 @@
</div>
{/if}
{hook h='displayPaymentByBinaries'}
<div class="modal fade" id="modal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<button type="button" class="close" data-bs-dismiss="modal" data-dismiss="modal" aria-label="{l s='Close' d='Shop.Theme.Global'}">
<span aria-hidden="true">&times;</span>
</button>
<div class="js-modal-content"></div>
</div>
</div>
</div>
{/block}
{/if}
</div>

View File

@@ -20,7 +20,7 @@
<span>{l s='First, please enter your: ' mod='thecheckout'}
<ul>
{foreach $shipping_block_wait_for_address as $field_name}
<li>{$field_name}</li>
<li>{$field_name|escape:'htmlall':'UTF-8'}</li>
{/foreach}
</ul>
</span>
@@ -32,9 +32,9 @@
<div class="dummy-block-container disallowed">
<span>{l s='Please Save your Personal Info to see shipping options' mod='thecheckout'}</span></div>
{else}
{if isset($shippingAddressNotice) && $shippingAddressNotice|count}
{if isset($shippingAddressNotice) && $shippingAddressNotice}
<div class="shipping-address-notice">{l s='Shipping Address' d='Shop.Theme.Checkout'}: <span
class="country-name">{$shippingAddressNotice|join:', '}</span></div>
class="country-name">{$shippingAddressNotice|escape:'htmlall':'UTF-8'}</span></div>
{/if}
<div id="hook-display-before-carrier">
{$hookDisplayBeforeCarrier nofilter}
@@ -52,40 +52,46 @@
<div class="delivery-options">
{foreach from=$delivery_options item=carrier key=carrier_id}
<div
class="delivery-option-row row delivery-option{if isset($carrier.external_module_name) && "" != $carrier.external_module_name} {$carrier.external_module_name}{/if}{if (isset($customerSelectedDeliveryOption) && $carrier_id == $customerSelectedDeliveryOption)} user-selected{/if} carrier-ref-{$carrier.id_reference}">
class="delivery-option-row row delivery-option{if isset($carrier.external_module_name) && "" != $carrier.external_module_name} {$carrier.external_module_name|escape:'javascript':'UTF-8'}{/if}{if (isset($customerSelectedDeliveryOption) && $carrier_id == $customerSelectedDeliveryOption)} user-selected{/if} carrier-ref-{$carrier.id_reference|escape:'javascript':'UTF-8'}">
<div class="shipping-radio">
<span class="custom-radio float-xs-left">
<input type="radio" name="delivery_option[{$id_address}]" id="delivery_option_{$carrier.id}"
value="{$carrier_id}"{if $delivery_option == $carrier_id && (!$forceToChooseCarrier || (isset($customerSelectedDeliveryOption) && $carrier_id == $customerSelectedDeliveryOption))} checked{/if}>
<input type="radio" name="delivery_option[{$id_address|escape:'javascript':'UTF-8'}]" id="delivery_option_{$carrier.id|escape:'javascript':'UTF-8'}"
value="{$carrier_id|escape:'javascript':'UTF-8'}"{if $delivery_option == $carrier_id && (!$forceToChooseCarrier || (isset($customerSelectedDeliveryOption) && $carrier_id == $customerSelectedDeliveryOption))} checked{/if}>
<span></span>
</span>
</div>
<label for="delivery_option_{$carrier.id}" class="delivery-option-label delivery-option-2 {if $carrier.logo}has-logo{else}no-logo{/if}">
<div class="row">
<div class="delivery-option-detail">
<div class="row">
{if $carrier.logo}
<div class="delivery-option-logo">
<img src="{$carrier.logo}" alt="{$carrier.name}"/>
</div>
{/if}
<div class="delivery-option-name">
<span class="h6 carrier-name">{$carrier.name}</span>
</div>
<label for="delivery_option_{$carrier.id|escape:'javascript':'UTF-8'}" class="delivery-option-label delivery-option-2 {if $carrier.logo|escape:'javascript':'UTF-8'}has-logo{else}no-logo{/if}">
<div class="delivery-option-detail">
<div class="delivery-option-logo">
{if $carrier.logo}
<img src="{$carrier.logo|escape:'javascript':'UTF-8'}" alt="{$carrier.name|escape:'javascript':'UTF-8'}"/>
{/if}
</div>
<div class="name-and-delay">
<div class="delivery-option-name">
<span class="h6 carrier-name">{$carrier.name|escape:'htmlall':'UTF-8'}</span>
</div>
<div class="delivery-option-delay">
<span class="carrier-delay">{$carrier.delay|escape:'htmlall':'UTF-8'}</span>
</div>
{* Yes, this is repeated from below, so that we can control price display easily with CSS *}
<div style="display: none;" class="delivery-option-price{if $carrier.price_with_tax == 0} free{/if}">
<span class="carrier-price">{$carrier.price|escape:'htmlall':'UTF-8'}</span>
<span class="carrier-price-with-tax-formatted">{$carrier.price_with_tax_formatted|escape:'htmlall':'UTF-8'}</span>
<span class="carrier-price-without-tax-formatted">{$carrier.price_without_tax_formatted|escape:'htmlall':'UTF-8'}</span>
</div>
</div>
<div class="delivery-option-delay">
<span class="carrier-delay">{$carrier.delay}</span>
</div>
<div class="delivery-option-price">
<span class="carrier-price">{$carrier.price}</span>
<div class="delivery-option-price{if $carrier.price_with_tax == 0} free{/if}">
<span class="carrier-price">{$carrier.price|escape:'htmlall':'UTF-8'}</span>
<span class="carrier-price-with-tax-formatted">{$carrier.price_with_tax_formatted|escape:'htmlall':'UTF-8'}</span>
<span class="carrier-price-without-tax-formatted">{$carrier.price_without_tax_formatted|escape:'htmlall':'UTF-8'}</span>
</div>
</div>
</label>
</div>
{*Some themes have CSS definition: .carrier-extra-content:not(:empty) { margin-bottom: 2rem; } - so we need to keep no extra spaces here in .carrier-extra-content, if it shall be empty *}
<div
class="row carrier-extra-content{if "1" === $carrier.is_module} {$carrier.external_module_name}{/if}"{if $delivery_option != $carrier_id} style="display:none;"{/if}>{$carrier.extraContent nofilter}</div>
class="row carrier-extra-content{if isset($carrier.external_module_name) && "" != $carrier.external_module_name} {$carrier.external_module_name|escape:'javascript':'UTF-8'}{/if}"{if $delivery_option != $carrier_id} style="display:none;"{/if}>{$carrier.extraContent nofilter}</div>
<div class="clearfix"></div>
{/foreach}
</div>
@@ -111,12 +117,12 @@
<input class="js-gift-checkbox" id="input_gift" name="gift" type="checkbox" value="1"
{if $gift.isGift}checked="checked"{/if}>
<span><i class="material-icons rtl-no-flip checkbox-checked check-icon">&#xE5CA;</i></span>
<label for="input_gift">{$gift.label}</label>
<label for="input_gift">{$gift.label|escape:'htmlall':'UTF-8'}</label>
</span>
<div id="gift" class="collapse{if $gift.isGift} in show{/if}">
<label
for="gift_message">{l s='If you\'d like, you can add a note to the gift:' d='Shop.Theme.Checkout'}</label>
<textarea rows="2" id="gift_message" name="gift_message">{$gift.message}</textarea>
<textarea rows="2" id="gift_message" name="gift_message">{$gift.message|escape:'htmlall':'UTF-8'}</textarea>
</div>
{/if}

View File

@@ -14,33 +14,36 @@
{* necessary here, core's checkout.js script looks for #checkout element and binds handlers only then - setUpCheckout() *}
{*<div id="checkout" class="fool-js-confirmation-controllers"></div>*}
<script>
var debug_js_controller = '{$debugJsController}';
var static_token = '{$static_token}';
var config_default_payment_method = '{$tc_config->default_payment_method}';
var config_show_i_am_business = '{$tc_config->show_i_am_business}';
var config_show_i_am_private = '{$tc_config->show_i_am_private}';
var config_show_i_am_business_delivery = '{$tc_config->show_i_am_business_delivery}';
var config_show_i_am_private_delivery = '{$tc_config->show_i_am_private_delivery}';
var config_force_customer_to_choose_country = '{$tc_config->force_customer_to_choose_country}';
var config_blocks_update_loader = '{$tc_config->blocks_update_loader}';
var config_refresh_minicart = (true == '{$tc_config->refresh_minicart}');
var config_postcode_remove_spaces = (true == '{$tc_config->postcode_remove_spaces}');
var config_separate_payment = (true == '{$tc_config->separate_payment}');
var separate_payment_key = '{$separatePaymentKeyName}';
var isEmptyCart = '{$isEmptyCart}';
var tcModuleBaseUrl = '{$urls.base_url}/modules/thecheckout';
var forceRefreshShipping = '{$forceRefreshShipping}';
var sendcloud_script = '{$sendcloud_script}';
var debug_js_controller = '{$debugJsController|escape:'javascript':'UTF-8'}';
var static_token = '{$static_token|escape:'javascript':'UTF-8'}';
var config_default_payment_method = '{$z_tc_config->default_payment_method|escape:'javascript':'UTF-8'}';
var config_show_i_am_business = '{$z_tc_config->show_i_am_business|escape:'javascript':'UTF-8'}';
var config_show_i_am_private = '{$z_tc_config->show_i_am_private|escape:'javascript':'UTF-8'}';
var config_show_i_am_business_delivery = '{$z_tc_config->show_i_am_business_delivery|escape:'javascript':'UTF-8'}';
var config_show_i_am_private_delivery = '{$z_tc_config->show_i_am_private_delivery|escape:'javascript':'UTF-8'}';
var config_force_customer_to_choose_country = '{$z_tc_config->force_customer_to_choose_country|escape:'javascript':'UTF-8'}';
var config_blocks_update_loader = '{$z_tc_config->blocks_update_loader|escape:'javascript':'UTF-8'}';
var config_refresh_minicart = (true == '{$z_tc_config->refresh_minicart|escape:'javascript':'UTF-8'}');
var config_postcode_remove_spaces = (true == '{$z_tc_config->postcode_remove_spaces|escape:'javascript':'UTF-8'}');
var config_separate_payment = (true == '{$z_tc_config->separate_payment|escape:'javascript':'UTF-8'}');
var config_use_other_for_business_private = (true == '{$z_tc_config->use_other_field_for_business_private|escape:'javascript':'UTF-8'}');
var separate_payment_key = '{$separatePaymentKeyName|escape:'javascript':'UTF-8'}';
var isEmptyCart = '{$isEmptyCart|escape:'javascript':'UTF-8'}';
var tcModuleBaseUrl = '{$urls.base_url|escape:'javascript':'UTF-8'}/modules/thecheckout';
var forceRefreshShipping = '{$forceRefreshShipping|escape:'javascript':'UTF-8'}';
var sendcloud_script = '{$sendcloud_script|escape:'javascript':'UTF-8'}';
var i18_requiredField = "{l s='Required field' d='Shop.Forms.Errors'}";
var i18_fixErrorBelow = "{l s='Please fix the error below.' d='Shop.Notifications.Error'}";
var i18_sdiLength = "{l s='Inserire il codice SDI di sette cifre. Inserire sette volte zero (0000000) se non si possiede un codice SDI' mod='thecheckout'}";
var i18_popupPaymentNotice = "{l s='Payment popup will appear once the form is confirmed' mod='thecheckout'}";
var i18_validationError = "{l s='Validation error' mod='thecheckout'}";
var i18_business = "{l s='business' mod='thecheckout'}";
var i18_private = "{l s='private' mod='thecheckout'}";
var installedModules = [];
{foreach $installedModules as $moduleName=>$moduleState}
installedModules['{$moduleName}'] = '{$moduleState}';
installedModules['{$moduleName|escape:'javascript':'UTF-8'}'] = '{$moduleState|escape:'javascript':'UTF-8'}';
{/foreach}
var tcAmazonPaySessionId = '{$tc_amazonPaySessionId|default:""}';
var tcAmazonPaySessionId = '{$tc_amazonPaySessionId|default:""|escape:'javascript':'UTF-8'}';
</script>
<style>
@@ -60,26 +63,26 @@
{/literal}
{/if}
{if !$tc_config->offer_second_address}{literal}
{if !$z_tc_config->offer_second_address}{literal}
.second-address {
display: none;
}
{/literal}{/if}
{if !$tc_config->show_block_reassurance}{literal}
{if !$z_tc_config->show_block_reassurance}{literal}
#block-reassurance {
display: none;
}
{/literal}{/if}
{if !$tc_config->show_order_message}{literal}
{if !$z_tc_config->show_order_message}{literal}
#thecheckout-order-message {
display: none;
}
{/literal}{/if}
{if !$tc_config->using_material_icons}{literal}
{if !$z_tc_config->using_material_icons}{literal}
span.custom-radio input[type=radio] {
opacity: 1;
}
@@ -108,7 +111,7 @@
{/literal}{/if}
{*
{if $tc_config->show_i_am_business}{literal}
{if $z_tc_config->show_i_am_business}{literal}
#thecheckout-address-invoice .form-group.business-field {
order: -1; /* Put business field in front if we have this checkbox */
}
@@ -117,12 +120,12 @@
*}
/* BEGIN Custom CSS styles from config page */
{$tc_config->custom_css nofilter}
{$z_tc_config->custom_css nofilter}
/* END Custom CSS styles from config page */
</style>
<script>
/* BEGIN Custom JS code from config page */
{$tc_config->custom_js nofilter}
{$z_tc_config->custom_js nofilter}
/* END Custom JS code from config page */
</script>
{*<div id="checkout">*}
@@ -132,7 +135,7 @@
{*{debug}*}
<div id="empty-cart-notice">
<h1>{l s='Cart is empty' d='Shop.Notifications.Error'}</h1>
<a class="label" href="{$urls.pages.index}">
<a class="label" href="{$urls.pages.index|escape:'javascript':'UTF-8'}">
<span class="laquo">«</span>{l s='Continue shopping' d='Shop.Theme.Actions'}
</a>
</div>
@@ -148,8 +151,8 @@
<div class="blocks checkout-area-{$k++}{if $data.size<=35} width-below-35pct{/if}{if $data.size<=50} width-below-50pct{/if}{if $data.size<=70} width-below-70pct{/if}" style="flex-basis: {$data.size}%; min-width: {$data.size}%;">{foreach $sub_block as $checkout_block}
{foreach $checkout_block as $blockName=>$classes}
{if !in_array($blockName, $excludeBlocks)}
<div class="tc-block-placeholder thecheckout-{$blockName}"></div>
<div class="checkout-block{if $blockName|in_array:['login-form','account','address-invoice','address-delivery','shipping','payment']} main-block{/if} {$classes}" id="thecheckout-{$blockName}">
<div class="tc-block-placeholder thecheckout-{$blockName|escape:'javascript':'UTF-8'}"></div>
<div class="checkout-block{if $blockName|in_array:['login-form','account','address-invoice','address-delivery','shipping','payment']} main-block{/if} {$classes|escape:'javascript':'UTF-8'}" id="thecheckout-{$blockName|escape:'javascript':'UTF-8'}">
<div class="inner-area">
{if "cart-summary" == $blockName}
{*cart-summary block loaded via Ajax, display dummy container only*}
@@ -198,11 +201,12 @@
<div class="popup-header">
<div class="popup-close-icon"></div>
<div class="popup-shop-info">
<div class="popup-shop-logo"><img src="{$shop.logo}"></div>
<div class="popup-shop-name">{$shop.name}</div>
<div class="popup-shop-logo"><img src="{$shop.logo|escape:'javascript':'UTF-8'}"></div>
<div class="popup-shop-name">{$shop.name|escape:'htmlall':'UTF-8'}</div>
</div>
</div>
<div class="popup-body">
<iframe class="popup-embed"></iframe>
<div class="popup-payment-form"></div>
<div class="popup-payment-button">
{include file='module:thecheckout/views/templates/front/_partials/payment-confirmation-button.tpl'}
@@ -217,39 +221,39 @@
{include file='module:thecheckout/views/templates/front/blocks/confirm.tpl'}
{/if}
{if "html-box-1" == $blockName}
{$tc_config->html_box_1 nofilter}
{$z_tc_config->html_box_1 nofilter}
{/if}
{if "html-box-2" == $blockName}
{$tc_config->html_box_2 nofilter}
{$z_tc_config->html_box_2 nofilter}
{/if}
{if "html-box-3" == $blockName}
{$tc_config->html_box_3 nofilter}
{$z_tc_config->html_box_3 nofilter}
{/if}
{if "html-box-4" == $blockName}
{$tc_config->html_box_4 nofilter}
{$z_tc_config->html_box_4 nofilter}
{/if}
{if "required-checkbox-1" == $blockName && isset($separateModuleFields['thecheckout_required-checkbox-1'])}
<form class="account-fields module-account-fields {$blockName}">
<form class="account-fields module-account-fields {$blockName|escape:'javascript':'UTF-8'}">
{include file='module:thecheckout/views/templates/front/_partials/checkout-form-fields.tpl' field=$separateModuleFields['thecheckout_required-checkbox-1']}
</form>
{/if}
{if "required-checkbox-2" == $blockName && isset($separateModuleFields['thecheckout_required-checkbox-2'])}
<form class="account-fields module-account-fields {$blockName}">
<form class="account-fields module-account-fields {$blockName|escape:'javascript':'UTF-8'}">
{include file='module:thecheckout/views/templates/front/_partials/checkout-form-fields.tpl' field=$separateModuleFields['thecheckout_required-checkbox-2']}
</form>
{/if}
{if "newsletter" == $blockName && isset($separateModuleFields['ps_emailsubscription_newsletter'])}
<form class="account-fields module-account-fields {$blockName}">
<form class="account-fields module-account-fields {$blockName|escape:'javascript':'UTF-8'}">
{include file='module:thecheckout/views/templates/front/_partials/checkout-form-fields.tpl' field=$separateModuleFields['ps_emailsubscription_newsletter']}
</form>
{/if}
{if "psgdpr" == $blockName && isset($separateModuleFields['psgdpr_psgdpr'])}
<form class="account-fields module-account-fields {$blockName}">
<form class="account-fields module-account-fields {$blockName|escape:'javascript':'UTF-8'}">
{include file='module:thecheckout/views/templates/front/_partials/checkout-form-fields.tpl' field=$separateModuleFields['psgdpr_psgdpr']}
</form>
{/if}
{if "data-privacy" == $blockName && isset($separateModuleFields['ps_dataprivacy_customer_privacy'])}
<form class="account-fields module-account-fields {$blockName}">
<form class="account-fields module-account-fields {$blockName|escape:'javascript':'UTF-8'}">
{include file='module:thecheckout/views/templates/front/_partials/checkout-form-fields.tpl' field=$separateModuleFields['ps_dataprivacy_customer_privacy']}
</form>
{/if}
@@ -260,11 +264,11 @@
{/foreach}</div>
{elseif "size" === $key} {*intentionally empty*}
{else}
{if 0 === $key|strpos:'flex-split'}
<div class="{$key} checkout-area-{$k++}" style="flex-basis: {$data.size}%">
{if 0 === strpos($key,'flex-split')}
<div class="{$key|escape:'javascript':'UTF-8'} checkout-area-{$k++}" style="flex-basis: {$data.size}%">
{/if}
{blockContainer data=$sub_block}
{if 0 === $key|strpos:'flex-split'}
{if 0 === strpos($key,'flex-split')}
</div>
{/if}
@@ -273,30 +277,30 @@
{/foreach}
{/function}
{function step}
{if $tc_config->step_label_{$stepId}|trim}
{if $z_tc_config->step_label_{$stepId|escape:'javascript':'UTF-8'}|trim}
{* {assign number_of_steps $stepId scope='root'}*}
<div class="checkout-step-btn" data-step-id="{$stepId}">{$tc_config->step_label_{$stepId}}</div>
{assign var=blocksArr value=","|explode:$tc_config->step_blocks_{$stepId}}
{* Blocks: {$tc_config->step_blocks_{$stepId}}*}
<div class="checkout-step-btn" data-step-id="{$stepId|escape:'javascript':'UTF-8'}">{$z_tc_config->step_label_{$stepId|escape:'javascript':'UTF-8'}|escape:'javascript':'UTF-8'}</div>
{assign var=blocksArr value=","|explode:$z_tc_config->step_blocks_{$stepId|escape:'javascript':'UTF-8'}}
{* Blocks: {$z_tc_config->step_blocks_{$stepId}}*}
{* Blocks array: {$blocksArr|print_r}*}
<script type="text/javascript">
tc_steps.push(
{literal} {
{/literal}
step: {$stepId},
blocks: '{$tc_config->step_blocks_{$stepId}}',
validation: () => ({if isset($tc_config->step_validation_{$stepId}) && $tc_config->step_validation_{$stepId}|trim}{$tc_config->step_validation_{$stepId} nofilter}{else}true{/if}),
errorMsg: '{$tc_config->step_validation_error_{$stepId}}',
step: {$stepId|escape:'javascript':'UTF-8'},
blocks: '{$z_tc_config->step_blocks_{$stepId|escape:'javascript':'UTF-8'}|escape:'javascript':'UTF-8'}',
validation: () => ({if isset($z_tc_config->step_validation_{$stepId}) && $z_tc_config->step_validation_{$stepId}|trim}{$z_tc_config->step_validation_{$stepId|escape:'javascript':'UTF-8'} nofilter}{else}true{/if}),
errorMsg: '{$z_tc_config->step_validation_error_{$stepId|escape:'javascript':'UTF-8'}|escape:'javascript':'UTF-8'}',
{literal} }
{/literal}
);
</script>
<style>
{assign var=blocksSelector value=''}
{foreach ","|explode:$tc_config->step_blocks_{$stepId} as $blockName}
{assign var=blocksSelector value="{$blocksSelector}:not(#thecheckout-{$blockName|trim})"}
{foreach ","|explode:$z_tc_config->step_blocks_{$stepId} as $blockName}
{assign var=blocksSelector value="{$blocksSelector|escape:'javascript':'UTF-8'}:not(#thecheckout-{$blockName|trim|escape:'javascript':'UTF-8'})"}
{/foreach}
.checkout-step-{$stepId} .checkout-block{$blocksSelector} {literal} {
.checkout-step-{$stepId|escape:'javascript':'UTF-8'} .checkout-block{$blocksSelector|escape:'javascript':'UTF-8'} {literal} {
{/literal}
visibility: hidden;
position: absolute;
@@ -309,7 +313,7 @@
{/if}
{/function}
{function steps}
{if $tc_config->checkout_steps}
{if $z_tc_config->checkout_steps}
<script type="text/javascript">
var tc_steps = [];
</script>
@@ -322,7 +326,7 @@
{/if}
{/function}
{function steps_prev_next}
{if $tc_config->checkout_steps}
{if $z_tc_config->checkout_steps}
<div class="prev-next-container">
<button class="btn step-back back" type="button">
{l s='Back' mod='thecheckout'}
@@ -382,4 +386,14 @@
</div>
<div id="tc-container-mobile"></div>
{steps_prev_next}
<div class="modal fade" id="modal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<button type="button" class="close" data-bs-dismiss="modal" data-dismiss="modal" aria-label="{l s='Close' d='Shop.Theme.Global'}">
<span aria-hidden="true">&times;</span>
</button>
<div class="js-modal-content"></div>
</div>
</div>
</div>
{/block}