aktualizacja modułu dpd
This commit is contained in:
33
modules/dpdshipping/views/css/admin/index.php
Normal file
33
modules/dpdshipping/views/css/admin/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
27
modules/dpdshipping/views/css/admin/shipping-detail.css
Normal file
27
modules/dpdshipping/views/css/admin/shipping-detail.css
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
.dpdshipping-order-detail-shipping-subtitle {
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
}
|
||||
49
modules/dpdshipping/views/css/admin/special-price.css
Normal file
49
modules/dpdshipping/views/css/admin/special-price.css
Normal file
@@ -0,0 +1,49 @@
|
||||
.pagination-button {
|
||||
display: inline-block;
|
||||
margin: 0 0.25rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.5;
|
||||
color: #6c757d;
|
||||
background-color: #fff;
|
||||
border: 1px solid #6c757d;
|
||||
border-radius: 0.25rem;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.pagination-button:hover {
|
||||
background-color: #6c757d;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.pagination-button.active {
|
||||
background-color: #6c757d;
|
||||
color: #fff;
|
||||
border-color: #6c757d;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.pagination-button.disabled {
|
||||
background-color: #e9ecef;
|
||||
border-color: #dee2e6;
|
||||
color: #6c757d;
|
||||
cursor: not-allowed;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.pagination-button {
|
||||
padding: 0.4rem 0.6rem;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
#pagination-info {
|
||||
font-size: 0.875rem;
|
||||
color: #6c757d;
|
||||
margin: 8px 0;
|
||||
}
|
||||
58
modules/dpdshipping/views/css/dpdshipping-common.css
Normal file
58
modules/dpdshipping/views/css/dpdshipping-common.css
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
.dpdshipping-pudo-container span, .dpdshipping-pudo-cod-container span, .dpdshipping-pudo-swipbox-container span {
|
||||
color: #464646;
|
||||
}
|
||||
|
||||
@media (min-width: 1299px) {
|
||||
.modal-dpd-xl {
|
||||
max-width: 1200px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.dpdshipping-pudo-container, .dpdshipping-pudo-cod-container, .dpdshipping-pudo-swipbox-container {
|
||||
padding: 0 15px 15px 30px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 993px) {
|
||||
.dpdshipping-pudo-container, .dpdshipping-pudo-cod-container, .dpdshipping-pudo-swipbox-container {
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-dpd-body {
|
||||
padding: 5px 5px 0 5px;
|
||||
}
|
||||
|
||||
.modal-dpd-content {
|
||||
padding: 0 !important;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.modal-dpd-footer {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
.dpdshipping-pudo-open-map-btn {
|
||||
margin-left: 5px;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-change-map-btn {
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-cod-new-point, .dpdshipping-pudo-new-point, .dpdshipping-pudo-selected-point p, .dpdshipping-pudo-cod-selected-point p, .dpdshipping-pudo-swipbox-new-point, .dpdshipping-pudo-swipbox-selected-point p {
|
||||
padding: 0;
|
||||
font-size: 13px;
|
||||
margin: 10px 0 0 0;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-cod-open-map-btn, .dpdshipping-pudo-swipbox-open-map-btn {
|
||||
margin-left: 5px;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-cod-change-map-btn, .dpdshipping-pudo-swipbox-change-map-btn {
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.container_dpdshipping_pudo_cod_warning {
|
||||
margin-top: 10px;
|
||||
}
|
||||
50
modules/dpdshipping/views/css/dpdshipping-pudo-default.css
Normal file
50
modules/dpdshipping/views/css/dpdshipping-pudo-default.css
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
.dpdshipping-pudo-open-map-btn {
|
||||
margin-left: 5px;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-change-map-btn {
|
||||
margin-right: 15px;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-cod-new-point, .dpdshipping-pudo-new-point, .dpdshipping-pudo-selected-point p, .dpdshipping-pudo-cod-selected-point p, .dpdshipping-pudo-swipbox-new-point, .dpdshipping-pudo-swipbox-selected-point p {
|
||||
padding: 0 0 0 15px;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-cod-open-map-btn, .dpdshipping-pudo-swipbox-open-map-btn {
|
||||
margin-left: 5px;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-cod-change-map-btn, .dpdshipping-pudo-swipbox-change-map-btn {
|
||||
margin-right: 15px;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
33
modules/dpdshipping/views/css/index.php
Normal file
33
modules/dpdshipping/views/css/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
40
modules/dpdshipping/views/css/navbar.css
Normal file
40
modules/dpdshipping/views/css/navbar.css
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
.dpdshipping-logo {
|
||||
width: 30px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.dpdshipping-nav-active {
|
||||
font-weight: bold;
|
||||
border-bottom: 2px solid red;
|
||||
}
|
||||
|
||||
.table-bordered, .table-bordered td, .table-bordered th {
|
||||
border: 1px solid #bbcdd2 !important;
|
||||
}
|
||||
|
||||
.dpdshipping-box-shadow {
|
||||
box-shadow: 0 0 4px 0 rgba(0, 0, 0, .06);
|
||||
}
|
||||
110
modules/dpdshipping/views/css/order-details.css
Normal file
110
modules/dpdshipping/views/css/order-details.css
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
.dpdshipping-logo {
|
||||
width: 25px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dpd-shipping-generate-form .form-group {
|
||||
margin-bottom: 5px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.dpd-shipping-generate-form .form-group .form-control-label {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.dpd-shipping-generate-form .form-control::placeholder {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.dpd-shipping-services .form-check {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.border-generate-shipping {
|
||||
border-right: 1px solid #e3e3e3;
|
||||
border-left: 1px solid #e3e3e3;
|
||||
}
|
||||
|
||||
@media (min-width: 1299px) {
|
||||
.modal-dpd-xl {
|
||||
max-width: 1200px;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-dpd-body {
|
||||
padding: 5px 5px 0 5px;
|
||||
}
|
||||
|
||||
.modal-dpd-content {
|
||||
padding: 0 !important;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.modal-dpd-footer {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-cod-container {
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
|
||||
.additional-fields-generate-shipping {
|
||||
width: 50%;
|
||||
float: left;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.dpdshipping-pudo-change-map-btn, #form_service_cod_currency, #form_service_guarantee_value, #form_service_declared_value_currency {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.btn-icon-right {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.btn-icon-right .icon {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.dpdshipping-btn-full-width {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 15px 0 15px 5px;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.dpdshipping-carrier-name {
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
}
|
||||
BIN
modules/dpdshipping/views/img/dpd_carrier_logo.png
Normal file
BIN
modules/dpdshipping/views/img/dpd_carrier_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
modules/dpdshipping/views/img/dpd_carrier_pickup_logo.png
Normal file
BIN
modules/dpdshipping/views/img/dpd_carrier_pickup_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
33
modules/dpdshipping/views/img/index.php
Normal file
33
modules/dpdshipping/views/img/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
33
modules/dpdshipping/views/index.php
Normal file
33
modules/dpdshipping/views/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
42
modules/dpdshipping/views/js/configuration/address-grid.js
Normal file
42
modules/dpdshipping/views/js/configuration/address-grid.js
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
window.prestashop.component.initComponents(
|
||||
[
|
||||
'Grid'
|
||||
],
|
||||
);
|
||||
const grid = new window.prestashop.component.Grid('dpdshipping_sender_address');
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.BulkActionCheckboxExtension());
|
||||
// grid.addExtension(new window.prestashop.component.GridExtensions.ExportToSqlManagerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.ReloadListExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SortingExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.FiltersResetExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitRowActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitBulkActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AjaxBulkActionExtension());
|
||||
// grid.addExtension(new window.prestashop.component.GridExtensions.FiltersSubmitButtonEnablerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AsyncToggleColumnExtension());
|
||||
// grid.addExtension(new window.prestashop.component.GridExtensions.PositionExtension(grid));
|
||||
});
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
window.prestashop.component.initComponents(
|
||||
[
|
||||
'Grid'
|
||||
],
|
||||
);
|
||||
const grid = new window.prestashop.component.Grid('dpdshipping_connection');
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.BulkActionCheckboxExtension());
|
||||
// grid.addExtension(new window.prestashop.component.GridExtensions.ExportToSqlManagerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.ReloadListExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SortingExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.FiltersResetExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitRowActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitBulkActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AjaxBulkActionExtension());
|
||||
// grid.addExtension(new window.prestashop.component.GridExtensions.FiltersSubmitButtonEnablerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AsyncToggleColumnExtension());
|
||||
// grid.addExtension(new window.prestashop.component.GridExtensions.PositionExtension(grid));
|
||||
});
|
||||
56
modules/dpdshipping/views/js/configuration/connection.js
Normal file
56
modules/dpdshipping/views/js/configuration/connection.js
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(() => {
|
||||
|
||||
$(document).on('click', '#addFidRow', function () {
|
||||
const packagesTable = document.getElementById('fidTable');
|
||||
const tbody = packagesTable.getElementsByTagName('tbody')[0];
|
||||
addFidRow(tbody.rows.length);
|
||||
});
|
||||
|
||||
$(document).on('click', '.dpdshipping-remove-row', function () {
|
||||
$(this).closest('tr').remove();
|
||||
});
|
||||
|
||||
function addFidRow(index) {
|
||||
const rowTemplate = `
|
||||
<tr>
|
||||
<td><input type="text" class="form-control" name="form[payerList][${index}][name]" ></td>
|
||||
<td><input type="number" class="form-control" name="form[payerList][${index}][fid]"></td>
|
||||
<td><input type="checkbox" class="form-control" name="form[payerList][${index}][default]"></td>
|
||||
<td><i class="material-icons btn btn-sm text-secondary delete-icon-gray dpdshipping-remove-row">delete</i></td>
|
||||
</tr>
|
||||
`;
|
||||
const packagesTable = document.getElementById('fidTable');
|
||||
const tbody = packagesTable.getElementsByTagName('tbody')[0];
|
||||
|
||||
tbody.appendChild(createRow());
|
||||
|
||||
function createRow(row) {
|
||||
const newRow = document.createElement('tr');
|
||||
newRow.innerHTML = rowTemplate;
|
||||
return newRow;
|
||||
}
|
||||
}
|
||||
});
|
||||
33
modules/dpdshipping/views/js/configuration/index.php
Normal file
33
modules/dpdshipping/views/js/configuration/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
51
modules/dpdshipping/views/js/configuration/parameters.js
Normal file
51
modules/dpdshipping/views/js/configuration/parameters.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(() => {
|
||||
function handleSelectChange() {
|
||||
const selectedValue = $(this).val();
|
||||
const parentContainer = $(this).closest('.row');
|
||||
if (selectedValue === 'STATIC_VALUE' || selectedValue === 'STATIC_VALUE_ONLY_FOR_EMPIK') {
|
||||
parentContainer.find('.input-static-value').removeClass('d-none').addClass('d-block');
|
||||
} else {
|
||||
parentContainer.find('.input-static-value').removeClass('d-block').addClass('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
$('.select-with-static-value').each(handleSelectChange);
|
||||
$(document).on('change', '.select-with-static-value', handleSelectChange);
|
||||
|
||||
function handlePrintFormat() {
|
||||
const selectedValue = $('#form_printFormat').val();
|
||||
|
||||
if (selectedValue === 'LBL_PRINTER') {
|
||||
$('#form_labelType').removeAttr('disabled');
|
||||
} else {
|
||||
$('#form_labelType').prop('selectedIndex', 0);
|
||||
$('#form_labelType').attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
handlePrintFormat();
|
||||
$(document).on('change', '#form_printFormat', handlePrintFormat);
|
||||
|
||||
});
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
window.prestashop.component.initComponents(
|
||||
[
|
||||
'Grid'
|
||||
],
|
||||
);
|
||||
const grid = new window.prestashop.component.Grid('dpdshipping_pickup_courier_settings');
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.BulkActionCheckboxExtension());
|
||||
// grid.addExtension(new window.prestashop.component.GridExtensions.ExportToSqlManagerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.ReloadListExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SortingExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.FiltersResetExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitRowActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitBulkActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AjaxBulkActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.FiltersSubmitButtonEnablerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AsyncToggleColumnExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.PositionExtension(grid));
|
||||
});
|
||||
222
modules/dpdshipping/views/js/configuration/special-price-data.js
Normal file
222
modules/dpdshipping/views/js/configuration/special-price-data.js
Normal file
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
* Copyright 2025 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(() => {
|
||||
const $importFileInput = $('#dpdSpecialPriceImportFile');
|
||||
const $selectedFileName = $('#selectedFileName');
|
||||
const $exportButton = $('#dpdSpecialPriceExportButton');
|
||||
const $importButton = $('#dpdSpecialPriceImportFileButton');
|
||||
|
||||
$importFileInput.on('change', function () {
|
||||
const fileName = $(this).val().split('\\').pop();
|
||||
$selectedFileName.text(fileName ? fileName : 'No file chosen');
|
||||
});
|
||||
|
||||
$exportButton.on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: dpdshipping_special_price_export_ajax_url,
|
||||
method: 'GET',
|
||||
data: {
|
||||
dpdshipping_token: dpdshipping_token
|
||||
},
|
||||
xhrFields: {
|
||||
responseType: 'blob',
|
||||
},
|
||||
success: function (data) {
|
||||
const url = window.URL.createObjectURL(data);
|
||||
const a = $('<a />', {
|
||||
href: url,
|
||||
download: 'export-dpd-ceny-specjalne-prestashop.csv',
|
||||
}).appendTo('body');
|
||||
a[0].click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
a.remove();
|
||||
},
|
||||
error: function () {
|
||||
alert('Error exporting the file.');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
$importButton.on('click', function (e) {
|
||||
e.preventDefault();
|
||||
const file = $importFileInput[0].files[0];
|
||||
if (file) {
|
||||
const formData = new FormData();
|
||||
formData.append('csvFile', file);
|
||||
formData.append('dpdshipping_token', dpdshipping_token);
|
||||
|
||||
$.ajax({
|
||||
url: dpdshipping_special_price_import_ajax_url,
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
location.reload();
|
||||
} else {
|
||||
alert('Import failed: ' + response.message);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
alert('Error importing the file.');
|
||||
},
|
||||
});
|
||||
} else {
|
||||
alert('Please select a file first.');
|
||||
}
|
||||
});
|
||||
|
||||
const rowsPerPage = 50;
|
||||
|
||||
function showPage(page) {
|
||||
|
||||
const $tbody = $('#specialPriceTable').find('tbody');
|
||||
const $rows = $tbody.find('tr');
|
||||
const totalRows = $rows.length;
|
||||
const totalPages = Math.ceil(totalRows / rowsPerPage);
|
||||
|
||||
if (page < 1) page = 1;
|
||||
if (page > totalPages) page = totalPages;
|
||||
|
||||
$rows.hide();
|
||||
|
||||
const start = (page - 1) * rowsPerPage;
|
||||
const end = start + rowsPerPage;
|
||||
|
||||
$rows.slice(start, end).show();
|
||||
|
||||
$('.pagination-button').removeClass('active');
|
||||
$(`.pagination-button[data-page='${page}']`).addClass('active');
|
||||
|
||||
updatePaginationInfo(page, totalPages, rowsPerPage, totalRows);
|
||||
}
|
||||
|
||||
function updatePaginationInfo(page, totalPages, rowsPerPage, totalRows) {
|
||||
const startRow = (page - 1) * rowsPerPage + 1;
|
||||
let endRow = page * rowsPerPage;
|
||||
if (endRow > totalRows) endRow = totalRows;
|
||||
|
||||
$('#pagination-info-rows-from').text(startRow);
|
||||
$('#pagination-info-rows-to').text(endRow);
|
||||
$('#pagination-info-pages').text(totalRows);
|
||||
}
|
||||
|
||||
function createPagination() {
|
||||
const $pagination = $('#dpdSpecialPricePagination');
|
||||
$pagination.empty();
|
||||
|
||||
const $tbody = $('#specialPriceTable').find('tbody');
|
||||
const $rows = $tbody.find('tr');
|
||||
const totalRows = $rows.length;
|
||||
const totalPages = Math.ceil(totalRows / rowsPerPage);
|
||||
|
||||
const $prev = $('<a href="#" class="pagination-button">Prev</a>');
|
||||
if (currentPage === 1) {
|
||||
$prev.addClass('disabled');
|
||||
}
|
||||
$pagination.append($prev);
|
||||
|
||||
let startPage = Math.max(1, currentPage - 2);
|
||||
let endPage = Math.min(totalPages, currentPage + 2);
|
||||
|
||||
if (currentPage <= 3) {
|
||||
endPage = Math.min(5, totalPages);
|
||||
}
|
||||
if (currentPage >= totalPages - 2) {
|
||||
startPage = Math.max(totalPages - 4, 1);
|
||||
}
|
||||
|
||||
if (startPage > 1) {
|
||||
const $first = $(`<a href="#" class="pagination-button" data-page="1">1</a>`);
|
||||
$pagination.append($first);
|
||||
if (startPage > 2) {
|
||||
$pagination.append('<span>...</span>');
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = startPage; i <= endPage; i++) {
|
||||
const $btn = $(`<a href="#" class="pagination-button" data-page="${i}">${i}</a>`);
|
||||
if (i === currentPage) $btn.addClass('active');
|
||||
$pagination.append($btn);
|
||||
}
|
||||
|
||||
if (endPage < totalPages) {
|
||||
if (endPage < totalPages - 1) {
|
||||
$pagination.append('<span>...</span>');
|
||||
}
|
||||
const $last = $(`<a href="#" class="pagination-button" data-page="${totalPages}">${totalPages}</a>`);
|
||||
$pagination.append($last);
|
||||
}
|
||||
|
||||
const $next = $('<a href="#" class="pagination-button">Next</a>');
|
||||
if (currentPage === totalPages) {
|
||||
$next.addClass('disabled');
|
||||
}
|
||||
$pagination.append($next);
|
||||
|
||||
if (currentPage === endPage) {
|
||||
$('#addFidRow').show();
|
||||
} else {
|
||||
$('#addFidRow').hide();
|
||||
}
|
||||
}
|
||||
|
||||
let currentPage = 1;
|
||||
|
||||
showPage(currentPage);
|
||||
|
||||
createPagination();
|
||||
|
||||
$('#dpdSpecialPricePagination').on('click', '.pagination-button', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if ($(this).hasClass('disabled') || $(this).hasClass('active')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const $tbody = $('#specialPriceTable').find('tbody');
|
||||
const $rows = $tbody.find('tr');
|
||||
const totalRows = $rows.length;
|
||||
const totalPages = Math.ceil(totalRows / rowsPerPage);
|
||||
|
||||
const buttonText = $(this).text();
|
||||
|
||||
if (buttonText === 'Prev') {
|
||||
if (currentPage > 1) {
|
||||
currentPage--;
|
||||
}
|
||||
} else if (buttonText === 'Next') {
|
||||
if (currentPage < totalPages) {
|
||||
currentPage++;
|
||||
}
|
||||
} else {
|
||||
currentPage = parseInt($(this).attr('data-page'));
|
||||
}
|
||||
|
||||
showPage(currentPage);
|
||||
createPagination();
|
||||
});
|
||||
});
|
||||
86
modules/dpdshipping/views/js/configuration/special-price.js
Normal file
86
modules/dpdshipping/views/js/configuration/special-price.js
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(() => {
|
||||
|
||||
$(document).on('click', '#addFidRow', function () {
|
||||
const parentContainer = $("#specialPriceTable tbody tr:last");
|
||||
const clonedRow = parentContainer.clone();
|
||||
|
||||
setIndexForNewRow(clonedRow, true);
|
||||
clonedRow.insertAfter(parentContainer);
|
||||
});
|
||||
|
||||
$(document).on('click', '.dpdshipping-remove-row', function () {
|
||||
$(this).closest('tr').remove();
|
||||
|
||||
$("#specialPriceTable tbody tr").each(function (index) {
|
||||
function setIndexesAfterRemoveRow() {
|
||||
const currentName = $(this).attr('name');
|
||||
const matches = currentName.match(/\[(\d+)\]/);
|
||||
if (matches) {
|
||||
const newIndex = index + 1;
|
||||
const newName = currentName.replace(/\[(\d+)\]/, '[' + newIndex + ']');
|
||||
$(this).attr('name', newName);
|
||||
}
|
||||
}
|
||||
|
||||
$(this).find('input').each(function () {
|
||||
setIndexesAfterRemoveRow.call(this);
|
||||
});
|
||||
|
||||
$(this).find('select').each(function () {
|
||||
setIndexesAfterRemoveRow.call(this);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', '.dpdshipping-duplicate-row', function () {
|
||||
const parentContainer = $(this).closest('tr');
|
||||
const clonedRow = parentContainer.clone();
|
||||
|
||||
setIndexForNewRow(clonedRow, false);
|
||||
const lastRow = $("#specialPriceTable tbody tr:last");
|
||||
clonedRow.insertAfter(lastRow);
|
||||
});
|
||||
|
||||
function setIndexForNewRow(clonedRow, emptyValue) {
|
||||
function setIndexes() {
|
||||
const index = parseInt($("#specialPriceTable tbody tr").length) + 1;
|
||||
const currentName = $(this).attr('name');
|
||||
const newName = currentName.replace(/\[(\d+)\]/, '[' + index + ']');
|
||||
$(this).attr('name', newName);
|
||||
if (emptyValue)
|
||||
$(this).val('');
|
||||
}
|
||||
|
||||
clonedRow.find('input').each(function () {
|
||||
setIndexes.call(this);
|
||||
});
|
||||
|
||||
clonedRow.find('select').each(function () {
|
||||
setIndexes.call(this);
|
||||
});
|
||||
}
|
||||
});
|
||||
201
modules/dpdshipping/views/js/dpdshipping-ajax.js
Normal file
201
modules/dpdshipping/views/js/dpdshipping-ajax.js
Normal file
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
function downloadFile(xhr, response) {
|
||||
const contentType = xhr.getResponseHeader('Content-Type');
|
||||
const fileName = getFileName(xhr);
|
||||
const blob = new Blob([response], {type: contentType});
|
||||
const link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
|
||||
function getFileName(xhr) {
|
||||
const contentDisposition = xhr.getResponseHeader('Content-Disposition');
|
||||
let fileName = 'downloaded-file';
|
||||
|
||||
if (contentDisposition && contentDisposition.indexOf('attachment') !== -1) {
|
||||
const filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
|
||||
const matches = filenameRegex.exec(contentDisposition);
|
||||
if (matches != null && matches[1]) {
|
||||
fileName = matches[1].replace(/['"]/g, '');
|
||||
}
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
|
||||
$('#print-label').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
const shippingHistoryId = $(this).data('shipping-history-id');
|
||||
const url = $(this).data('url');
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: 'POST',
|
||||
data: {
|
||||
shippingHistoryId: shippingHistoryId,
|
||||
token: dpdshipping_token
|
||||
},
|
||||
xhrFields: {
|
||||
responseType: 'blob'
|
||||
},
|
||||
success: function (response, status, xhr) {
|
||||
downloadFile(xhr, response);
|
||||
$('.alert-messages').hide();
|
||||
$('.success-message-ajax').text(dpdshipping_translations.dpdshipping_label_success_text).show();
|
||||
$('.error-message-ajax').hide();
|
||||
},
|
||||
error: function () {
|
||||
handleErrorResponse(dpdshipping_translations.dpdshipping_label_error_text);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#print-return-label').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
const shippingHistoryId = $(this).data('shipping-history-id');
|
||||
const orderId = $(this).data('order-id');
|
||||
const url = $(this).data('url');
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: 'POST',
|
||||
data: {
|
||||
shippingHistoryId: shippingHistoryId,
|
||||
orderId: orderId,
|
||||
token: dpdshipping_token
|
||||
},
|
||||
xhrFields: {
|
||||
responseType: 'blob'
|
||||
},
|
||||
success: function (response, status, xhr) {
|
||||
downloadFile(xhr, response);
|
||||
$('.alert-messages').hide();
|
||||
$('.success-message-ajax').text(dpdshipping_translations.dpdshipping_return_label_success_text).show();
|
||||
$('.error-message-ajax').hide();
|
||||
},
|
||||
error: function () {
|
||||
handleErrorResponse(dpdshipping_translations.dpdshipping_return_label_error_text);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function handleErrorResponse(message) {
|
||||
$('.alert-messages').hide();
|
||||
$('.success-message-ajax').hide();
|
||||
$('.error-message-ajax').text(message).show();
|
||||
}
|
||||
|
||||
const $dpdConn = $('.js-dpd-connection');
|
||||
const $dpdPayer = $('.js-dpd-payer');
|
||||
if ($dpdConn.length === 0 || $dpdPayer.length === 0) return;
|
||||
|
||||
const dpdOriginalByLabel = Object.create(null);
|
||||
let dpdPlaceholder = null;
|
||||
|
||||
$dpdPayer.find('option').each((_, el) => {
|
||||
const $opt = $(el);
|
||||
const val = String($opt.attr('value') ?? '');
|
||||
const text = $opt.text();
|
||||
if (val === '') {
|
||||
dpdPlaceholder = { value: '', text: text || '—' };
|
||||
} else {
|
||||
dpdOriginalByLabel[text] = val;
|
||||
}
|
||||
});
|
||||
|
||||
let dpdPayersByConn = {};
|
||||
try {
|
||||
let dpdRaw = $dpdConn.attr('data-payers') || '{}';
|
||||
if (dpdRaw.includes('"') || dpdRaw.includes(''') || dpdRaw.includes('&')) {
|
||||
dpdRaw = dpdRaw.replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, '&');
|
||||
}
|
||||
dpdPayersByConn = JSON.parse(dpdRaw);
|
||||
} catch {
|
||||
dpdPayersByConn = {};
|
||||
}
|
||||
|
||||
const dpdFillPayers = () => {
|
||||
const dpdConnId = String($dpdConn.val() || '');
|
||||
const dpdMap = dpdPayersByConn[dpdConnId] || {};
|
||||
const dpdLabels = Object.keys(dpdMap);
|
||||
const dpdRemembered = String($dpdPayer.val() || $dpdPayer.attr('data-selected') || '');
|
||||
|
||||
$dpdPayer.empty();
|
||||
|
||||
if (dpdLabels.length === 0) {
|
||||
const text = dpdPlaceholder?.text ?? '—';
|
||||
$('<option/>', { value: '', text }).appendTo($dpdPayer);
|
||||
$dpdPayer.prop('disabled', true);
|
||||
return;
|
||||
}
|
||||
|
||||
$dpdPayer.prop('disabled', false);
|
||||
|
||||
let dpdSelectedSet = false;
|
||||
|
||||
if (dpdPlaceholder) {
|
||||
$('<option/>', { value: '', text: dpdPlaceholder.text }).appendTo($dpdPayer);
|
||||
}
|
||||
|
||||
for (const label of dpdLabels) {
|
||||
const originalVal = String(dpdOriginalByLabel[label] ?? '');
|
||||
const isSelected = !dpdSelectedSet && originalVal !== '' && originalVal === dpdRemembered;
|
||||
|
||||
$('<option/>', {
|
||||
value: originalVal || '',
|
||||
text: label,
|
||||
selected: isSelected
|
||||
}).appendTo($dpdPayer);
|
||||
|
||||
if (isSelected) dpdSelectedSet = true;
|
||||
}
|
||||
|
||||
if (!dpdSelectedSet) {
|
||||
const firstIndex = dpdPlaceholder ? 1 : 0;
|
||||
const $opts = $dpdPayer.find('option');
|
||||
if ($opts.length > firstIndex) $opts.eq(firstIndex).prop('selected', true);
|
||||
}
|
||||
|
||||
$dpdPayer.attr('data-selected', '');
|
||||
};
|
||||
|
||||
dpdFillPayers();
|
||||
|
||||
$dpdConn.on('change', () => {
|
||||
$dpdPayer.attr('data-selected', String($dpdPayer.val() || ''));
|
||||
dpdFillPayers();
|
||||
});
|
||||
|
||||
$dpdPayer.closest('form').on('submit', () => {
|
||||
$dpdPayer.prop('disabled', false);
|
||||
});
|
||||
});
|
||||
195
modules/dpdshipping/views/js/dpdshipping-common.js
Normal file
195
modules/dpdshipping/views/js/dpdshipping-common.js
Normal file
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
// noinspection JSUnresolvedReference
|
||||
|
||||
$(document).ready(function () {
|
||||
handleDpdShippingPudo();
|
||||
$(document).on('click', '.delivery_option_radio', handleDpdShippingPudo);
|
||||
$(document).on('click', 'input[name^="delivery_option"]', handleDpdShippingPudo);
|
||||
|
||||
$('.dpdshipping-pudo-container').parent().css('border-right', '0');
|
||||
$('.dpdshipping-pudo-cod-container').parent().css('border-right', '0');
|
||||
$('.dpdshipping-pudo-swipbox-container').parent().css('border-right', '0');
|
||||
|
||||
$(document).on('click', '.dpdshipping-pudo-open-map-btn', (e) => showModal(e, '#dpdshippingPudoModal'));
|
||||
$(document).on('click', '.dpdshipping-pudo-change-map-btn', (e) => showModal(e, '#dpdshippingPudoModal'));
|
||||
|
||||
$(document).on('click', '.dpdshipping-pudo-cod-open-map-btn', (e) => showModal(e, '#dpdshippingPudoCodModal'));
|
||||
$(document).on('click', '.dpdshipping-pudo-cod-change-map-btn', (e) => showModal(e, '#dpdshippingPudoCodModal'));
|
||||
|
||||
$(document).on('click', '.dpdshipping-pudo-swipbox-open-map-btn', (e) => showModal(e, '#dpdshippingPudoSwipBoxModal'));
|
||||
$(document).on('click', '.dpdshipping-pudo-swipbox-change-map-btn', (e) => showModal(e, '#dpdshippingPudoSwipBoxModal'));
|
||||
});
|
||||
|
||||
function dpdshippingSavePudoCode(pudoCode, modal) {
|
||||
$.ajax({
|
||||
url: dpdshipping_pickup_save_point_ajax_url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
dpdshipping_token: dpdshipping_token,
|
||||
dpdshipping_csrf: dpdshipping_csrf,
|
||||
dpdshipping_id_cart: dpdshipping_id_cart,
|
||||
dpdshipping_pudo_code: pudoCode
|
||||
},
|
||||
success: function (response) {
|
||||
const resultJson = JSON.parse(response)
|
||||
if (resultJson.success) {
|
||||
$('.dpdshipping-pudo-new-point').css("display", "none");
|
||||
$('.dpdshipping-pudo-selected-point').css("display", "block");
|
||||
dpdshippingEnableOrderProcessBtn();
|
||||
} else {
|
||||
$('.container_dpdshipping_pudo_error').css("display", "block");
|
||||
dpdshippingDisableOrderProcessBtn();
|
||||
console.error('Error:', response);
|
||||
}
|
||||
hideModal(modal);
|
||||
},
|
||||
error: function (error) {
|
||||
console.log('Error:', error);
|
||||
hideModal(modal);
|
||||
}
|
||||
});
|
||||
|
||||
function hideModal(modal) {
|
||||
setTimeout(() => {
|
||||
modal.modal('toggle');
|
||||
$(".modal-backdrop").hide();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function dpdshippingGetPudoAddress(pudoCode, input) {
|
||||
$.ajax({
|
||||
url: dpdshipping_pickup_get_address_ajax_url,
|
||||
type: 'GET',
|
||||
data: {
|
||||
dpdshipping_token: dpdshipping_token,
|
||||
dpdshipping_csrf: dpdshipping_csrf,
|
||||
dpdshipping_pudo_code: pudoCode
|
||||
},
|
||||
success: function (response) {
|
||||
const resultJson = JSON.parse(response)
|
||||
if (resultJson.success && resultJson.data)
|
||||
input.text(resultJson.data);
|
||||
else
|
||||
console.log('Error:', response);
|
||||
},
|
||||
error: function (error) {
|
||||
console.log('Error:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showModal(a, b) {
|
||||
let el;
|
||||
if (a instanceof Event) {
|
||||
a.preventDefault(); a.stopPropagation();
|
||||
el = typeof b === 'string' ? document.querySelector(b) : b;
|
||||
} else {
|
||||
el = typeof a === 'string' ? document.querySelector(a) : a;
|
||||
}
|
||||
|
||||
if (!(el instanceof Element)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.bootstrap && window.bootstrap.Modal) {
|
||||
window.bootstrap.Modal.getOrCreateInstance(el, { backdrop: 'static', keyboard: false }).show();
|
||||
}
|
||||
else if (window.jQuery && jQuery.fn && jQuery.fn.modal &&
|
||||
jQuery.fn.modal.Constructor && /^4\./.test(String(jQuery.fn.modal.Constructor.VERSION || ''))) {
|
||||
jQuery(el).modal({ backdrop: 'static', keyboard: false });
|
||||
}
|
||||
else {
|
||||
el.style.display = 'block';
|
||||
el.classList.add('show');
|
||||
document.body.classList.add('modal-open');
|
||||
}
|
||||
|
||||
if (typeof handleDpdShippingPudo === 'function')
|
||||
handleDpdShippingPudo();
|
||||
}
|
||||
|
||||
function handleDpdShippingPudo() {
|
||||
|
||||
$('.container_dpdshipping_pudo_cod_error').css("display", "none");
|
||||
$('.container_dpdshipping_pudo_cod_warning').css("display", "none");
|
||||
|
||||
if (getDpdshippingSelectedCarrier() === getDpdshippingIdPudoCarrier()) {
|
||||
$('.dpdshipping-pudo-new-point').css("display", "block");
|
||||
$('.dpdshipping-pudo-selected-point').css("display", "none");
|
||||
|
||||
$('.dpdshipping-selected-point').text("");
|
||||
const dpdShippingWidgetPudoIframe = $("#dpdshiping-widget-pudo-iframe")
|
||||
dpdShippingWidgetPudoIframe.attr("src", dpdShippingWidgetPudoIframe.attr("src"));
|
||||
|
||||
dpdshippingDisableOrderProcessBtn();
|
||||
} else if (getDpdshippingSelectedCarrier() === getDpdshippingIdPudoCodCarrier()) {
|
||||
$('.dpdshipping-pudo-cod-new-point').css("display", "block");
|
||||
$('.dpdshipping-pudo-cod-selected-point').css("display", "none");
|
||||
|
||||
$('.dpdshipping-cod-selected-point').text("");
|
||||
const dpdShippingWidgetPudoCodIframe = $("#dpdshipping-widget-pudo-cod-iframe")
|
||||
dpdShippingWidgetPudoCodIframe.attr("src", dpdShippingWidgetPudoCodIframe.attr("src"));
|
||||
|
||||
dpdshippingDisableOrderProcessBtn();
|
||||
} else if (getDpdshippingSelectedCarrier() === getDpdshippingIdPudoSwipBoxCarrier()) {
|
||||
$('.dpdshipping-pudo-swipbox-new-point').css("display", "block");
|
||||
$('.dpdshipping-pudo-swipbox-selected-point').css("display", "none");
|
||||
|
||||
$('.dpdshipping-swipbox-selected-point').text("");
|
||||
const dpdShippingWidgetPudoSwipboxIframe = $("#dpdshipping-widget-pudo-swipbox-iframe")
|
||||
dpdShippingWidgetPudoSwipboxIframe.attr("src", dpdShippingWidgetPudoSwipboxIframe.attr("src"));
|
||||
|
||||
dpdshippingDisableOrderProcessBtn();
|
||||
} else {
|
||||
dpdshippingEnableOrderProcessBtn();
|
||||
}
|
||||
}
|
||||
|
||||
function getDpdshippingIdPudoCarrier() {
|
||||
return Number(dpdshipping_id_pudo_carrier);
|
||||
}
|
||||
|
||||
function getDpdshippingIdPudoCodCarrier() {
|
||||
return Number(dpdshipping_id_pudo_cod_carrier);
|
||||
}
|
||||
|
||||
function getDpdshippingIdPudoSwipBoxCarrier() {
|
||||
return Number(dpdshipping_id_pudo_swipbox_carrier);
|
||||
}
|
||||
|
||||
function getDpdshippingSelectedCarrier() {
|
||||
let idSelectedCarrier = $('input[name^="delivery_option"]:checked').val();
|
||||
|
||||
if (typeof idSelectedCarrier == 'undefined')
|
||||
return null;
|
||||
|
||||
idSelectedCarrier = idSelectedCarrier.replace(',', '');
|
||||
if (typeof idSelectedCarrier == 'undefined' || idSelectedCarrier === 0)
|
||||
return null;
|
||||
|
||||
return Number(idSelectedCarrier);
|
||||
}
|
||||
309
modules/dpdshipping/views/js/dpdshipping-pickup-courier-ajax.js
Normal file
309
modules/dpdshipping/views/js/dpdshipping-pickup-courier-ajax.js
Normal file
@@ -0,0 +1,309 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#form_dpdshipping_pickup_courier_sender_address').on('change', function (event) {
|
||||
event.preventDefault();
|
||||
$('.errorMessagePickupCourier').hide();
|
||||
const pickupOrderSettingsId = $(this).val();
|
||||
$('#senderAddressContainer').hide();
|
||||
$.ajax({
|
||||
url: dpdshipping_pickup_courier_ajax_url, method: 'GET', data: {
|
||||
pickupOrderSettingsId: pickupOrderSettingsId,
|
||||
token: dpdshipping_token
|
||||
}, success: function (response, status, xhr) {
|
||||
if (response.success === true && response.data !== null) {
|
||||
$('#form_customer_company').val(response.data.customerFullName);
|
||||
$('#form_customer_name').val(response.data.customerName);
|
||||
$('#form_customer_phone').val(response.data.customerPhone);
|
||||
$('#senderFullName').text(response.data.senderFullName);
|
||||
$('#senderName').text(response.data.senderName);
|
||||
$('#senderAddress').text(response.data.senderAddress);
|
||||
$('#senderPostalCode').text(response.data.senderPostalCode);
|
||||
$('#senderCity').text(response.data.senderCity);
|
||||
$('#senderCountryCode').text(response.data.senderCountryCode);
|
||||
$('#senderPhone').text(response.data.senderPhone);
|
||||
$('#payerNumber').text(response.data.payerNumber);
|
||||
$('#senderAddressContainer').show();
|
||||
} else if (response.success === false && response.errors && response.errors.length > 0) {
|
||||
$('.errorMessagePickupCourier').text(response.errors[0]);
|
||||
$('.errorMessagePickupCourier').show();
|
||||
} else {
|
||||
$('.errorMessagePickupCourier').text('Unknown error');
|
||||
$('.errorMessagePickupCourier').show();
|
||||
}
|
||||
}, error: function () {
|
||||
$('.errorMessagePickupCourier').text('Unknown error');
|
||||
$('.errorMessagePickupCourier').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#button_get_pickup_time_frames').on('click', function (event) {
|
||||
$('.errorMessagePickupCourier').hide();
|
||||
const pickupOrderSettingsId = $('#form_dpdshipping_pickup_courier_sender_address').val()
|
||||
const countryCode = $('#senderCountryCode').text()
|
||||
const postalCode = $('#senderPostalCode').text()
|
||||
|
||||
$('#pickupTimeContainer').hide();
|
||||
$.ajax({
|
||||
url: dpdshipping_pickup_courier_get_pickup_time_frames_ajax_url, method: 'GET', data: {
|
||||
pickupOrderSettingsId: pickupOrderSettingsId,
|
||||
countryCode: countryCode,
|
||||
postalCode: postalCode,
|
||||
token: dpdshipping_token
|
||||
}, success: function (response, status, xhr) {
|
||||
if (response.success === true && response.data !== null) {
|
||||
const select = $('#form_pickup_time');
|
||||
select.empty();
|
||||
|
||||
const currentTime = new Date();
|
||||
$.each(response.data, function (index, item) {
|
||||
function getEndTime() {
|
||||
const [startTime, endTime] = item.range.split('-');
|
||||
const [endHour, endMinute] = endTime.split(':');
|
||||
const endDate = new Date();
|
||||
endDate.setHours(parseInt(endHour));
|
||||
endDate.setMinutes(parseInt(endMinute));
|
||||
endDate.setSeconds(0);
|
||||
return endDate;
|
||||
}
|
||||
|
||||
const pickedDate = new Date($('#form_pickup_date').val());
|
||||
const isToday = pickedDate.toDateString() === currentTime.toDateString();
|
||||
const isAfterCurrentTime = getEndTime() > currentTime;
|
||||
|
||||
if ((isToday && isAfterCurrentTime) || !isToday) {
|
||||
const option = $('<option></option>')
|
||||
.attr('value', item.range)
|
||||
.text(item.range);
|
||||
select.append(option);
|
||||
}
|
||||
});
|
||||
|
||||
const jsonString = JSON.stringify(response.data);
|
||||
select.attr('data-timeframes', jsonString);
|
||||
select.val(response.data.length > 0 ? response.data[0].range : '').change();
|
||||
|
||||
$('#pickupTimeContainer').show();
|
||||
} else if (response.success === false && response.errors && response.errors.length > 0) {
|
||||
$('.errorMessagePickupCourier').text(response.errors[0]);
|
||||
$('.errorMessagePickupCourier').show();
|
||||
} else {
|
||||
$('.errorMessagePickupCourier').text('Unknown error');
|
||||
$('.errorMessagePickupCourier').show();
|
||||
}
|
||||
}, error: function () {
|
||||
$('.errorMessagePickupCourier').text('Unknown error');
|
||||
$('.errorMessagePickupCourier').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#pickup-courier-add-save-button').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
$('.errorMessagePickupCourier').hide();
|
||||
|
||||
const form = document.getElementById('dpdshipping_pickup_courier_form');
|
||||
|
||||
if (!form.checkValidity()) {
|
||||
form.reportValidity();
|
||||
return;
|
||||
}
|
||||
if (!validateAddPickupCourier())
|
||||
return;
|
||||
|
||||
|
||||
const pickupOrderSettingsId = $('#form_dpdshipping_pickup_courier_sender_address').val()
|
||||
|
||||
$.ajax({
|
||||
url: dpdshipping_pickup_courier_pickup_courier_ajax_url, method: 'POST', data: {
|
||||
pickupOrderSettingsId: pickupOrderSettingsId,
|
||||
customerFullName: $('#form_customer_company').val(),
|
||||
customerName: $('#form_customer_name').val(),
|
||||
customerPhone: $('#form_customer_phone').val(),
|
||||
senderFullName: $('#senderFullName').text(),
|
||||
senderName: $('#senderName').text(),
|
||||
senderAddress: $('#senderAddress').text(),
|
||||
senderPostalCode: $('#senderPostalCode').text(),
|
||||
senderCity: $('#senderCity').text(),
|
||||
senderCountryCode: $('#senderCountryCode').text(),
|
||||
senderPhone: $('#senderPhone').text(),
|
||||
payerNumber: $('#payerNumber').text(),
|
||||
payerName: "DPD_API",
|
||||
pickupDate: $('#form_pickup_date').val(),
|
||||
pickupTime: $('#form_pickup_time').val(),
|
||||
letters: $('#form_letters').is(':checked'),
|
||||
lettersCount: $('#form_letters_count').val(),
|
||||
packages: $('#form_packages').is(':checked'),
|
||||
packagesCount: $('#form_packages_count').val(),
|
||||
packagesWeightSum: $('#form_packages_weight_sum').val(),
|
||||
packagesWeightMax: $('#form_packages_weight_max').val(),
|
||||
packagesSizeXMax: $('#form_packages_size_x_max').val(),
|
||||
packagesSizeYMax: $('#form_packages_size_y_max').val(),
|
||||
packagesSizeZMax: $('#form_packages_size_z_max').val(),
|
||||
palette: $('#form_palette').is(':checked'),
|
||||
paletteCount: $('#form_palette_count').val(),
|
||||
paletteWeightSum: $('#form_palette_weight_sum').val(),
|
||||
paletteWeightMx: $('#form_palette_weight_max').val(),
|
||||
paletteSizeYMax: $('#form_palette_size_y_max').val(),
|
||||
token: dpdshipping_token
|
||||
}, success: function (response, status, xhr) {
|
||||
if (response.success === true && response.data !== null) {
|
||||
window.location.href = response.data.redirectPath;
|
||||
} else if (response.success === false && response.errors && response.errors.length > 0) {
|
||||
$('.errorMessagePickupCourier').text(response.errors[0]);
|
||||
$('.errorMessagePickupCourier').show();
|
||||
} else {
|
||||
$('.errorMessagePickupCourier').text('Unknown error');
|
||||
$('.errorMessagePickupCourier').show();
|
||||
}
|
||||
}, error: function () {
|
||||
$('.errorMessagePickupCourier').text('Unknown error');
|
||||
$('.errorMessagePickupCourier').show();
|
||||
}
|
||||
});
|
||||
|
||||
function isEmptyInputData(fields) {
|
||||
return fields.some(function (selector) {
|
||||
return !$.trim($(selector).val()) && !$.trim($(selector).text());
|
||||
});
|
||||
}
|
||||
|
||||
function validateAddPickupCourier() {
|
||||
function showError(errorMsg) {
|
||||
$('.errorMessagePickupCourier').text(errorMsg);
|
||||
$('.errorMessagePickupCourier').show();
|
||||
}
|
||||
|
||||
if (isEmptyInputData([
|
||||
'#form_customer_company',
|
||||
'#form_customer_name',
|
||||
'#form_customer_phone'])) {
|
||||
showError(dpdshipping_pickup_courier_pickup_courier_ajax_empty_customer);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isEmptyInputData([
|
||||
'#senderFullName',
|
||||
'#senderName',
|
||||
'#senderAddress',
|
||||
'#senderPostalCode',
|
||||
'#senderCity',
|
||||
'#senderCountryCode',
|
||||
'#senderPhone',
|
||||
])) {
|
||||
showError(dpdshipping_pickup_courier_pickup_courier_ajax_empty_sender);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isEmptyInputData([
|
||||
'#payerNumber',
|
||||
])) {
|
||||
showError(dpdshipping_pickup_courier_pickup_courier_ajax_empty_payer);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isEmptyInputData([
|
||||
'#form_pickup_date',
|
||||
'#form_pickup_time',
|
||||
])) {
|
||||
showError(dpdshipping_pickup_courier_pickup_courier_ajax_empty_pickup_date_time);
|
||||
return false;
|
||||
}
|
||||
if (!$('#form_letters').is(':checked') &&
|
||||
!$('#form_packages').is(':checked') &&
|
||||
!$('#form_palette').is(':checked')) {
|
||||
showError(dpdshipping_pickup_courier_pickup_courier_ajax_empty_parcel);
|
||||
return false;
|
||||
}
|
||||
if ($('#form_letters').is(':checked')) {
|
||||
if (isEmptyInputData([
|
||||
'#form_letters_count',
|
||||
])) {
|
||||
showError(dpdshipping_pickup_courier_pickup_courier_ajax_empty_letters);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($('#form_packages').is(':checked')) {
|
||||
if (isEmptyInputData([
|
||||
'#form_packages_count',
|
||||
'#form_packages_weight_sum',
|
||||
'#form_packages_weight_max',
|
||||
'#form_packages_size_x_max',
|
||||
'#form_packages_size_y_max',
|
||||
'#form_packages_size_z_max',
|
||||
])) {
|
||||
showError(dpdshipping_pickup_courier_pickup_courier_ajax_empty_packages);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($('#form_palette').is(':checked')) {
|
||||
if (isEmptyInputData([
|
||||
'#form_palette_count',
|
||||
'#form_palette_weight_sum',
|
||||
'#form_palette_weight_max',
|
||||
'#form_palette_size_y_max'
|
||||
])) {
|
||||
showError(dpdshipping_pickup_courier_pickup_courier_ajax_empty_palette);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
$('#form_pickup_time').on('change', function (event) {
|
||||
const selectedRange = $(this).val();
|
||||
const timeFrames = $('#form_pickup_time').data('timeframes');
|
||||
const selectedTimeFrame = timeFrames.find(tf => tf.range === selectedRange);
|
||||
|
||||
function getFormatedHour() {
|
||||
const rangeParts = selectedTimeFrame.range.split('-');
|
||||
const startTime = rangeParts[0];
|
||||
|
||||
const startDate = new Date();
|
||||
const [startHour, startMinute] = startTime.split(':');
|
||||
startDate.setHours(parseInt(startHour));
|
||||
startDate.setMinutes(parseInt(startMinute));
|
||||
startDate.setSeconds(0);
|
||||
|
||||
const offsetDate = new Date(startDate.getTime() - selectedTimeFrame.offset * 60000);
|
||||
|
||||
const offsetHour = offsetDate.getHours().toString().padStart(2, '0');
|
||||
const offsetMinute = offsetDate.getMinutes().toString().padStart(2, '0');
|
||||
return `${offsetHour}:${offsetMinute}`;
|
||||
}
|
||||
|
||||
if (selectedTimeFrame) {
|
||||
$('#timeFrameHour').text(getFormatedHour());
|
||||
$('#timeFrameDate').text($('#form_pickup_date').val());
|
||||
} else {
|
||||
console.error('No matching time frame found for the selected range:', selectedRange);
|
||||
}
|
||||
});
|
||||
});
|
||||
114
modules/dpdshipping/views/js/dpdshipping-pickup-courier.js
Normal file
114
modules/dpdshipping/views/js/dpdshipping-pickup-courier.js
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
setLetterFields($('#form_letters'))
|
||||
setPackageFields($('#form_packages'))
|
||||
setPaletteFields($('#form_palette'))
|
||||
|
||||
$(document).on('change', '#form_letters', function () {
|
||||
setLetterFields($('#form_letters'));
|
||||
});
|
||||
|
||||
$(document).on('change', '#form_packages', function () {
|
||||
setPackageFields($('#form_packages'));
|
||||
});
|
||||
|
||||
$(document).on('change', '#form_palette', function () {
|
||||
setPaletteFields($('#form_palette'));
|
||||
});
|
||||
|
||||
|
||||
function checkConfigurationWarning() {
|
||||
if ($('#form_dpdshipping_pickup_courier_sender_address option').length <= 1) {
|
||||
$('.warnMessagePickupCourier').text(dpdshipping_pickup_courier_pickup_courier_empty_configuration);
|
||||
$('.warnMessagePickupCourier').show();
|
||||
}
|
||||
}
|
||||
|
||||
checkConfigurationWarning()
|
||||
|
||||
function setLetterFields(input) {
|
||||
function getLetterFields() {
|
||||
return $("label[for='form_letters_count'], #form_letters_count");
|
||||
}
|
||||
|
||||
if (input.is(':checked')) {
|
||||
getLetterFields().show();
|
||||
$('#form_palette').prop("checked", false);
|
||||
$('#form_packages').prop("checked", false);
|
||||
} else {
|
||||
getLetterFields().hide();
|
||||
$('#form_letters_count').val(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
function setPackageFields(input) {
|
||||
function getPackagesFields() {
|
||||
return $(
|
||||
"label[for='form_packages_count'], #form_packages_count, " +
|
||||
"label[for='form_packages_weight_sum'], #form_packages_weight_sum, " +
|
||||
"label[for='form_packages_weight_max'], #form_packages_weight_max, " +
|
||||
"label[for='form_packages_size_x_max'], #form_packages_size_x_max, " +
|
||||
"label[for='form_packages_size_y_max'], #form_packages_size_y_max, " +
|
||||
"label[for='form_packages_size_z_max'], #form_packages_size_z_max");
|
||||
}
|
||||
|
||||
if (input.is(':checked')) {
|
||||
getPackagesFields().show();
|
||||
$('#form_letters').prop("checked", false);
|
||||
$('#form_palette').prop("checked", false);
|
||||
} else {
|
||||
getPackagesFields().hide();
|
||||
$('#form_packages_count').val(undefined);
|
||||
$('#form_packages_weight_sum').val(undefined);
|
||||
$('#form_packages_weight_max').val(undefined);
|
||||
$('#form_packages_size_x_max').val(undefined);
|
||||
$('#form_packages_size_y_max').val(undefined);
|
||||
$('#form_packages_size_z_max').val(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
function setPaletteFields(input) {
|
||||
function getPaletteFields() {
|
||||
return $(
|
||||
"label[for='form_palette_count'], #form_palette_count, " +
|
||||
"label[for='form_palette_weight_sum'], #form_palette_weight_sum, " +
|
||||
"label[for='form_palette_weight_max'], #form_palette_weight_max, " +
|
||||
"label[for='form_palette_size_y_max'], #form_palette_size_y_max");
|
||||
}
|
||||
|
||||
if (input.is(':checked')) {
|
||||
getPaletteFields().show();
|
||||
$('#form_letters').prop("checked", false);
|
||||
$('#form_packages').prop("checked", false);
|
||||
} else {
|
||||
getPaletteFields().hide();
|
||||
$('#form_palette_count').val(undefined);
|
||||
$('#form_palette_weight_sum').val(undefined);
|
||||
$('#form_palette_weight_max').val(undefined);
|
||||
$('#form_palette_size_y_max').val(undefined);
|
||||
}
|
||||
}
|
||||
});
|
||||
216
modules/dpdshipping/views/js/dpdshipping-pudo-cod-iframe.js
Normal file
216
modules/dpdshipping/views/js/dpdshipping-pudo-cod-iframe.js
Normal file
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
// noinspection JSUnresolvedReference
|
||||
|
||||
console.log('[DPD Pudo COD] Skrypt załadowany');
|
||||
|
||||
if (typeof dpsShippingCodEventCreated == 'undefined') {
|
||||
var dpsShippingCodEventCreated = false;
|
||||
}
|
||||
|
||||
if (typeof dpsShippingCodIframeCreated == 'undefined') {
|
||||
var dpsShippingCodIframeCreated = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tworzy iframe dla mapy PUDO COD
|
||||
*/
|
||||
function dpsShippingCodCreateIframe() {
|
||||
console.log('[DPD Pudo COD] Próba utworzenia iframe...');
|
||||
|
||||
// Sprawdź czy iframe już istnieje
|
||||
if (document.getElementById("dpdshipping-widget-pudo-cod-iframe")) {
|
||||
console.log('[DPD Pudo COD] Iframe już istnieje');
|
||||
return true;
|
||||
}
|
||||
|
||||
// Walidacja: sprawdź czy URL iframe jest zdefiniowany
|
||||
if (typeof dpdshipping_iframe_cod_url === 'undefined' || !dpdshipping_iframe_cod_url) {
|
||||
console.error('[DPD Pudo COD] Błąd: dpdshipping_iframe_cod_url nie jest zdefiniowany lub jest pusty');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Walidacja: sprawdź czy element docelowy istnieje
|
||||
var dpsShippingCod_script = document.getElementById("dpdshipping-widget-pudo-cod");
|
||||
if (!dpsShippingCod_script) {
|
||||
console.error('[DPD Pudo COD] Błąd: Nie znaleziono elementu #dpdshipping-widget-pudo-cod');
|
||||
return false;
|
||||
}
|
||||
|
||||
var dpsShippingCod_iframe = document.createElement("iframe");
|
||||
dpsShippingCod_iframe.setAttribute("id", "dpdshipping-widget-pudo-cod-iframe");
|
||||
dpsShippingCod_iframe.setAttribute("allow", "geolocation");
|
||||
dpsShippingCod_iframe.style.width = "100%";
|
||||
dpsShippingCod_iframe.style.border = "none";
|
||||
dpsShippingCod_iframe.style.minHeight = "400px";
|
||||
dpsShippingCod_iframe.style.height = "768px";
|
||||
|
||||
dpsShippingCod_iframe.onerror = function() {
|
||||
console.error('[DPD Pudo COD] Błąd ładowania iframe');
|
||||
};
|
||||
|
||||
dpsShippingCod_iframe.onload = function() {
|
||||
console.log('[DPD Pudo COD] Iframe załadowany pomyślnie');
|
||||
};
|
||||
|
||||
dpsShippingCod_iframe.src = dpdshipping_iframe_cod_url;
|
||||
|
||||
dpsShippingCod_script.parentNode.insertBefore(dpsShippingCod_iframe, dpsShippingCod_script);
|
||||
console.log('[DPD Pudo COD] Iframe dodany do DOM, URL:', dpdshipping_iframe_cod_url);
|
||||
|
||||
window.dpsShippingCod_iframe = dpsShippingCod_iframe;
|
||||
dpsShippingCodIframeCreated = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Obserwator DOM
|
||||
function dpsShippingCodObserveDOM() {
|
||||
if (document.getElementById("dpdshipping-widget-pudo-cod")) {
|
||||
console.log('[DPD Pudo COD] Element znaleziony w DOM');
|
||||
dpsShippingCodCreateIframe();
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof MutationObserver !== 'undefined') {
|
||||
console.log('[DPD Pudo COD] Uruchamiam MutationObserver...');
|
||||
var observer = new MutationObserver(function() {
|
||||
if (document.getElementById("dpdshipping-widget-pudo-cod")) {
|
||||
console.log('[DPD Pudo COD] Element pojawił się w DOM (MutationObserver)');
|
||||
observer.disconnect();
|
||||
dpsShippingCodCreateIframe();
|
||||
}
|
||||
});
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
|
||||
setTimeout(function() {
|
||||
observer.disconnect();
|
||||
}, 30000);
|
||||
}
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('[DPD Pudo COD] DOMContentLoaded');
|
||||
dpsShippingCodObserveDOM();
|
||||
});
|
||||
} else {
|
||||
console.log('[DPD Pudo COD] DOM już załadowany');
|
||||
dpsShippingCodObserveDOM();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
console.log('[DPD Pudo COD] jQuery ready');
|
||||
|
||||
$(document).on('click', '.dpdshipping-pudo-cod-open-map-btn, .dpdshipping-pudo-cod-change-map-btn', function() {
|
||||
console.log('[DPD Pudo COD] Kliknięto przycisk otwierania mapy');
|
||||
setTimeout(function() {
|
||||
dpsShippingCodCreateIframe();
|
||||
}, 200);
|
||||
});
|
||||
|
||||
$(document).on('show.bs.modal shown.bs.modal', '#dpdshippingPudoCodModal', function() {
|
||||
console.log('[DPD Pudo COD] Modal pokazywany');
|
||||
dpsShippingCodCreateIframe();
|
||||
});
|
||||
});
|
||||
|
||||
if (!dpsShippingCodEventCreated) {
|
||||
var dpsShippingCod_eventListener = window[window.addEventListener ? "addEventListener" : "attachEvent"];
|
||||
var dpsShippingCod_messageEvent = ("attachEvent" === dpsShippingCod_eventListener) ? "onmessage" : "message";
|
||||
dpsShippingCod_eventListener(dpsShippingCod_messageEvent, function (a) {
|
||||
if (typeof getDpdshippingIdPudoCodCarrier !== 'function' || typeof getDpdshippingSelectedCarrier !== 'function') {
|
||||
return;
|
||||
}
|
||||
if (getDpdshippingIdPudoCodCarrier() === getDpdshippingSelectedCarrier()) {
|
||||
var iframe = window.dpsShippingCod_iframe || document.getElementById("dpdshipping-widget-pudo-cod-iframe");
|
||||
if (a.data && a.data.height && !isNaN(a.data.height)) {
|
||||
if (iframe) {
|
||||
iframe.style.height = a.data.height + "px";
|
||||
}
|
||||
} else if (a.data && a.data.point_id) {
|
||||
dpdShippingCodPointSelected(a.data.point_id);
|
||||
}
|
||||
}
|
||||
}, !1);
|
||||
dpsShippingCodEventCreated = true;
|
||||
}
|
||||
|
||||
function dpdShippingCodPointSelected(pudoCode) {
|
||||
if (!pudoCode) {
|
||||
console.error('[DPD Pudo COD] Błąd: Brak kodu punktu');
|
||||
return;
|
||||
}
|
||||
|
||||
$('.container_dpdshipping_pudo_cod_error').css("display", "none");
|
||||
$('.dpdshipping-pudo-cod-new-point').css("display", "none");
|
||||
$('.dpdshipping-pudo-cod-selected-point').css("display", "block");
|
||||
|
||||
if (typeof dpdshippingSavePudoCode === 'function') {
|
||||
dpdshippingSavePudoCode(pudoCode, $('#dpdshippingPudoCodModal'));
|
||||
}
|
||||
|
||||
if (typeof dpdshippingGetPudoAddress === 'function') {
|
||||
dpdshippingGetPudoAddress(pudoCode, $('.dpdshipping-cod-selected-point'));
|
||||
}
|
||||
|
||||
if (typeof dpdshippingIsPointWithCod === 'function') {
|
||||
dpdshippingIsPointWithCod(pudoCode);
|
||||
} else {
|
||||
dpdshippingIsPointWithCodInternal(pudoCode);
|
||||
}
|
||||
|
||||
console.log('[DPD Pudo COD] Wybrano punkt:', pudoCode);
|
||||
}
|
||||
|
||||
function dpdshippingIsPointWithCodInternal(pudoCode) {
|
||||
if (typeof dpdshipping_pickup_is_point_with_cod_ajax_url === 'undefined') {
|
||||
console.error('[DPD Pudo COD] Brak URL dla sprawdzenia COD');
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: dpdshipping_pickup_is_point_with_cod_ajax_url,
|
||||
type: 'GET',
|
||||
data: {
|
||||
dpdshipping_token: dpdshipping_token,
|
||||
dpdshipping_csrf: dpdshipping_csrf,
|
||||
dpdshipping_pudo_code: pudoCode
|
||||
},
|
||||
success: function (response) {
|
||||
var resultJson = JSON.parse(response);
|
||||
if (resultJson.success && resultJson.data && Number(resultJson.data) === 1) {
|
||||
$('.container_dpdshipping_pudo_cod_warning').css("display", "none");
|
||||
} else {
|
||||
$('.container_dpdshipping_pudo_cod_warning').css("display", "block");
|
||||
if (typeof dpdshippingDisableOrderProcessBtn === 'function') {
|
||||
dpdshippingDisableOrderProcessBtn();
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (error) {
|
||||
console.error('[DPD Pudo COD] Błąd sprawdzania COD:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
30
modules/dpdshipping/views/js/dpdshipping-pudo-default.js
Normal file
30
modules/dpdshipping/views/js/dpdshipping-pudo-default.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
function dpdshippingDisableOrderProcessBtn() {
|
||||
$('button[name="confirmDeliveryOption"]').attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
function dpdshippingEnableOrderProcessBtn() {
|
||||
$('button[name="confirmDeliveryOption"]').removeAttr('disabled');
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2025 DPD Polska Sp. z o. o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2025 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
setTimeout(() => {
|
||||
handleDpdShippingPudo()
|
||||
}, 2000);
|
||||
})
|
||||
|
||||
function dpdshippingDisableOrderProcessBtn() {
|
||||
$("#payment-confirmation button").prop("disabled", true);
|
||||
$("#payment-confirmation a").addClass("disabled").attr("aria-disabled", "true");
|
||||
}
|
||||
|
||||
function dpdshippingEnableOrderProcessBtn() {
|
||||
$("#payment-confirmation button").prop("disabled", false);
|
||||
$("#payment-confirmation a").removeClass("disabled").removeAttr("aria-disabled");
|
||||
}
|
||||
179
modules/dpdshipping/views/js/dpdshipping-pudo-iframe.js
Normal file
179
modules/dpdshipping/views/js/dpdshipping-pudo-iframe.js
Normal file
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
// noinspection JSUnresolvedReference
|
||||
|
||||
console.log('[DPD Pudo] Skrypt załadowany');
|
||||
|
||||
if (typeof dpdshippingEventCreated == 'undefined') {
|
||||
var dpdshippingEventCreated = false;
|
||||
}
|
||||
|
||||
if (typeof dpdshippingIframeCreated == 'undefined') {
|
||||
var dpdshippingIframeCreated = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tworzy iframe dla mapy PUDO
|
||||
*/
|
||||
function dpdshippingCreateIframe() {
|
||||
console.log('[DPD Pudo] Próba utworzenia iframe...');
|
||||
|
||||
// Sprawdź czy iframe już istnieje
|
||||
if (document.getElementById("dpdshipping-widget-pudo-iframe")) {
|
||||
console.log('[DPD Pudo] Iframe już istnieje');
|
||||
return true;
|
||||
}
|
||||
|
||||
// Walidacja: sprawdź czy URL iframe jest zdefiniowany
|
||||
if (typeof dpdshipping_iframe_url === 'undefined' || !dpdshipping_iframe_url) {
|
||||
console.error('[DPD Pudo] Błąd: dpdshipping_iframe_url nie jest zdefiniowany lub jest pusty');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Walidacja: sprawdź czy element docelowy istnieje
|
||||
var dpdshipping_script = document.getElementById("dpdshipping-widget-pudo");
|
||||
if (!dpdshipping_script) {
|
||||
console.error('[DPD Pudo] Błąd: Nie znaleziono elementu #dpdshipping-widget-pudo');
|
||||
return false;
|
||||
}
|
||||
|
||||
var dpdshipping_iframe = document.createElement("iframe");
|
||||
dpdshipping_iframe.setAttribute("id", "dpdshipping-widget-pudo-iframe");
|
||||
dpdshipping_iframe.setAttribute("allow", "geolocation");
|
||||
dpdshipping_iframe.style.width = "100%";
|
||||
dpdshipping_iframe.style.border = "none";
|
||||
dpdshipping_iframe.style.minHeight = "400px";
|
||||
dpdshipping_iframe.style.height = "768px";
|
||||
|
||||
dpdshipping_iframe.onerror = function() {
|
||||
console.error('[DPD Pudo] Błąd ładowania iframe');
|
||||
};
|
||||
|
||||
dpdshipping_iframe.onload = function() {
|
||||
console.log('[DPD Pudo] Iframe załadowany pomyślnie');
|
||||
};
|
||||
|
||||
dpdshipping_iframe.src = dpdshipping_iframe_url;
|
||||
|
||||
dpdshipping_script.parentNode.insertBefore(dpdshipping_iframe, dpdshipping_script);
|
||||
console.log('[DPD Pudo] Iframe dodany do DOM, URL:', dpdshipping_iframe_url);
|
||||
|
||||
window.dpdshipping_iframe = dpdshipping_iframe;
|
||||
dpdshippingIframeCreated = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Obserwator DOM
|
||||
function dpdshippingObserveDOM() {
|
||||
if (document.getElementById("dpdshipping-widget-pudo")) {
|
||||
console.log('[DPD Pudo] Element znaleziony w DOM');
|
||||
dpdshippingCreateIframe();
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof MutationObserver !== 'undefined') {
|
||||
console.log('[DPD Pudo] Uruchamiam MutationObserver...');
|
||||
var observer = new MutationObserver(function() {
|
||||
if (document.getElementById("dpdshipping-widget-pudo")) {
|
||||
console.log('[DPD Pudo] Element pojawił się w DOM (MutationObserver)');
|
||||
observer.disconnect();
|
||||
dpdshippingCreateIframe();
|
||||
}
|
||||
});
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
|
||||
setTimeout(function() {
|
||||
observer.disconnect();
|
||||
}, 30000);
|
||||
}
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('[DPD Pudo] DOMContentLoaded');
|
||||
dpdshippingObserveDOM();
|
||||
});
|
||||
} else {
|
||||
console.log('[DPD Pudo] DOM już załadowany');
|
||||
dpdshippingObserveDOM();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
console.log('[DPD Pudo] jQuery ready');
|
||||
|
||||
$(document).on('click', '.dpdshipping-pudo-open-map-btn, .dpdshipping-pudo-change-map-btn', function() {
|
||||
console.log('[DPD Pudo] Kliknięto przycisk otwierania mapy');
|
||||
setTimeout(function() {
|
||||
dpdshippingCreateIframe();
|
||||
}, 200);
|
||||
});
|
||||
|
||||
$(document).on('show.bs.modal shown.bs.modal', '#dpdshippingPudoModal', function() {
|
||||
console.log('[DPD Pudo] Modal pokazywany');
|
||||
dpdshippingCreateIframe();
|
||||
});
|
||||
});
|
||||
|
||||
if (!dpdshippingEventCreated) {
|
||||
var dpdshipping_eventListener = window[window.addEventListener ? "addEventListener" : "attachEvent"];
|
||||
var dpdshipping_messageEvent = ("attachEvent" === dpdshipping_eventListener) ? "onmessage" : "message";
|
||||
dpdshipping_eventListener(dpdshipping_messageEvent, function (a) {
|
||||
if (typeof getDpdshippingIdPudoCarrier !== 'function' || typeof getDpdshippingSelectedCarrier !== 'function') {
|
||||
return;
|
||||
}
|
||||
if (getDpdshippingIdPudoCarrier() === getDpdshippingSelectedCarrier()) {
|
||||
var iframe = window.dpdshipping_iframe || document.getElementById("dpdshipping-widget-pudo-iframe");
|
||||
if (a.data && a.data.height && !isNaN(a.data.height)) {
|
||||
if (iframe) {
|
||||
iframe.style.height = a.data.height + "px";
|
||||
}
|
||||
} else if (a.data && a.data.point_id) {
|
||||
dpdShippingPointSelected(a.data.point_id);
|
||||
}
|
||||
}
|
||||
}, !1);
|
||||
dpdshippingEventCreated = true;
|
||||
}
|
||||
|
||||
function dpdShippingPointSelected(pudoCode) {
|
||||
if (!pudoCode) {
|
||||
console.error('[DPD Pudo] Błąd: Brak kodu punktu');
|
||||
return;
|
||||
}
|
||||
|
||||
$('.container_dpdshipping_pudo_error').css("display", "none");
|
||||
$('.dpdshipping-pudo-new-point').css("display", "none");
|
||||
$('.dpdshipping-pudo-selected-point').css("display", "block");
|
||||
|
||||
if (typeof dpdshippingSavePudoCode === 'function') {
|
||||
dpdshippingSavePudoCode(pudoCode, $('#dpdshippingPudoModal'));
|
||||
}
|
||||
|
||||
if (typeof dpdshippingGetPudoAddress === 'function') {
|
||||
dpdshippingGetPudoAddress(pudoCode, $('.dpdshipping-selected-point'));
|
||||
}
|
||||
|
||||
console.log('[DPD Pudo] Wybrano punkt:', pudoCode);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2025 DPD Polska Sp. z o. o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2025 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
setTimeout(() => {
|
||||
handleDpdShippingPudo()
|
||||
}, 2000);
|
||||
})
|
||||
|
||||
function dpdshippingDisableOrderProcessBtn() {
|
||||
$("#confirm_order").css("pointer-events", "none");
|
||||
}
|
||||
|
||||
function dpdshippingEnableOrderProcessBtn() {
|
||||
$("#confirm_order").css("pointer-events", "auto");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2025 DPD Polska Sp. z o. o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2025 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
setTimeout(() => {
|
||||
handleDpdShippingPudo()
|
||||
}, 2000);
|
||||
})
|
||||
|
||||
function dpdshippingDisableOrderProcessBtn() {
|
||||
$("#btn_place_order").css("pointer-events", "none");
|
||||
}
|
||||
|
||||
function dpdshippingEnableOrderProcessBtn() {
|
||||
$("#btn_place_order").css("pointer-events", "auto");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2025 DPD Polska Sp. z o. o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2025 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
setTimeout(() => {
|
||||
handleDpdShippingPudo()
|
||||
}, 2000);
|
||||
})
|
||||
|
||||
function dpdshippingDisableOrderProcessBtn() {
|
||||
$("#opc_step_shipping_footer, #opc_step_payment_header").css("pointer-events", "none");
|
||||
}
|
||||
|
||||
function dpdshippingEnableOrderProcessBtn() {
|
||||
$("#opc_step_shipping_footer, #opc_step_payment_header").css("pointer-events", "auto");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
setTimeout(() => {
|
||||
handleDpdShippingPudo()
|
||||
}, 2000);
|
||||
})
|
||||
|
||||
function dpdshippingDisableOrderProcessBtn() {
|
||||
$('#supercheckout_confirm_order').attr('disabled', 'disabled');
|
||||
$('#supercheckout_confirm_order').css('pointer-events', 'none');
|
||||
}
|
||||
|
||||
function dpdshippingEnableOrderProcessBtn() {
|
||||
$('#supercheckout_confirm_order').removeAttr('disabled');
|
||||
$('#supercheckout_confirm_order').css('pointer-events', '');
|
||||
}
|
||||
203
modules/dpdshipping/views/js/dpdshipping-pudo-swipbox-iframe.js
Normal file
203
modules/dpdshipping/views/js/dpdshipping-pudo-swipbox-iframe.js
Normal file
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
// noinspection JSUnresolvedReference
|
||||
|
||||
console.log('[DPD SwipBox] Skrypt załadowany');
|
||||
|
||||
if (typeof dpsShippingSwipBoxEventCreated == 'undefined') {
|
||||
var dpsShippingSwipBoxEventCreated = false;
|
||||
}
|
||||
|
||||
if (typeof dpsShippingSwipBoxIframeCreated == 'undefined') {
|
||||
var dpsShippingSwipBoxIframeCreated = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tworzy iframe dla mapy SwipBox - wywoływane przy otwieraniu modala
|
||||
*/
|
||||
function dpsShippingSwipBoxCreateIframe() {
|
||||
console.log('[DPD SwipBox] Próba utworzenia iframe...');
|
||||
|
||||
// Sprawdź czy iframe już istnieje
|
||||
if (document.getElementById("dpdshipping-widget-pudo-swipbox-iframe")) {
|
||||
console.log('[DPD SwipBox] Iframe już istnieje');
|
||||
return true;
|
||||
}
|
||||
|
||||
// Walidacja: sprawdź czy URL iframe jest zdefiniowany
|
||||
if (typeof dpdshipping_iframe_swipbox_url === 'undefined' || !dpdshipping_iframe_swipbox_url) {
|
||||
console.error('[DPD SwipBox] Błąd: dpdshipping_iframe_swipbox_url nie jest zdefiniowany lub jest pusty');
|
||||
console.error('[DPD SwipBox] Dostępne zmienne:', {
|
||||
dpdshipping_iframe_swipbox_url: typeof dpdshipping_iframe_swipbox_url !== 'undefined' ? dpdshipping_iframe_swipbox_url : 'UNDEFINED',
|
||||
dpdshipping_id_pudo_swipbox_carrier: typeof dpdshipping_id_pudo_swipbox_carrier !== 'undefined' ? dpdshipping_id_pudo_swipbox_carrier : 'UNDEFINED'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// Walidacja: sprawdź czy element docelowy istnieje
|
||||
var dpsShippingSwipBox_script = document.getElementById("dpdshipping-widget-pudo-swipbox");
|
||||
if (!dpsShippingSwipBox_script) {
|
||||
console.error('[DPD SwipBox] Błąd: Nie znaleziono elementu #dpdshipping-widget-pudo-swipbox');
|
||||
return false;
|
||||
}
|
||||
|
||||
var dpsShippingSwipBox_iframe = document.createElement("iframe");
|
||||
dpsShippingSwipBox_iframe.setAttribute("id", "dpdshipping-widget-pudo-swipbox-iframe");
|
||||
dpsShippingSwipBox_iframe.setAttribute("allow", "geolocation");
|
||||
dpsShippingSwipBox_iframe.style.width = "100%";
|
||||
dpsShippingSwipBox_iframe.style.border = "none";
|
||||
dpsShippingSwipBox_iframe.style.minHeight = "400px";
|
||||
dpsShippingSwipBox_iframe.style.height = "768px";
|
||||
|
||||
// Obsługa błędów ładowania iframe
|
||||
dpsShippingSwipBox_iframe.onerror = function() {
|
||||
console.error('[DPD SwipBox] Błąd ładowania iframe');
|
||||
};
|
||||
|
||||
dpsShippingSwipBox_iframe.onload = function() {
|
||||
console.log('[DPD SwipBox] Iframe załadowany pomyślnie');
|
||||
};
|
||||
|
||||
// Ustaw src
|
||||
dpsShippingSwipBox_iframe.src = dpdshipping_iframe_swipbox_url;
|
||||
|
||||
dpsShippingSwipBox_script.parentNode.insertBefore(dpsShippingSwipBox_iframe, dpsShippingSwipBox_script);
|
||||
console.log('[DPD SwipBox] Iframe dodany do DOM, URL:', dpdshipping_iframe_swipbox_url);
|
||||
|
||||
// Eksportuj iframe do globalnego scope
|
||||
window.dpsShippingSwipBox_iframe = dpsShippingSwipBox_iframe;
|
||||
dpsShippingSwipBoxIframeCreated = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Obserwator DOM - czeka na pojawienie się elementu
|
||||
function dpsShippingSwipBoxObserveDOM() {
|
||||
// Sprawdź czy element już istnieje
|
||||
if (document.getElementById("dpdshipping-widget-pudo-swipbox")) {
|
||||
console.log('[DPD SwipBox] Element znaleziony w DOM');
|
||||
dpsShippingSwipBoxCreateIframe();
|
||||
return;
|
||||
}
|
||||
|
||||
// Jeśli nie ma, obserwuj zmiany w DOM
|
||||
if (typeof MutationObserver !== 'undefined') {
|
||||
console.log('[DPD SwipBox] Uruchamiam MutationObserver...');
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
if (document.getElementById("dpdshipping-widget-pudo-swipbox")) {
|
||||
console.log('[DPD SwipBox] Element pojawił się w DOM (MutationObserver)');
|
||||
observer.disconnect();
|
||||
dpsShippingSwipBoxCreateIframe();
|
||||
}
|
||||
});
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
|
||||
// Timeout - zatrzymaj obserwację po 30 sekundach
|
||||
setTimeout(function() {
|
||||
observer.disconnect();
|
||||
}, 30000);
|
||||
}
|
||||
}
|
||||
|
||||
// Próba utworzenia iframe przy DOMContentLoaded
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('[DPD SwipBox] DOMContentLoaded');
|
||||
dpsShippingSwipBoxObserveDOM();
|
||||
});
|
||||
} else {
|
||||
// DOM już załadowany
|
||||
console.log('[DPD SwipBox] DOM już załadowany');
|
||||
dpsShippingSwipBoxObserveDOM();
|
||||
}
|
||||
|
||||
// Dodatkowa próba przy otwieraniu modala - nasłuchuj na zdarzenia modala
|
||||
$(document).ready(function() {
|
||||
console.log('[DPD SwipBox] jQuery ready');
|
||||
|
||||
// Nasłuchuj na otwieranie modala
|
||||
$(document).on('click', '.dpdshipping-pudo-swipbox-open-map-btn, .dpdshipping-pudo-swipbox-change-map-btn', function() {
|
||||
console.log('[DPD SwipBox] Kliknięto przycisk otwierania mapy');
|
||||
// Sprawdź ponownie po kliknięciu
|
||||
setTimeout(function() {
|
||||
console.log('[DPD SwipBox] Sprawdzam element po kliknięciu...');
|
||||
console.log('[DPD SwipBox] Modal:', document.getElementById('dpdshippingPudoSwipBoxModal'));
|
||||
console.log('[DPD SwipBox] Script element:', document.getElementById('dpdshipping-widget-pudo-swipbox'));
|
||||
dpsShippingSwipBoxCreateIframe();
|
||||
}, 200);
|
||||
});
|
||||
|
||||
// Nasłuchuj na zdarzenie show modala (Bootstrap)
|
||||
$(document).on('show.bs.modal shown.bs.modal', '#dpdshippingPudoSwipBoxModal', function() {
|
||||
console.log('[DPD SwipBox] Modal pokazywany (Bootstrap event)');
|
||||
dpsShippingSwipBoxCreateIframe();
|
||||
});
|
||||
});
|
||||
|
||||
// Event listener dla wiadomości z iframe
|
||||
if (!dpsShippingSwipBoxEventCreated) {
|
||||
var dpsShippingSwipBox_eventListener = window[window.addEventListener ? "addEventListener" : "attachEvent"];
|
||||
var dpsShippingSwipBox_messageEvent = ("attachEvent" === dpsShippingSwipBox_eventListener) ? "onmessage" : "message";
|
||||
dpsShippingSwipBox_eventListener(dpsShippingSwipBox_messageEvent, function (a) {
|
||||
if (typeof getDpdshippingIdPudoSwipBoxCarrier !== 'function' || typeof getDpdshippingSelectedCarrier !== 'function') {
|
||||
return;
|
||||
}
|
||||
if (getDpdshippingIdPudoSwipBoxCarrier() === getDpdshippingSelectedCarrier()) {
|
||||
var iframe = window.dpsShippingSwipBox_iframe || document.getElementById("dpdshipping-widget-pudo-swipbox-iframe");
|
||||
if (a.data && a.data.height && !isNaN(a.data.height)) {
|
||||
if (iframe) {
|
||||
iframe.style.height = a.data.height + "px";
|
||||
}
|
||||
} else if (a.data && a.data.point_id) {
|
||||
dpdShippingSwipBoxPointSelected(a.data.point_id);
|
||||
}
|
||||
}
|
||||
}, !1);
|
||||
dpsShippingSwipBoxEventCreated = true;
|
||||
}
|
||||
|
||||
function dpdShippingSwipBoxPointSelected(pudoSwipBoxe) {
|
||||
if (!pudoSwipBoxe) {
|
||||
console.error('[DPD SwipBox] Błąd: Brak ID punktu');
|
||||
return;
|
||||
}
|
||||
|
||||
$('.container_dpdshipping_pudo_swipbox_error').css("display", "none");
|
||||
$('.dpdshipping-pudo-swipbox-new-point').css("display", "none");
|
||||
$('.dpdshipping-pudo-swipbox-selected-point').css("display", "block");
|
||||
|
||||
if (typeof dpdshippingSavePudoCode === 'function') {
|
||||
dpdshippingSavePudoCode(pudoSwipBoxe, $('#dpdshippingPudoSwipBoxModal'));
|
||||
} else {
|
||||
console.error('[DPD SwipBox] Funkcja dpdshippingSavePudoCode nie jest dostępna');
|
||||
}
|
||||
|
||||
if (typeof dpdshippingGetPudoAddress === 'function') {
|
||||
dpdshippingGetPudoAddress(pudoSwipBoxe, $('.dpdshipping-swipbox-selected-point'));
|
||||
} else {
|
||||
console.error('[DPD SwipBox] Funkcja dpdshippingGetPudoAddress nie jest dostępna');
|
||||
}
|
||||
|
||||
console.log('[DPD SwipBox] Wybrano punkt:', pudoSwipBoxe);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2025 DPD Polska Sp. z o. o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2025 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
setTimeout(() => {
|
||||
handleDpdShippingPudo()
|
||||
}, 2000);
|
||||
})
|
||||
|
||||
function dpdshippingDisableOrderProcessBtn() {
|
||||
$("#confirm_order").css("pointer-events", "none");
|
||||
}
|
||||
|
||||
function dpdshippingEnableOrderProcessBtn() {
|
||||
$("#confirm_order").css("pointer-events", "auto");
|
||||
}
|
||||
|
||||
33
modules/dpdshipping/views/js/index.php
Normal file
33
modules/dpdshipping/views/js/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
609
modules/dpdshipping/views/js/order-details.js
Normal file
609
modules/dpdshipping/views/js/order-details.js
Normal file
@@ -0,0 +1,609 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
handleDpdShippingFormCardBody();
|
||||
|
||||
changeTable($('#packageGroupType').val());
|
||||
|
||||
$(document).on('change', '#dpd_shipping_generate_shipping_service_guarantee', function () {
|
||||
changeVisibility(getCheckboxId(this), '.service_guarantee_type', '#dpd_shipping_generate_shipping_service_guarantee_type');
|
||||
changeVisibility(getCheckboxId(this), '.service_guarantee_value', '#dpd_shipping_generate_shipping_service_guarantee_value');
|
||||
});
|
||||
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_guarantee', '.service_guarantee_type', '#dpd_shipping_generate_shipping_service_guarantee_type');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_guarantee', '.service_guarantee_value', '#dpd_shipping_generate_shipping_service_guarantee_value');
|
||||
|
||||
$(document).on('change', '#dpd_shipping_generate_shipping_service_cod', function () {
|
||||
changeVisibility(getCheckboxId(this), '.service_cod_value', '#dpd_shipping_generate_shipping_service_cod_value');
|
||||
changeVisibility(getCheckboxId(this), '.service_cod_currency', '#dpd_shipping_generate_shipping_service_cod_currency');
|
||||
});
|
||||
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_cod', '.service_cod_value', '#dpd_shipping_generate_shipping_service_cod_value');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_cod', '.service_cod_currency', '#dpd_shipping_generate_shipping_service_cod_currency');
|
||||
|
||||
$(document).on('change', '#dpd_shipping_generate_shipping_service_self_con', function () {
|
||||
changeVisibility(getCheckboxId(this), '.service_self_con_value', '#dpd_shipping_generate_shipping_service_self_con_value');
|
||||
});
|
||||
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_self_con', '.service_self_con_value', '#dpd_shipping_generate_shipping_service_self_con_value');
|
||||
|
||||
$(document).on('change', '#dpd_shipping_generate_shipping_service_dpd_pickup', function () {
|
||||
changeVisibility(getCheckboxId(this), '.service_dpd_pickup_value', '#dpd_shipping_generate_shipping_service_dpd_pickup_value');
|
||||
changeVisibility(getCheckboxId(this), '.service_dpd_pickup_map', '#dpd_shipping_generate_shipping_service_dpd_pickup_map');
|
||||
|
||||
checkEmpikDpdPickup();
|
||||
});
|
||||
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_dpd_pickup', '.service_dpd_pickup_value', '#dpd_shipping_generate_shipping_service_dpd_pickup_value');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_dpd_pickup', '.service_dpd_pickup_map', '#dpd_shipping_generate_shipping_service_dpd_pickup_map');
|
||||
|
||||
$(document).on('change', '#dpd_shipping_generate_shipping_service_declared_value', function () {
|
||||
changeVisibility(getCheckboxId(this), '.service_declared_value_value', '#dpd_shipping_generate_shipping_service_declared_value_value');
|
||||
changeVisibility(getCheckboxId(this), '.service_declared_value_currency', '#dpd_shipping_generate_shipping_service_declared_value_currency');
|
||||
});
|
||||
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_declared_value', '.service_declared_value_value', '#dpd_shipping_generate_shipping_service_declared_value_value');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_declared_value', '.service_declared_value_currency', '#dpd_shipping_generate_shipping_service_declared_value_currency');
|
||||
|
||||
$(document).on('change', '#dpd_shipping_generate_shipping_service_dpd_food', function () {
|
||||
changeVisibility(getCheckboxId(this), '.service_dpd_food_value', '#dpd_shipping_generate_shipping_service_dpd_food_value');
|
||||
});
|
||||
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_dpd_food', '.service_dpd_food_value', '#dpd_shipping_generate_shipping_service_dpd_food_value');
|
||||
|
||||
$(document).on('change', '#dpd_shipping_generate_shipping_service_duty', function () {
|
||||
changeVisibility(getCheckboxId(this), '.service_duty_value', '#dpd_shipping_generate_shipping_service_duty_value');
|
||||
changeVisibility(getCheckboxId(this), '.service_duty_currency', '#dpd_shipping_generate_shipping_service_duty_currency');
|
||||
});
|
||||
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_duty', '.service_duty_value', '#dpd_shipping_generate_shipping_service_duty_value');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_duty', '.service_duty_currency', '#dpd_shipping_generate_shipping_service_duty_currency');
|
||||
|
||||
$(document).on('change', '#dpd_shipping_generate_shipping_service_return_label', function () {
|
||||
changeVisibility(getCheckboxId(this), '.service_return_label_address_company', '#dpd_shipping_generate_shipping_service_return_label_address_company');
|
||||
changeVisibility(getCheckboxId(this), '.service_return_label_address_name', '#dpd_shipping_generate_shipping_service_return_label_address_name');
|
||||
changeVisibility(getCheckboxId(this), '.service_return_label_address_street', '#dpd_shipping_generate_shipping_service_return_label_address_street');
|
||||
changeVisibility(getCheckboxId(this), '.service_return_label_address_city', '#dpd_shipping_generate_shipping_service_return_label_address_city');
|
||||
changeVisibility(getCheckboxId(this), '.service_return_label_address_postcode', '#dpd_shipping_generate_shipping_service_return_label_address_postcode');
|
||||
changeVisibility(getCheckboxId(this), '.service_return_label_address_country', '#dpd_shipping_generate_shipping_service_return_label_address_country');
|
||||
changeVisibility(getCheckboxId(this), '.service_return_label_address_phone', '#dpd_shipping_generate_shipping_service_return_label_address_phone');
|
||||
changeVisibility(getCheckboxId(this), '.service_return_label_address_email', '#dpd_shipping_generate_shipping_service_return_label_address_email');
|
||||
});
|
||||
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_return_label', '.service_return_label_address_company', '#dpd_shipping_generate_shipping_service_return_label_address_company');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_return_label', '.service_return_label_address_name', '#dpd_shipping_generate_shipping_service_return_label_address_name');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_return_label', '.service_return_label_address_street', '#dpd_shipping_generate_shipping_service_return_label_address_street');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_return_label', '.service_return_label_address_city', '#dpd_shipping_generate_shipping_service_return_label_address_city');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_return_label', '.service_return_label_address_postcode', '#dpd_shipping_generate_shipping_service_return_label_address_postcode');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_return_label', '.service_return_label_address_country', '#dpd_shipping_generate_shipping_service_return_label_address_country');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_return_label', '.service_return_label_address_phone', '#dpd_shipping_generate_shipping_service_return_label_address_phone');
|
||||
changeVisibility('#dpd_shipping_generate_shipping_service_return_label', '.service_return_label_address_email', '#dpd_shipping_generate_shipping_service_return_label_address_email');
|
||||
|
||||
$(document).on('click', '.dpdshipping-remove-row', function () {
|
||||
removeRow(this)
|
||||
});
|
||||
|
||||
$(document).on('click', '#dpdShippingAddRow', function () {
|
||||
changeTable('addRow');
|
||||
});
|
||||
|
||||
$(document).on('click', '#dpdShippingSingleShipping', function () {
|
||||
changeTable('single');
|
||||
});
|
||||
|
||||
$(document).on('click', '#dpdShippingGroupShipping', function () {
|
||||
changeTable('group');
|
||||
});
|
||||
|
||||
$(document).on('click', '#dpdShippingPackageShipping', function () {
|
||||
changeTable('package');
|
||||
});
|
||||
|
||||
$(document).on('click', '#dpdShippingCalcShippingRows', function () {
|
||||
setDpdShippingCustomShippingRows();
|
||||
setDpdShippingCustomParcel();
|
||||
$('#dpdShippingParcelSummaryRow').removeClass('hidden');
|
||||
});
|
||||
|
||||
$(document).on('change', '.dpdShippingCustomParcelSelect', function () {
|
||||
setDpdShippingCustomParcel();
|
||||
});
|
||||
|
||||
$(document).on('click', '#dpdShippingCustomParcelSave', function () {
|
||||
changeTable('custom', getDpdShippingCustomParcel())
|
||||
});
|
||||
|
||||
$(document).on('click', '#dpdShippingCustomShipping', function () {
|
||||
$('#dpdShippingCalcShippingRows').click();
|
||||
});
|
||||
|
||||
$(document).on('change', '#dpdShippingSenderAddresses', function () {
|
||||
const address = $(this).find('option:selected').data('address');
|
||||
$('#dpd_shipping_generate_shipping_sender_address_company').val(address.company);
|
||||
$('#dpd_shipping_generate_shipping_sender_address_name').val(address.name);
|
||||
$('#dpd_shipping_generate_shipping_sender_address_street').val(address.street);
|
||||
$('#dpd_shipping_generate_shipping_sender_address_postcode').val(address.postcode);
|
||||
$('#dpd_shipping_generate_shipping_sender_address_country').val(address.country);
|
||||
$('#dpd_shipping_generate_shipping_sender_address_city').val(address.city);
|
||||
$('#dpd_shipping_generate_shipping_sender_address_phone').val(address.phone);
|
||||
$('#dpd_shipping_generate_shipping_sender_address_email').val(address.email);
|
||||
});
|
||||
|
||||
$(document).on('change', '#dpdShippingReceiverAddresses', function () {
|
||||
const address = $(this).find('option:selected').data('address');
|
||||
$('#dpd_shipping_generate_shipping_receiver_address_company').val(address.company);
|
||||
$('#dpd_shipping_generate_shipping_receiver_address_name').val(address.name);
|
||||
$('#dpd_shipping_generate_shipping_receiver_address_street').val(address.street);
|
||||
$('#dpd_shipping_generate_shipping_receiver_address_postcode').val(address.postcode);
|
||||
$('#dpd_shipping_generate_shipping_receiver_address_country').val(address.country);
|
||||
$('#dpd_shipping_generate_shipping_receiver_address_city').val(address.city);
|
||||
$('#dpd_shipping_generate_shipping_receiver_address_phone').val(address.phone);
|
||||
$('#dpd_shipping_generate_shipping_receiver_address_email').val(address.email);
|
||||
});
|
||||
|
||||
$(document).on('click', '.dpdshipping-tracking-detail-btn', function () {
|
||||
$(this).next(".dpdshipping-tracking-detail").toggleClass("hidden");
|
||||
});
|
||||
|
||||
showWeightAdr();
|
||||
|
||||
$(document).on('change', '#dpd_shipping_generate_shipping_service_adr', function () {
|
||||
showWeightAdr();
|
||||
});
|
||||
|
||||
function showWeightAdr() {
|
||||
if ($('#dpd_shipping_generate_shipping_service_adr').prop('checked')) {
|
||||
$(".dpdShippingWeightAdr").removeClass("hidden");
|
||||
} else {
|
||||
$(".dpdShippingWeightAdr").addClass("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
function getCheckboxId(input) {
|
||||
return '#' + input.id;
|
||||
}
|
||||
|
||||
function changeVisibility(checkBoxId, relatedClass, input) {
|
||||
if ($(checkBoxId).is(':checked')) {
|
||||
$(relatedClass).removeClass('hidden');
|
||||
$(input).prop('disabled', false);
|
||||
if (input !== "#dpd_shipping_generate_shipping_service_guarantee_value")
|
||||
$(input).prop('required', true);
|
||||
|
||||
} else {
|
||||
$(relatedClass).addClass('hidden');
|
||||
$(input).prop('disabled', 'disabled');
|
||||
if (input !== "#dpd_shipping_generate_shipping_service_guarantee_value")
|
||||
$(input).prop('required', false);
|
||||
}
|
||||
}
|
||||
|
||||
function removeRow(button) {
|
||||
const rowCount = $('#packagesTable tr').length;
|
||||
if (rowCount > 2)
|
||||
$(button).closest('tr').remove();
|
||||
}
|
||||
|
||||
function changeTable(type, customData) {
|
||||
const lastContainer = $("#packagesTable tbody tr:last");
|
||||
const packagesTable = document.getElementById('packagesTable');
|
||||
if (!packagesTable) {
|
||||
console.error('Table with ID "packagesTable" not found.');
|
||||
return;
|
||||
}
|
||||
|
||||
const tbodyByTagName = packagesTable.getElementsByTagName('tbody')
|
||||
if (tbodyByTagName == null || tbodyByTagName.length === 0) {
|
||||
console.error('No <tbody> elements found in the table.');
|
||||
return;
|
||||
}
|
||||
|
||||
const tbody = tbodyByTagName[0];
|
||||
while (type !== "addRow" && tbody.firstChild) {
|
||||
tbody.removeChild(tbody.firstChild);
|
||||
}
|
||||
|
||||
// Create new rows based on the selected action
|
||||
if (type === 'single') {
|
||||
const clonedRow = lastContainer.clone();
|
||||
let data = getSingleRow()
|
||||
setInputsData(clonedRow, data);
|
||||
setIndexForNewRow(clonedRow);
|
||||
$("#packagesTable").append(clonedRow);
|
||||
} else if (type === 'group') {
|
||||
const productsData = $('#dpdShippingOrderProducts').data('products');
|
||||
Object.keys(productsData).forEach(function (index) {
|
||||
const product = productsData[index];
|
||||
const clonedRow = lastContainer.clone();
|
||||
let data = {
|
||||
weight: getProductWeight([product], true),
|
||||
weightAdr: null,
|
||||
customerData: getData([product], 300, 'customer-source'),
|
||||
content: getData([product], 300, 'content-source'),
|
||||
sizeX: '',
|
||||
sizeY: '',
|
||||
sizeZ: ''
|
||||
}
|
||||
setInputsData(clonedRow, data);
|
||||
setIndexForNewRow(clonedRow);
|
||||
$("#packagesTable").append(clonedRow);
|
||||
});
|
||||
} else if (type === 'package') {
|
||||
const productsData = $('#dpdShippingOrderProducts').data('products');
|
||||
Object.keys(productsData).forEach(function (index) {
|
||||
const product = productsData[index];
|
||||
for (let i = 0; i < Math.ceil(product.product_quantity); i++) {
|
||||
const clonedRow = lastContainer.clone();
|
||||
let data = {
|
||||
weight: getProductWeight([product], false),
|
||||
weightAdr: null,
|
||||
customerData: getData([product], 300, 'customer-source'),
|
||||
content: getData([product], 300, 'content-source'),
|
||||
sizeX: '',
|
||||
sizeY: '',
|
||||
sizeZ: ''
|
||||
}
|
||||
setInputsData(clonedRow, data);
|
||||
setIndexForNewRow(clonedRow);
|
||||
$("#packagesTable").append(clonedRow);
|
||||
}
|
||||
});
|
||||
} else if (type === 'addRow') {
|
||||
const clonedRow = lastContainer.clone();
|
||||
let data = {
|
||||
weight: 1.0,
|
||||
weightAdr: null,
|
||||
customerData: "",
|
||||
content: "",
|
||||
sizeX: "",
|
||||
sizeY: "",
|
||||
sizeZ: "",
|
||||
}
|
||||
setInputsData(clonedRow, data);
|
||||
setIndexForNewRow(clonedRow);
|
||||
$("#packagesTable").append(clonedRow);
|
||||
} else if (type === 'custom') {
|
||||
Object.keys(customData).forEach(function (index) {
|
||||
const parcel = customData[index];
|
||||
const clonedRow = lastContainer.clone();
|
||||
let data = {
|
||||
weight: parcel.product_weight,
|
||||
weightAdr: null,
|
||||
customerData: parcel.customerData,
|
||||
content: parcel.content,
|
||||
sizeX: '',
|
||||
sizeY: '',
|
||||
sizeZ: ''
|
||||
}
|
||||
setInputsData(clonedRow, data);
|
||||
setIndexForNewRow(clonedRow);
|
||||
$("#packagesTable").append(clonedRow);
|
||||
});
|
||||
}
|
||||
|
||||
function setInputsData(clonedRow, data) {
|
||||
|
||||
clonedRow.find('input').each(function () {
|
||||
const inputType = $(this).attr('fieldType');
|
||||
switch (inputType) {
|
||||
case 'weight':
|
||||
$(this).val(data.weight);
|
||||
break;
|
||||
case 'weightAdr':
|
||||
$(this).val(data.weightAdr);
|
||||
break;
|
||||
case 'customerData':
|
||||
$(this).val(data.customerData);
|
||||
break;
|
||||
case 'content':
|
||||
$(this).val(data.content);
|
||||
break;
|
||||
case 'sizeX':
|
||||
$(this).val(data.sizeX);
|
||||
break;
|
||||
case 'sizeY':
|
||||
$(this).val(data.sizeY);
|
||||
break;
|
||||
case 'sizeZ':
|
||||
$(this).val(data.sizeZ);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setIndexForNewRow(clonedRow) {
|
||||
function setIndexes() {
|
||||
const index = parseInt($("#packagesTable tbody tr").length);
|
||||
const currentName = $(this).attr('name');
|
||||
const newName = currentName.replace(/\[(\d+)\]/, '[' + index + ']');
|
||||
$(this).attr('name', newName);
|
||||
|
||||
const currentId = $(this).attr('id');
|
||||
const newId = currentId.replace(/\_(\d+)\_/, '_' + index + '_');
|
||||
$(this).attr('id', newId);
|
||||
}
|
||||
|
||||
clonedRow.find('input').each(function () {
|
||||
setIndexes.call(this);
|
||||
});
|
||||
|
||||
clonedRow.find('select').each(function () {
|
||||
setIndexes.call(this);
|
||||
});
|
||||
}
|
||||
|
||||
function getSingleRow() {
|
||||
const productsData = $('#dpdShippingOrderProducts').data('products');
|
||||
|
||||
return {
|
||||
weight: getProductWeight(productsData, true),
|
||||
weightAdr: null,
|
||||
customerData: getData(productsData, 300, 'customer-source'),
|
||||
content: getData(productsData, 300, 'content-source'),
|
||||
sizeX: '',
|
||||
sizeY: '',
|
||||
sizeZ: ''
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setDpdShippingCustomShippingRows() {
|
||||
const parcels = Number($('#dpdShippingCustomShippingParcels').val());
|
||||
const newOptions = generateParcelsArray(parcels);
|
||||
|
||||
const elements = $('.dpdShippingCustomParcelSelect');
|
||||
|
||||
elements.each(function () {
|
||||
const select = $(this)
|
||||
select.empty();
|
||||
$.each(newOptions, function (index, value) {
|
||||
select.append($('<option>', {
|
||||
value: value,
|
||||
text: value
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
function generateParcelsArray(size) {
|
||||
const array = [];
|
||||
for (let i = 1; i <= size; i++) {
|
||||
array.push(i);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
function setDpdShippingCustomParcel() {
|
||||
const summaryTable = $('.dpdShippingCustomParcelSummaryTable');
|
||||
const parcels = getDpdShippingCustomParcel();
|
||||
|
||||
let rows = "";
|
||||
Object.keys(parcels).forEach(function (parcel) {
|
||||
const parcelData = parcels[parcel];
|
||||
rows += '<tr>';
|
||||
rows += '<td>' + parcelData.parcel + '</td>';
|
||||
rows += '<td>' + parcelData.content + '</td>';
|
||||
rows += '<td>' + parcelData.customerData + '</td>';
|
||||
rows += '<td>' + parcelData.product_weight + '</td>';
|
||||
rows += '</tr>';
|
||||
});
|
||||
|
||||
summaryTable.empty();
|
||||
summaryTable.append(rows);
|
||||
}
|
||||
|
||||
function getDpdShippingCustomParcel() {
|
||||
|
||||
const parcels = {};
|
||||
getProducts().forEach(function (product) {
|
||||
if (!parcels[product.parcel]) {
|
||||
parcels[product.parcel] = [];
|
||||
}
|
||||
parcels[product.parcel].push(product);
|
||||
});
|
||||
|
||||
const result = []
|
||||
Object.keys(parcels).forEach(function (parcel) {
|
||||
const parcelData = parcels[parcel];
|
||||
|
||||
result.push({
|
||||
parcel: parcel,
|
||||
customerData: getData(parcelData, 300, 'customer-source'),
|
||||
content: getData(parcelData, 300, 'content-source'),
|
||||
product_weight: getProductWeight(parcelData, false),
|
||||
})
|
||||
});
|
||||
|
||||
return result;
|
||||
|
||||
function getProducts() {
|
||||
const products = [];
|
||||
|
||||
const parcels = getSelectValues('dpdShippingCustomShippingParcel');
|
||||
const productNames = getInputValues('dpdShippingCustomShippingProductName');
|
||||
const productIds = getInputValues('dpdShippingCustomShippingProductId');
|
||||
const productWeights = getInputValues('dpdShippingCustomShippingProductWeight');
|
||||
const productReferences = getInputValues('dpdShippingCustomShippingProductReference');
|
||||
|
||||
for (let i = 0; i < productIds.length; i++) {
|
||||
const product = {
|
||||
product_reference: productReferences[i],
|
||||
product_weight: productWeights[i],
|
||||
product_name: productNames[i],
|
||||
product_id: productIds[i],
|
||||
parcel: parcels[i],
|
||||
customerData: '',
|
||||
content: '',
|
||||
};
|
||||
products.push(product);
|
||||
}
|
||||
|
||||
return products;
|
||||
}
|
||||
|
||||
function getSelectValues(selectName) {
|
||||
return $('select[name^="' + selectName + '["]').map(function () {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
}
|
||||
|
||||
function getInputValues(selectName) {
|
||||
return $('input[name^="' + selectName + '["]').map(function () {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
}
|
||||
}
|
||||
|
||||
function getProductWeight(parcel, multiplyQuantity) {
|
||||
let sum = 0;
|
||||
parcel.forEach(function (product) {
|
||||
let weight = Number(product.product_weight);
|
||||
if (weight <= 0)
|
||||
weight = $('#dpdShippingDefaultWeight').data('default-weight');
|
||||
|
||||
if (multiplyQuantity)
|
||||
sum += weight * Number(product.product_quantity);
|
||||
else
|
||||
sum += weight;
|
||||
});
|
||||
|
||||
return sum.toFixed(2);
|
||||
}
|
||||
|
||||
|
||||
function getData(parcel, limit, sourceString) {
|
||||
const source = $('#dpdShippingSource').data(sourceString);
|
||||
const sourceStatic = $('#dpdShippingSource').data(sourceString + '-static');
|
||||
|
||||
const unique = [];
|
||||
parcel.forEach(function (product) {
|
||||
const dynamicField = getDynamicField(source, sourceStatic, product)
|
||||
if (!unique.includes(dynamicField)) {
|
||||
unique.push(dynamicField);
|
||||
}
|
||||
});
|
||||
|
||||
return getStringWithMaxLength(unique.join(', '), limit);
|
||||
}
|
||||
|
||||
function getDynamicField(source, sourceStatic, product) {
|
||||
if (source === "STATIC_VALUE")
|
||||
return sourceStatic;
|
||||
else if (source === "STATIC_VALUE_ONLY_FOR_EMPIK" && $('#dpdShippingOrderNumberEmpik').data('order-number-empik'))
|
||||
return sourceStatic;
|
||||
else if (source === "ORDER_NUMBER")
|
||||
return $('#dpdShippingOrderNumber').data('order-number');
|
||||
else if (source === "ORDER_ID")
|
||||
return $('#dpdShippingOrderId').data('order-id');
|
||||
else if (source === "INVOICE_NUMBER")
|
||||
return $('#dpdShippingInvoiceNumber').data('invoice-number');
|
||||
else if (source === "PRODUCT_INDEX")
|
||||
return product.product_reference;
|
||||
else if (source === "PRODUCT_NAME")
|
||||
return product.product_name;
|
||||
else if (source === "ORDER_NUMBER_EMPIK")
|
||||
return $('#dpdShippingOrderNumberEmpik').data('order-number-empik');
|
||||
return '';
|
||||
}
|
||||
|
||||
function getStringWithMaxLength(data, limit) {
|
||||
if (data.length > limit) {
|
||||
return data.substring(0, limit - 3) + '...';
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
$(document).on('click', '.dpdshipping-pudo-change-map-btn', (e) => {
|
||||
const dpdShippingWidgetPudoIframe = $("#dpdshiping-widget-pudo-iframe")
|
||||
const dpdReceiverCountryCode = document.getElementById("dpd_shipping_generate_shipping_receiver_address_country")?.value ?? "PL";
|
||||
const dpdPudoFinderUrl = $("#dpdPudoFinderUrl").data("dpd-pudo-finder-url")
|
||||
dpdShippingWidgetPudoIframe.attr("src", dpdPudoFinderUrl + "&query=" + dpdReceiverCountryCode?.toUpperCase());
|
||||
|
||||
showModal(e, '#dpdshippingPudoModal');
|
||||
});
|
||||
|
||||
function showModal(event, modalDiv) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$(modalDiv).modal({
|
||||
backdrop: 'static',
|
||||
keyboard: false
|
||||
})
|
||||
}
|
||||
|
||||
function handleDpdShippingFormCardBody() {
|
||||
const dpdCarrierValue = $("#dpdShippingIsDpdCarrier").data("dpd-carrier");
|
||||
const isDpdCarrier = dpdCarrierValue === 1 || dpdCarrierValue === "1";
|
||||
|
||||
if (!isDpdCarrier) {
|
||||
$('form[name="dpd_shipping_generate_shipping"] .card-body').toggle();
|
||||
$('form[name="dpd_shipping_generate_shipping"] .card-footer').toggle();
|
||||
$('.dpdApiPayer').toggle();
|
||||
|
||||
const toggleButton = $("#dpdToggleButton");
|
||||
const icon = toggleButton.find("span.material-icons");
|
||||
icon.text("expand_more");
|
||||
}
|
||||
|
||||
$('#dpdToggleButton').click(function (e) {
|
||||
e.preventDefault();
|
||||
const dpdCardBody = $('form[name="dpd_shipping_generate_shipping"] .card-body')
|
||||
dpdCardBody.toggle();
|
||||
$('form[name="dpd_shipping_generate_shipping"] .card-footer').toggle();
|
||||
$('.dpdApiPayer').toggle();
|
||||
|
||||
const icon = $(this).find("span.material-icons");
|
||||
if (dpdCardBody.is(":visible")) {
|
||||
icon.text("expand_less");
|
||||
} else {
|
||||
icon.text("expand_more");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkEmpikDpdPickup() {
|
||||
const dpdShippingSource = $('#dpdShippingSource').data('order-source');
|
||||
const dpdPickupCheckbox = $('#dpd_shipping_generate_shipping_service_dpd_pickup');
|
||||
const dpdEmpikAlert = $('.dpdShippingEmpikDpdPickupAlert');
|
||||
|
||||
const toggleEmpikAlert = () => {
|
||||
const isEmpik = dpdShippingSource === 'DELIVERY_EMPIK_STORE';
|
||||
const isChecked = dpdPickupCheckbox.is(':checked');
|
||||
|
||||
if (isEmpik && !isChecked) {
|
||||
dpdEmpikAlert.show();
|
||||
} else {
|
||||
dpdEmpikAlert.hide();
|
||||
}
|
||||
};
|
||||
|
||||
toggleEmpikAlert();
|
||||
dpdPickupCheckbox.on('change', toggleEmpikAlert);
|
||||
}
|
||||
|
||||
checkEmpikDpdPickup();
|
||||
}
|
||||
);
|
||||
42
modules/dpdshipping/views/js/pickup-courier-grid.js
Normal file
42
modules/dpdshipping/views/js/pickup-courier-grid.js
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
window.prestashop.component.initComponents(
|
||||
[
|
||||
'Grid'
|
||||
],
|
||||
);
|
||||
const grid = new window.prestashop.component.Grid('dpdshipping_pickup_courier');
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.BulkActionCheckboxExtension());
|
||||
// grid.addExtension(new window.prestashop.component.GridExtensions.ExportToSqlManagerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.ReloadListExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SortingExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.FiltersResetExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitRowActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitBulkActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AjaxBulkActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.FiltersSubmitButtonEnablerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AsyncToggleColumnExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.PositionExtension(grid));
|
||||
});
|
||||
42
modules/dpdshipping/views/js/shipping-history-grid.js
Normal file
42
modules/dpdshipping/views/js/shipping-history-grid.js
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
window.prestashop.component.initComponents(
|
||||
[
|
||||
'Grid'
|
||||
],
|
||||
);
|
||||
const grid = new window.prestashop.component.Grid('dpdshipping_shipping_history');
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.BulkActionCheckboxExtension());
|
||||
// grid.addExtension(new window.prestashop.component.GridExtensions.ExportToSqlManagerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.ReloadListExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SortingExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.FiltersResetExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitRowActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitBulkActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AjaxBulkActionExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.FiltersSubmitButtonEnablerExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.AsyncToggleColumnExtension());
|
||||
grid.addExtension(new window.prestashop.component.GridExtensions.PositionExtension(grid));
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,33 @@
|
||||
{% set currentPath = app.request.pathinfo %}
|
||||
|
||||
{% block content %}
|
||||
{% trans_default_domain 'Modules.Dpdshipping.AdminNav' %}
|
||||
{% set menuItems = [
|
||||
{'path': 'connection', 'label': 'Connection with DPD Poland'|trans, 'form':'dpdshipping_connection_form'},
|
||||
{'path': 'address', 'label': 'Sender addresses'|trans, 'form':'dpdshipping_address_form'},
|
||||
{'path': 'carrier', 'label': 'Carriers'|trans, 'form':'dpdshipping_carrier_form'},
|
||||
{'path': 'specialPrice', 'label': 'Special prices'|trans, 'form':'dpdshipping_special_price_form'},
|
||||
{'path': 'parameters', 'label': 'Default parameters'|trans, 'form':'dpdshipping_parameters_form'},
|
||||
{'path': 'configuration', 'label': 'Settings'|trans, 'form':'dpdshipping_configuration_form'},
|
||||
{'path': 'pickupCourierSettingsList', 'label': 'Pickup courier settings'|trans, 'form':'dpdshipping_pickup_courier_settings_list_form'},
|
||||
{'path': 'onboarding', 'label': 'Onboarding'|trans, 'form':'dpdshipping_onboarding_form'},
|
||||
] %}
|
||||
|
||||
<nav class="navbar navbar-light bg-white mb-3 dpdshipping-box-shadow">
|
||||
<ul class="navbar-nav text-dark">
|
||||
{% for item in menuItems %}
|
||||
<li class="nav-item {% if currentPath == '/modules/dpdshipping/configuration/' ~ item.path %} dpdshipping-nav-active active {% endif %}">
|
||||
<a class="nav-link" href="{{ path(item.form) }}">{{ item.label }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" href="{{ asset('../modules/dpdshipping/views/css/navbar.css') }}"/>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
{% set currentPath = app.request.pathinfo %}
|
||||
|
||||
{% block content %}
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-white mb-3 dpdshipping-box-shadow">
|
||||
<a class="navbar-brand" href="{{ path('dpdshipping_shipping_history_form') }}"> <img class="dpdshipping-logo"
|
||||
src="/modules/dpdshipping/logo.png"
|
||||
alt="DPD Poland"/>{{ 'DPD Poland'|trans({}, 'Modules.Dpdshipping.AdminNav') }}
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item {% if currentPath == '/modules/dpdshipping/shipping-history' or currentPath == '/modules/dpdshipping/shipping-history/details' %}dpdshipping-nav-active active {% endif %}>">
|
||||
<a class="nav-link"
|
||||
href="{{ path('dpdshipping_shipping_history_form') }}">{{ 'Shipping history'|trans({}, 'Modules.Dpdshipping.AdminNav') }}</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item {% if currentPath == '/modules/dpdshipping/pickupCourier' %}dpdshipping-nav-active active {% endif %}>">
|
||||
<a class="nav-link"
|
||||
href="{{ path('dpdshipping_pickup_courier_form') }}">{{ 'Pickup courier'|trans({}, 'Modules.Dpdshipping.AdminNav') }}</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="my-2 my-lg-0">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item {% if currentPath starts with '/modules/dpdshipping/configuration' %}dpdshipping-nav-active active {% endif %}>">
|
||||
<a class="nav-link"
|
||||
href="{{ path('dpdshipping_connection_form') }}">{{ 'Configuration'|trans({}, 'Modules.Dpdshipping.AdminNav') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" href="{{ asset('../modules/dpdshipping/views/css/navbar.css') }}"/>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
{{ form_start(form) }}
|
||||
<div class="card">
|
||||
<h3 class="card-header bg-white">
|
||||
{{ 'Address'|trans({}, 'Modules.Dpdshipping.AdminAddress') }} {{ addressId }}
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
{% if shopContext > 1 %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
{{ 'You are editing settings for multiple shops contexts. These settings will be applied to other contexts and may override current values.'|trans({}, 'Modules.Dpdshipping.Admin') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-wrapper">
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-white">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-secondary float-right" id="save-button">
|
||||
{{ 'Save'|trans({}, 'Modules.Dpdshipping.AdminAddress') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-2">
|
||||
<a class="btn btn-primary float-right"
|
||||
href="{{ path('dpdshipping_address_edit_form') }}">{{ 'Add new sender address'|trans({}, 'Modules.Dpdshipping.AdminAddress') }}</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
||||
{% block quotes_list_panel %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% include '@PrestaShop/Admin/Common/Grid/grid_panel.html.twig' with {'grid': quoteGrid} %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/configuration/address-grid.js') }}"></script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,450 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
{{ form_start(form) }}
|
||||
<div class="card">
|
||||
<h3 class="card-header bg-white">
|
||||
{{ 'Carriers'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
<div class="alert alert-info mb-4" role="alert">
|
||||
{{ 'Select an available shipping method for the Create Prestashop carrier. You can manage carriers on the standard prestashop page.'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}
|
||||
</div>
|
||||
|
||||
{% if shopContext > 1 %}
|
||||
<div class="alert alert-warning mb-4" role="alert">
|
||||
{{ 'Select a single shop context to manage carriers.'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h4>{{ 'Available shipping methods'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</h4>
|
||||
|
||||
<div class="row pt-2">
|
||||
<div class="col-12">
|
||||
<div class="pl-2">
|
||||
{{ form_label(form.dpdPolandCarrierSwipBox) }}
|
||||
{{ form_widget(form.dpdPolandCarrierSwipBox) }}
|
||||
{{ form_errors(form.dpdPolandCarrierSwipBox) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset-2 col-10">
|
||||
|
||||
{% if dpdCarrierSwipBox is not null and dpdCarrierSwipBox is not empty and dpdCarrierSwipBox[0].id is defined %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-2" scope="col">{{ 'Id'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Id Shop'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-6" scope="col">{{ 'Name'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Visible'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Actions'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in dpdCarrierSwipBox %}
|
||||
{% if row.id is defined %}
|
||||
<tr>
|
||||
<th>{{ row.id }}</th>
|
||||
<th>{{ row.idShop }}</th>
|
||||
<td>{{ row.name }}</td>
|
||||
<td>
|
||||
{% if row.active %}
|
||||
<i class="color_success"></i> <i class="material-icons" style="color:#009d00">done</i>
|
||||
{% else %}
|
||||
<i class="color_danger"></i> <i class="material-icons" style="color:red">blockade</i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ path('admin_carriers_edit', {'carrierId': row.id }) }}" type="button"
|
||||
class="btn btn-sm btn-secondary">{{ 'Configure'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if shopContext == 1 %}
|
||||
{% set apiConnection = [
|
||||
form.dpdPolandCarrierSwipBoxFilterSwipBox,
|
||||
form.dpdPolandCarrierSwipBoxFilterPointsWithServices
|
||||
] %}
|
||||
<p class="font-weight-bold">{{ 'Filters for SwipBox map'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}:</p>
|
||||
<div class="row">
|
||||
{% for item in apiConnection %}
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-xl-3">
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% set apiConnection = [
|
||||
form.dpdPolandCarrierSwipBoxFilterOpenLate,
|
||||
form.dpdPolandCarrierSwipBoxFilterOpenSaturdays,
|
||||
form.dpdPolandCarrierSwipBoxFilterOpenSundays,
|
||||
form.dpdPolandCarrierSwipBoxFilterParking,
|
||||
form.dpdPolandCarrierSwipBoxFilterDirectDelivery,
|
||||
form.dpdPolandCarrierSwipBoxFilterDirectDeliveryCod,
|
||||
form.dpdPolandCarrierSwipBoxFilterDropoffOnline,
|
||||
form.dpdPolandCarrierSwipBoxFilterDropoffOffline,
|
||||
form.dpdPolandCarrierSwipBoxFilterSwapParcel,
|
||||
form.dpdPolandCarrierSwipBoxFilterFresh,
|
||||
form.dpdPolandCarrierSwipBoxFilterFittingRoom,
|
||||
form.dpdPolandCarrierSwipBoxFilterCardPayment,
|
||||
form.dpdPolandCarrierSwipBoxFilterRod,
|
||||
form.dpdPolandCarrierSwipBoxFilterLQ,
|
||||
form.dpdPolandCarrierSwipBoxFilterDigitalLabel,
|
||||
form.dpdPolandCarrierSwipBoxFilterDisabledFriendly,
|
||||
|
||||
] %}
|
||||
<div class="row">
|
||||
{% for item in apiConnection %}
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-xl-3">
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pt-2">
|
||||
<div class="col-12">
|
||||
<div class="pl-2">
|
||||
{{ form_label(form.dpdPolandCarrierPickup) }}
|
||||
{{ form_widget(form.dpdPolandCarrierPickup) }}
|
||||
{{ form_errors(form.dpdPolandCarrierPickup) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset-2 col-10">
|
||||
|
||||
{% if dpdCarrierPickup is not null and dpdCarrierPickup is not empty and dpdCarrierPickup[0].id is defined %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-2" scope="col">{{ 'Id'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Id Shop'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-6" scope="col">{{ 'Name'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Visible'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Actions'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in dpdCarrierPickup %}
|
||||
{% if row.id is defined %}
|
||||
<tr>
|
||||
<th>{{ row.id }}</th>
|
||||
<th>{{ row.idShop }}</th>
|
||||
<td>{{ row.name }}</td>
|
||||
<td>
|
||||
{% if row.active %}
|
||||
<i class="color_success"></i> <i class="material-icons" style="color:#009d00">done</i>
|
||||
{% else %}
|
||||
<i class="color_danger"></i> <i class="material-icons" style="color:red">blockade</i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ path('admin_carriers_edit', {'carrierId': row.id }) }}" type="button"
|
||||
class="btn btn-sm btn-secondary">{{ 'Configure'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if shopContext == 1 %}
|
||||
{% set apiConnection = [
|
||||
form.dpdPolandCarrierPickupFilterSwipBox,
|
||||
form.dpdPolandCarrierPickupFilterPointsWithServices
|
||||
] %}
|
||||
<p class="font-weight-bold">{{ 'Filters for Pickup map'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}:</p>
|
||||
<div class="row">
|
||||
{% for item in apiConnection %}
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-xl-3">
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% set apiConnection = [
|
||||
form.dpdPolandCarrierPickupFilterOpenLate,
|
||||
form.dpdPolandCarrierPickupFilterOpenSaturdays,
|
||||
form.dpdPolandCarrierPickupFilterOpenSundays,
|
||||
form.dpdPolandCarrierPickupFilterParking,
|
||||
form.dpdPolandCarrierPickupFilterDirectDelivery,
|
||||
form.dpdPolandCarrierPickupFilterDirectDeliveryCod,
|
||||
form.dpdPolandCarrierPickupFilterDropoffOnline,
|
||||
form.dpdPolandCarrierPickupFilterDropoffOffline,
|
||||
form.dpdPolandCarrierPickupFilterSwapParcel,
|
||||
form.dpdPolandCarrierPickupFilterFresh,
|
||||
form.dpdPolandCarrierPickupFilterFittingRoom,
|
||||
form.dpdPolandCarrierPickupFilterCardPayment,
|
||||
form.dpdPolandCarrierPickupFilterRod,
|
||||
form.dpdPolandCarrierPickupFilterLQ,
|
||||
form.dpdPolandCarrierPickupFilterDigitalLabel,
|
||||
form.dpdPolandCarrierPickupFilterDisabledFriendly,
|
||||
|
||||
] %}
|
||||
<div class="row">
|
||||
{% for item in apiConnection %}
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-xl-3">
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pt-2">
|
||||
<div class="col-12">
|
||||
<div class="pl-2">
|
||||
{{ form_label(form.dpdPolandCarrierPickupCOD) }}
|
||||
{{ form_widget(form.dpdPolandCarrierPickupCOD) }}
|
||||
{{ form_errors(form.dpdPolandCarrierPickupCOD) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset-2 col-10">
|
||||
|
||||
{% if dpdCarrierPickupCod is not null and dpdCarrierPickupCod is not empty and dpdCarrierPickupCod[0].id is defined %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-2" scope="col">{{ 'Id'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Id Shop'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-6" scope="col">{{ 'Name'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Visible'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Actions'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in dpdCarrierPickupCod %}
|
||||
{% if row.id is defined %}
|
||||
<tr>
|
||||
<th>{{ row.id }}</th>
|
||||
<th>{{ row.idShop }}</th>
|
||||
<td>{{ row.name }}</td>
|
||||
<td>
|
||||
{% if row.active %}
|
||||
<i class="color_success"></i> <i class="material-icons" style="color:#009d00">done</i>
|
||||
{% else %}
|
||||
<i class="color_danger"></i> <i class="material-icons" style="color:red">blockade</i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ path('admin_carriers_edit', {'carrierId': row.id }) }}" type="button"
|
||||
class="btn btn-sm btn-secondary">{{ 'Configure'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if shopContext == 1 %}
|
||||
{% set apiConnection = [
|
||||
form.dpdPolandCarrierPickupCODFilterSwipBox,
|
||||
form.dpdPolandCarrierPickupCODFilterPointsWithServices,
|
||||
] %}
|
||||
<p class="font-weight-bold">{{ 'Filters for Pickup map'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}:</p>
|
||||
<div class="row">
|
||||
{% for item in apiConnection %}
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-xl-3">
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% set apiConnection = [
|
||||
form.dpdPolandCarrierPickupCODFilterOpenLate,
|
||||
form.dpdPolandCarrierPickupCODFilterOpenSaturdays,
|
||||
form.dpdPolandCarrierPickupCODFilterOpenSundays,
|
||||
form.dpdPolandCarrierPickupCODFilterParking,
|
||||
form.dpdPolandCarrierPickupCODFilterDirectDelivery,
|
||||
form.dpdPolandCarrierPickupCODFilterDirectDeliveryCod,
|
||||
form.dpdPolandCarrierPickupCODFilterDropoffOnline,
|
||||
form.dpdPolandCarrierPickupCODFilterDropoffOffline,
|
||||
form.dpdPolandCarrierPickupCODFilterSwapParcel,
|
||||
form.dpdPolandCarrierPickupCODFilterFresh,
|
||||
form.dpdPolandCarrierPickupCODFilterFittingRoom,
|
||||
form.dpdPolandCarrierPickupCODFilterCardPayment,
|
||||
form.dpdPolandCarrierPickupCODFilterRod,
|
||||
form.dpdPolandCarrierPickupCODFilterLQ,
|
||||
form.dpdPolandCarrierPickupCODFilterDigitalLabel,
|
||||
form.dpdPolandCarrierPickupCODFilterDisabledFriendly,
|
||||
] %}
|
||||
<div class="row">
|
||||
{% for item in apiConnection %}
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-xl-3">
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pt-2">
|
||||
<div class="col-12">
|
||||
<div class="pl-2">
|
||||
{{ form_label(form.dpdPolandCarrierStandard) }}
|
||||
{{ form_widget(form.dpdPolandCarrierStandard) }}
|
||||
{{ form_errors(form.dpdPolandCarrierStandard) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset-2 col-10">
|
||||
|
||||
{% if dpdCarrier is not null and dpdCarrier is not empty and dpdCarrier[0].id is defined %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-2" scope="col">{{ 'Id'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Id Shop'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-6" scope="col">{{ 'Name'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Visible'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Actions'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in dpdCarrier %}
|
||||
{% if row.id is defined %}
|
||||
<tr>
|
||||
<th>{{ row.id }}</th>
|
||||
<th>{{ row.idShop }}</th>
|
||||
<td>{{ row.name }}</td>
|
||||
<td>
|
||||
{% if row.active %}
|
||||
<i class="color_success"></i> <i class="material-icons" style="color:#009d00">done</i>
|
||||
{% else %}
|
||||
<i class="color_danger"></i> <i class="material-icons" style="color:red">blockade</i>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ path('admin_carriers_edit', {'carrierId': row.id }) }}" type="button"
|
||||
class="btn btn-sm btn-secondary">{{ 'Configure'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pt-2">
|
||||
<div class="col-12">
|
||||
<div class="pl-2">
|
||||
{{ form_label(form.dpdPolandCarrierStandardCod) }}
|
||||
{{ form_widget(form.dpdPolandCarrierStandardCod) }}
|
||||
{{ form_errors(form.dpdPolandCarrierStandardCod) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset-2 col-10">
|
||||
{% if dpdCarrierCod is not null and dpdCarrierCod is not empty and dpdCarrierCod[0].id is defined %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-2" scope="col">{{ 'Id'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Id Shop'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-6" scope="col">{{ 'Name'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Visible'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
<th class="col-2" scope="col">{{ 'Actions'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in dpdCarrierCod %}
|
||||
{% if row.id is defined %}
|
||||
<tr>
|
||||
<th>{{ row.id }}</th>
|
||||
<th>{{ row.idShop }}</th>
|
||||
<td>{{ row.name }}</td>
|
||||
<td>
|
||||
{% if row.active %}
|
||||
<i class="color_success"></i> <i class="material-icons" style="color:#009d00">done</i>
|
||||
{% else %}
|
||||
<i class="color_danger"></i> <i class="material-icons" style="color:red">blockade</i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ path('admin_carriers_edit', {'carrierId': row.id }) }}" type="button"
|
||||
class="btn btn-sm btn-secondary">{{ 'Configure'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if shopContext == 1 %}
|
||||
<div class="row pt-2">
|
||||
<div class="col ml-3">
|
||||
<p class="mt-3 font-weight-bold">{{ 'COD payment methods'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}:</p>
|
||||
|
||||
{% for codPaymentMethod in form.dpdCarrierCodPaymentMethods %}
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="form-check form-check-inline">
|
||||
{{ form_widget(codPaymentMethod.enable, {'attr': {'class': 'form-check-input'}}) }}
|
||||
<label class="form-check-label" for="{{ codPaymentMethod.enable.vars.id }}"></label>
|
||||
</div>
|
||||
<span> {{ codPaymentMethod.displayName.vars.value }}</span>
|
||||
{{ form_errors(codPaymentMethod.enable) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-footer bg-white">
|
||||
{% if shopContext == 1 %}
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-secondary float-right" id="save-button">
|
||||
{{ 'Save'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_widget(form._token) }}
|
||||
{{ form_end(form, {'render_rest': false}) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
{{ form_start(form) }}
|
||||
<div class="card">
|
||||
<h3 class="card-header bg-white">
|
||||
{{ 'Configuration'|trans({}, 'Modules.Dpdshipping.AdminConfiguration') }}
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
{% if shopContext > 1 %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
{{ 'You are editing settings for multiple shops contexts. These settings will be applied to other contexts and may override current values.'|trans({}, 'Modules.Dpdshipping.Admin') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-wrapper">
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-white">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-secondary float-right" id="save-button">
|
||||
{{ 'Save'|trans({}, 'Modules.Dpdshipping.AdminConfiguration') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
{{ form_start(form) }}
|
||||
<div class="card">
|
||||
<h3 class="card-header bg-white">
|
||||
{{ 'Connection with DPD Poland'|trans({}, 'Modules.Dpdshipping.AdminConnection') }}
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
{% if shopContext > 1 %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
{{ 'You are editing settings for multiple shops contexts. These settings will be applied to other contexts and may override current values.'|trans({}, 'Modules.Dpdshipping.Admin') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-wrapper">
|
||||
{% set inputs = [
|
||||
form.name,
|
||||
form.login,
|
||||
form.password,
|
||||
form.masterfid,
|
||||
form.environment,
|
||||
] %}
|
||||
{% for item in inputs %}
|
||||
<div class="form-group row select-widget">
|
||||
{{ form_label(item) }}
|
||||
<div class="col-sm input-container">
|
||||
{{ form_widget(item, {'attr': {'class': 'form-control'}}) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div> <div class="form-wrapper">
|
||||
{% set inputs = [
|
||||
form.isDefault,
|
||||
] %}
|
||||
{% for item in inputs %}
|
||||
<div class="form-group row select-widget">
|
||||
{{ form_label(item) }}
|
||||
<div class="col-xs-12 col-sm-8 offset-sm-4">
|
||||
{{ form_widget(item, {'attr': {'class': 'form-control'}}) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 offset-sm-3">
|
||||
<h4>
|
||||
{{ 'Payer data'|trans({}, 'Modules.Dpdshipping.AdminConnection') }}
|
||||
</h4>
|
||||
|
||||
<table class="table mb-2" id="fidTable">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="col-4">{{ 'FID number'|trans({}, 'Modules.Dpdshipping.AdminConnection') }}</th>
|
||||
<th class="col-3">{{ 'FID name'|trans({}, 'Modules.Dpdshipping.AdminConnection') }}</th>
|
||||
<th class="col-1">{{ 'Default'|trans({}, 'Modules.Dpdshipping.AdminConnection') }}</th>
|
||||
<th class="col-1"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for payer in form.payerList %}
|
||||
<tr>
|
||||
<td>{{ form_widget(payer.name) }}</td>
|
||||
<td>{{ form_widget(payer.fid) }}</td>
|
||||
<td>{{ form_widget(payer.default) }}</td>
|
||||
<td><i class="material-icons btn btn-sm text-secondary delete-icon-gray dpdshipping-remove-row">delete</i></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-8 offset-sm-3 pb-2 mb-4">
|
||||
<button type="button" class="btn btn-sm btn-secondary float-right" id="addFidRow">
|
||||
{{ 'Add row'|trans({}, 'Modules.Dpdshipping.Button') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-white">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-secondary float-right" id="save-button">
|
||||
{{ 'Save'|trans({}, 'Modules.Dpdshipping.AdminConnection') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/configuration/connection.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-2">
|
||||
<a class="btn btn-primary float-right"
|
||||
href="{{ path('dpdshipping_connection_edit_form') }}">{{ 'Add new API connection'|trans({}, 'Modules.Dpdshipping.AdminAddress') }}</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
||||
{% block quotes_list_panel %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% include '@PrestaShop/Admin/Common/Grid/grid_panel.html.twig' with {'grid': quoteGrid} %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/configuration/connection-grid.js') }}"></script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,130 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="bg-white p-2">
|
||||
|
||||
<h2 class="pt-2 pb-2"> {{ 'Onboarding'|trans({}, 'Modules.Dpdshipping.AdminOnboarding') }}</h2>
|
||||
|
||||
|
||||
{% if shopContext > 1 %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
{{ 'You are editing settings for multiple shops contexts. These settings will be applied to other contexts and may override current values.'|trans({}, 'Modules.Dpdshipping.Admin') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{{ form_start(form, { 'attr' : { 'class': 'row' } }) }}
|
||||
|
||||
<div class="col-sm-12 col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ 'DPD Poland API connections'|trans({}, 'Modules.Dpdshipping.AdminOnboarding') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="alert alert-info mb-4" role="alert">
|
||||
{{ 'Configure DPD Poland API connection'|trans({}, 'Modules.Dpdshipping.AdminOnboarding') }}
|
||||
</div>
|
||||
|
||||
{% set apiConnection = [
|
||||
form.login,
|
||||
form.password,
|
||||
form.masterfid,
|
||||
form.defaultFidNumber,
|
||||
form.environment] %}
|
||||
{% for item in apiConnection %}
|
||||
|
||||
<div class="form-group row text-widget">
|
||||
{{ form_label(item) }}
|
||||
<div class="col-sm input-container">
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ 'Carriers'|trans({}, 'Modules.Dpdshipping.AdminOnboarding') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="alert alert-info mb-4" role="alert">
|
||||
{{ 'Select available shipping method. '|trans({}, 'Modules.Dpdshipping.AdminOnboarding') }}
|
||||
</div>
|
||||
|
||||
{% set apiConnection = [
|
||||
form.carrierDpdPolandSwipBox,
|
||||
form.carrierDpdPolandPickup,
|
||||
form.carrierDpdPolandPickupCod,
|
||||
form.carrierDpdPoland,
|
||||
form.carrierDpdPolandCod] %}
|
||||
{% for item in apiConnection %}
|
||||
|
||||
<div class="col-10 offset-2">
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-4">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{ 'Sender address'|trans({}, 'Modules.Dpdshipping.AdminOnboarding') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="alert alert-info mb-4" role="alert">
|
||||
{{ 'Configure default Sender address'|trans({}, 'Modules.Dpdshipping.AdminOnboarding') }}
|
||||
</div>
|
||||
|
||||
{% set apiConnection = [
|
||||
form.alias,
|
||||
form.company,
|
||||
form.name,
|
||||
form.street,
|
||||
form.postcode,
|
||||
form.city,
|
||||
form.country,
|
||||
form.phone,
|
||||
form.mail
|
||||
] %}
|
||||
{% for item in apiConnection %}
|
||||
|
||||
<div class="form-group row text-widget">
|
||||
{{ form_label(item) }}
|
||||
<div class="col-sm input-container">
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<button class="btn btn-secondary float-right" id="save-button">
|
||||
{{ 'Save'|trans({}, 'Modules.Dpdshipping.AdminOnboarding') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
{{ form_start(form) }}
|
||||
<div class="card">
|
||||
<h3 class="card-header bg-white">
|
||||
{{ 'Default parameters'|trans({}, 'Modules.Dpdshipping.AdminParameter') }}
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
{% if shopContext > 1 %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
{{ 'You are editing settings for multiple shops contexts. These settings will be applied to other contexts and may override current values.'|trans({}, 'Modules.Dpdshipping.Admin') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-wrapper">
|
||||
{% set inputs = [
|
||||
[form.ref1, form.ref1StaticValue],
|
||||
[form.ref2, form.ref2StaticValue],
|
||||
[form.customerData, form.customerDataStaticValue],
|
||||
[form.content, form.contentStaticValue],
|
||||
] %}
|
||||
{% for item in inputs %}
|
||||
<div class="form-group row text-widget">
|
||||
{{ form_label(item[0]) }}
|
||||
<div class="col input-container">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{ form_widget(item[0]) }}
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ form_widget(item[1]) }}
|
||||
</div>
|
||||
{{ form_errors(item[0]) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-white">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-secondary float-right" id="save-button">
|
||||
{{ 'Save'|trans({}, 'Modules.Dpdshipping.AdminParameter') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/configuration/parameters.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
{{ form_start(form) }}
|
||||
<div class="card">
|
||||
<h3 class="card-header bg-white">
|
||||
{{ 'Pickup courier settings'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }} {{ pickupCourierId }}
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-wrapper">
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-white">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-secondary float-right" id="save-button">
|
||||
{{ 'Save'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-2">
|
||||
<a class="btn btn-primary float-right"
|
||||
href="{{ path('dpdshipping_pickup_courier_settings_form') }}">{{ 'Add'|trans({}, 'Modules.Dpdshipping.AdminAddress') }}</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
||||
{% block quotes_list_panel %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% include '@PrestaShop/Admin/Common/Grid/grid_panel.html.twig' with {'grid': quoteGrid} %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/configuration/pickup-courier-settings-grid.js') }}"></script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,153 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% form_theme form '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar-configuration.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
{{ form_start(form) }}
|
||||
<div class="card">
|
||||
<h3 class="card-header bg-white">
|
||||
{{ 'Special prices'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
{% if shopContext > 1 %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
{{ 'You are editing settings for multiple shops contexts. These settings will be applied to other contexts and may override current values.'|trans({}, 'Modules.Dpdshipping.Admin') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<p>
|
||||
{{ 'Select an available shipping method for the Create Prestashop carrier. You can manage carriers on the standard prestashop page.'|trans({}, 'Modules.Dpdshipping.AdminCarrier') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="pl-2">
|
||||
{{ form_label(form.specialPrice) }}
|
||||
{{ form_widget(form.specialPrice) }}
|
||||
{{ form_errors(form.specialPrice) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="pagination-info" class="text-right" style="margin-top: 1rem;">
|
||||
<span id="pagination-info-rows-from"></span> - <span id="pagination-info-rows-to"></span>
|
||||
{{ 'from'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}
|
||||
<span id="pagination-info-pages"></span>
|
||||
</div>
|
||||
<table id="specialPriceTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-1">{{ 'Country'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</th>
|
||||
<th class="col-1">{{ 'Cart price from (PLN)'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</th>
|
||||
<th class="col-1">{{ 'Cart price up to (PLN)'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</th>
|
||||
<th class="col-1">{{ 'Package weight from (kg)'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</th>
|
||||
<th class="col-1">{{ 'Package weight up to (kg)'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</th>
|
||||
<th class="col-1">{{ 'Price per package (PLN)'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</th>
|
||||
<th class="col-4">{{ 'Delivery method'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</th>
|
||||
<th class="col-1">{{ 'Price for COD service (PLN)'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</th>
|
||||
<th class="col-1">{{ 'Action'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in form.specialPriceList %}
|
||||
<tr>
|
||||
<td>{{ form_widget(item.isoCountry) }}</td>
|
||||
<td>{{ form_widget(item.priceFrom) }}</td>
|
||||
<td>{{ form_widget(item.priceTo) }}</td>
|
||||
<td>{{ form_widget(item.weightFrom) }}</td>
|
||||
<td>{{ form_widget(item.weightTo) }}</td>
|
||||
<td>{{ form_widget(item.parcelPrice) }}</td>
|
||||
<td>{{ form_widget(item.carrierType) }}</td>
|
||||
<td>{{ form_widget(item.codPrice) }}</td>
|
||||
<td>
|
||||
<i class="material-icons btn btn-sm text-secondary delete-icon-gray dpdshipping-remove-row float-right">delete</i>
|
||||
<i class="material-icons btn btn-sm text-secondary delete-icon-gray dpdshipping-duplicate-row float-right">content_copy</i>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="col pb-2 pt-2 mb-4">
|
||||
<button type="button" class="btn btn-sm btn-secondary float-right" id="addFidRow">
|
||||
{{ 'Add row'|trans({}, 'Modules.Dpdshipping.Button') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dpdSpecialPricePagination" class="text-center mb-2"></div>
|
||||
<div class="card-footer bg-white">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-secondary float-right" id="save-button">
|
||||
{{ 'Save'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
<div class="card">
|
||||
<h3 class="card-header bg-white">
|
||||
{{ 'Special price configuration'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6 border-right">
|
||||
<h4>{{ 'Export Data'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</h4>
|
||||
<p class="text-muted">
|
||||
{{ 'Click the button below to export your special price configuration data as a CSV file.'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}
|
||||
</p>
|
||||
<button class="btn btn-secondary export-btn w-20" id="dpdSpecialPriceExportButton">
|
||||
<i class="fas fa-file-export"></i> {{ 'Export to CSV'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<h4>{{ 'Import Data'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</h4>
|
||||
<p class="text-muted">
|
||||
{{ 'Choose a CSV file to upload and update your special price configuration data.'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}
|
||||
</p>
|
||||
<div class="d-flex align-items-center">
|
||||
<label for="dpdSpecialPriceImportFile" class="btn btn-secondary m-0">
|
||||
<i class="fas fa-file-upload"></i> {{ 'Choose File'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}
|
||||
</label>
|
||||
<input
|
||||
type="file"
|
||||
id="dpdSpecialPriceImportFile"
|
||||
class="import-file d-none"
|
||||
accept=".csv"
|
||||
/>
|
||||
<span id="selectedFileName" class="ml-2 text-muted">{{ 'No file chosen'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}</span>
|
||||
</div>
|
||||
<button class="btn btn-secondary import-btn w-20 mt-3" id="dpdSpecialPriceImportFileButton">
|
||||
<i class="fas fa-upload"></i> {{ 'Import CSV'|trans({}, 'Modules.Dpdshipping.AdminSpecialPrice') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/configuration/special-price.js') }}"></script>
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/configuration/special-price-data.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
{% set currentTimestampOrderDetailsCss = date("now")|date("U") %}
|
||||
<link rel="stylesheet" href="{{ asset('../modules/dpdshipping/views/admin/special-price.css?' ~ currentTimestampOrderDetailsCss) }}"/>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,5 @@
|
||||
{% if record.is_delivered %}
|
||||
<span class="badge badge-success">YES</span>
|
||||
{% else %}
|
||||
<span class="badge badge-danger">NO</span>
|
||||
{% endif %}
|
||||
33
modules/dpdshipping/views/templates/admin/grid/index.php
Normal file
33
modules/dpdshipping/views/templates/admin/grid/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
33
modules/dpdshipping/views/templates/admin/index.php
Normal file
33
modules/dpdshipping/views/templates/admin/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,68 @@
|
||||
{% trans_default_domain 'Module.Dpdshipping.Admin.Order' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="card p-0 m-0 border-0">
|
||||
<div class="card-header">
|
||||
<h3>
|
||||
<img class="dpdshipping-logo" src="/modules/dpdshipping/logo.png"
|
||||
alt="DPD Poland"/> {{ 'DPD Poland generate shipping'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
|
||||
<a href="{{ path('dpdshipping_connection_form') }}"><i class="material-icons float-right">settings</i></a>
|
||||
<a href="{{ path('dpdshipping_shipping_history_form') }}"><i class="material-icons float-right">history</i></a>
|
||||
</h3>
|
||||
|
||||
</div>
|
||||
<div class="card-body pt-2">
|
||||
|
||||
<div class="alert-messages">
|
||||
{% if successMsg|length %}
|
||||
<div class="alert alert-success">{{ successMsg }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if errorMsg|length %}
|
||||
<div class="alert alert-danger">{{ errorMsg }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="alert alert-success success-message-ajax" style="display: none"></div>
|
||||
<div class="alert alert-danger error-message-ajax" style="display: none"></div>
|
||||
|
||||
<a href="{{ path('admin_orders_view', {'orderId': orderId}) }}" type="button"
|
||||
class="btn btn-primary">{{ 'New shipping'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</a>
|
||||
<button id="print-label"
|
||||
class="btn btn-secondary"
|
||||
data-url="{{ path('dpdshipping_shipping_history_print_labels_form') }}"
|
||||
data-shipping-history-id="{{ shippingHistoryId }}">
|
||||
{{ 'Print label'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
</button>
|
||||
|
||||
{% if showReturnLabel|length %}
|
||||
<button id="print-return-label"
|
||||
class="btn btn-secondary"
|
||||
data-url="{{ path('dpdshipping_return_label') }}"
|
||||
data-shipping-history-id="{{ shippingHistoryId }}"
|
||||
data-order-id="{{ orderId }}">
|
||||
{{ 'Print return label'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{# #}
|
||||
{# <a href="{{ path('dpdshipping_return_label', {'shippingHistoryId': shippingHistoryId, 'orderId': orderId}) }}" type="button" #}
|
||||
{# class="btn btn-secondary">{{ 'Print return label'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</a> #}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" href="{{ asset('../modules/dpdshipping/views/css/order-details.css') }}"/>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% set currentTimestamp = date("now")|date("U") %}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/order-details.js?' ~ currentTimestamp) }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,458 @@
|
||||
{% trans_default_domain 'Module.Dpdshipping.Admin.Order' %}
|
||||
|
||||
{% form_theme form '@PrestaShop/Admin/TwigTemplateForm/prestashop_ui_kit.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{{ form_start(form) }}
|
||||
<input type="hidden" id="dpdShippingOrderProducts" data-products="{{ products | json_encode }}"/>
|
||||
<input type="hidden" id="dpdShippingOrderNumber" data-order-number="{{ order_reference }}"/>
|
||||
<input type="hidden" id="dpdShippingOrderNumberEmpik" data-order-number-empik="{{ order_reference_empik }}"/>
|
||||
<input type="hidden" id="dpdShippingOrderId" data-order-id="{{ order_id }}"/>
|
||||
<input type="hidden" id="dpdShippingDefaultWeight" data-default-weight="{{ default_weight }}"/>
|
||||
<input type="hidden" id="dpdShippingInvoiceNumber" data-invoice-number="{{ invoice_number }}"/>
|
||||
<input type="hidden" id="dpdShippingIsDpdCarrier" data-dpd-carrier="{{ is_dpd_carrier }}"/>
|
||||
<input type="hidden" id="dpdPudoFinderUrl" data-dpd-pudo-finder-url="{{ dpdPudoFinderUrl }}"/>
|
||||
<input type="hidden" id="dpdShippingSource"
|
||||
data-content-source="{{ content_source }}"
|
||||
data-order-source="{{ order_source }}"
|
||||
data-content-source-static="{{ content_source_static }}"
|
||||
data-customer-source="{{ customer_source }}"
|
||||
data-customer-source-static="{{ customer_source_static }}"
|
||||
/>
|
||||
|
||||
<input type="hidden" id="packageGroupType" value="{{ package_group_type }}"/>
|
||||
|
||||
<div class="card p-0 m-0 border-0">
|
||||
<div class="card-header">
|
||||
<h3>
|
||||
<img class="dpdshipping-logo" src="/modules/dpdshipping/logo.png"
|
||||
alt="DPD Poland"/> {{ 'DPD Poland generate shipping'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
|
||||
<a href="#" id="dpdToggleButton" class="float-right"><span class="material-icons">expand_less</span></a>
|
||||
<a href="{{ path('dpdshipping_connection_form') }}"><i class="material-icons float-right">settings</i></a>
|
||||
<a href="{{ path('dpdshipping_shipping_history_form') }}"><i class="material-icons float-right">history</i></a>
|
||||
</h3>
|
||||
|
||||
{% if dpd_carrier %}
|
||||
<span class="dpdshipping-carrier-name">{{ 'Carrier: '|trans({}, 'Modules.Dpdshipping.AdminOrder') }} <b>{{ dpd_carrier.name }}</b></span>
|
||||
{% else %}
|
||||
<span class="dpdshipping-carrier-name">{{ 'Carrier: '|trans({}, 'Modules.Dpdshipping.AdminOrder') }} <b>{{ 'The shipping method is different from DPD Poland, but you can still send it with DPD!'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</b></span>
|
||||
{% endif %}
|
||||
|
||||
{% if payment_method %}
|
||||
<span class="dpdshipping-carrier-name">{{ 'Payment: '|trans({}, 'Modules.Dpdshipping.AdminOrder') }} <b>{{ payment_method }}</b></span>
|
||||
{% endif %}
|
||||
|
||||
{% if order_source %}
|
||||
{% if order_source == 'DELIVERY_EMPIK_STORE' %}
|
||||
<span class="dpdshipping-carrier-name">{{ 'Source: '|trans({}, 'Modules.Dpdshipping.AdminOrder') }} <b>{{ 'Delivery to the EMPIK store'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</b></span>
|
||||
{% elseif order_source == 'EMPIK' %}
|
||||
<span class="dpdshipping-carrier-name">{{ 'Source: '|trans({}, 'Modules.Dpdshipping.AdminOrder') }} <b>{{ 'EMPIK marketplace'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</b></span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="row dpdApiPayer">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
{% set apiConnection = [
|
||||
form.connection_id] %}
|
||||
{% for item in apiConnection %}
|
||||
<div class="form-group mb-0">
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4">
|
||||
{% set payer = [
|
||||
form.payer_number] %}
|
||||
{% for item in payer %}
|
||||
<div class="form-group mb-0">
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pt-2">
|
||||
{% if successMsg|length %}
|
||||
<div class="alert alert-success">{{ successMsg }}</div>
|
||||
{% elseif errors|length %}
|
||||
<div class="alert alert-danger">
|
||||
{% for error in errors %}
|
||||
<p>{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if form.vars.errors is not empty %}
|
||||
<div class="alert alert-danger">
|
||||
{% for error in form.vars.errors %}
|
||||
<p>{{ error.message }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if is_cod_payment and form.service_cod.vars.data == false %}
|
||||
<div class="alert alert-danger">
|
||||
<p>{{ 'The selected payment method is COD. You should check the COD service!'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="row dpd-shipping-generate-form">
|
||||
<div class="col-xs-12 col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 mb-1">
|
||||
<h4>{{ 'Sender address'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</h4>
|
||||
<select id="dpdShippingSenderAddresses" class="form-control mb-2">
|
||||
{% for item in sender_address_list %}
|
||||
<option data-address="{{ item | json_encode }}">{{ item.company }} {{ item.name }} {{ item.street }} {{ item.postcode }} {{ item.city }} {{ item.country }} {{ item.phone }} {{ item.email }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% set sender_address = [
|
||||
form.sender_address_company,
|
||||
form.sender_address_name,
|
||||
form.sender_address_street,
|
||||
form.sender_address_postcode,
|
||||
form.sender_address_city,
|
||||
form.sender_address_country,
|
||||
form.sender_address_phone,
|
||||
form.sender_address_email] %}
|
||||
{% for item in sender_address %}
|
||||
<div class="form-group">
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6 border-generate-shipping">
|
||||
<h4>{{ 'Receiver address'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</h4>
|
||||
|
||||
<select id="dpdShippingReceiverAddresses" class="form-control mb-2">
|
||||
{% for item in receiver_address_list %}
|
||||
<option data-address="{{ item | json_encode }}">{{ item.company }} {{ item.name }} {{ item.street }} {{ item.postcode }} {{ item.city }} {{ item.country }} {{ item.phone }} {{ item.email }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
{% set receiver_address = [
|
||||
form.receiver_address_company,
|
||||
form.receiver_address_name,
|
||||
form.receiver_address_street,
|
||||
form.receiver_address_postcode,
|
||||
form.receiver_address_city,
|
||||
form.receiver_address_country,
|
||||
form.receiver_address_phone,
|
||||
form.receiver_address_email] %}
|
||||
{% for item in receiver_address %}
|
||||
<div class="form-group">
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 dpd-shipping-services">
|
||||
<h4 class="mb-2">{{ 'Services'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</h4>
|
||||
|
||||
<div class="row mr-0">
|
||||
{% set services = [
|
||||
form.service_guarantee,
|
||||
form.service_guarantee_type,
|
||||
form.service_guarantee_value,
|
||||
form.service_in_pers,
|
||||
form.service_priv_pers,
|
||||
form.service_cod,
|
||||
form.service_cod_value,
|
||||
form.service_cod_currency,
|
||||
form.service_self_con,
|
||||
form.service_self_con_value,
|
||||
form.service_dpd_pickup,
|
||||
form.service_dpd_pickup_value,
|
||||
form.service_dpd_pickup_map,
|
||||
form.service_rod,
|
||||
form.service_dox,
|
||||
form.service_cud,
|
||||
form.service_tires,
|
||||
form.service_declared_value,
|
||||
form.service_declared_value_value,
|
||||
form.service_declared_value_currency,
|
||||
form.service_dpd_express,
|
||||
form.service_dpd_food,
|
||||
form.service_dpd_food_value,
|
||||
form.service_duty,
|
||||
form.service_duty_value,
|
||||
form.service_duty_currency,
|
||||
form.service_adr,
|
||||
form.service_return_label,
|
||||
form.service_return_label_address_company,
|
||||
form.service_return_label_address_name,
|
||||
form.service_return_label_address_street,
|
||||
form.service_return_label_address_city,
|
||||
form.service_return_label_address_postcode,
|
||||
form.service_return_label_address_country,
|
||||
form.service_return_label_address_phone,
|
||||
form.service_return_label_address_email
|
||||
] %}
|
||||
{% for item in services %}
|
||||
<div class="{{ item.vars.name }} form-group mb-0
|
||||
{% if item.vars.attr['data-hidden']|default(false) == true %} hidden {% endif %}
|
||||
{% if item.vars.name starts with 'service_return_label_' or
|
||||
item.vars.name starts with 'service_dpd_food_value' %} col-12
|
||||
{% elseif item.vars.attr['data-attribute']|default(false) == true %} m-0 pl-3 pt-1 p-0 col-xs-12 col-md-6
|
||||
{% elseif
|
||||
item.vars.name starts with 'service_cod_value' or
|
||||
item.vars.name starts with 'service_cod_currency' or
|
||||
item.vars.name starts with 'service_duty_value' or
|
||||
item.vars.name starts with 'service_duty_currency' or
|
||||
item.vars.name starts with 'service_dpd_pickup_value' or
|
||||
item.vars.name starts with 'service_dpd_pickup_map' %} m-0 pl-3 pt-1 p-0 col-xs-12 col-md-6
|
||||
{% else %} col-12
|
||||
{% endif %}">
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item) }}
|
||||
{% if item.vars.block_prefixes[0] != 'button' %}
|
||||
{{ form_errors(item) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if not item.vars.attr['data-attribute']|default(false) == true or
|
||||
item.vars.name starts with 'service_cod_value' or
|
||||
item.vars.name starts with 'service_cod_currency' or
|
||||
item.vars.name starts with 'service_duty_value' or
|
||||
item.vars.name starts with 'service_duty_currency' or
|
||||
item.vars.name starts with 'service_dpd_pickup_value' or
|
||||
item.vars.name starts with 'service_dpd_pickup_map' %}
|
||||
<div class="clearfix"></div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col mt-2 mb-2">
|
||||
<button type="button" class="btn btn-sm btn-secondary" id="dpdShippingSingleShipping">
|
||||
{{ 'Single Shipping'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" id="dpdShippingGroupShipping">
|
||||
{{ 'Shipping for products group'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" id="dpdShippingPackageShipping">
|
||||
{{ 'Shipping for each product'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-toggle="modal" data-target="#dpdShippingCustomShippingModal" id="dpdShippingCustomShipping">
|
||||
{{ 'Custom'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<table class="table mb-2" id="packagesTable">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="col-1">{{ 'Weight [kg]'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="dpdShippingWeightAdr hidden" class="col-1">{{ 'Weight ADR [kg]'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-3">{{ 'Content'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-4">{{ 'Customer Data'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-1">{{ 'Size X [cm]'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-1">{{ 'Size Y [cm]'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-1">{{ 'Size Z [cm]'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-1"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in form.packages %}
|
||||
<tr>
|
||||
<td>{{ form_widget(item.weight, {'attr': {'fieldType': 'weight'}}) }}</td>
|
||||
<td class="dpdShippingWeightAdr hidden">{{ form_widget(item.weightAdr, {'attr': {'fieldType': 'weightAdr'}}) }}</td>
|
||||
<td>{{ form_widget(item.content, {'attr': {'fieldType': 'content'}}) }}</td>
|
||||
<td>{{ form_widget(item.customerData, {'attr': {'fieldType': 'customerData'}}) }}</td>
|
||||
<td>{{ form_widget(item.sizeX, {'attr': {'fieldType': 'sizeX'}}) }}</td>
|
||||
<td>{{ form_widget(item.sizeY, {'attr': {'fieldType': 'sizeY'}}) }}</td>
|
||||
<td>{{ form_widget(item.sizeZ, {'attr': {'fieldType': 'sizeZ'}}) }}</td>
|
||||
<td><i class="material-icons btn btn-sm text-secondary delete-icon-gray dpdshipping-remove-row">delete</i></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<button type="button" class="btn btn-sm btn-secondary float-right" id="dpdShippingAddRow">
|
||||
{{ 'Add row'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
{% set additionalFields = [
|
||||
form.ref1,
|
||||
form.ref2] %}
|
||||
{% for item in additionalFields %}
|
||||
<div class="form-group additional-fields-generate-shipping">
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-white">
|
||||
<div class="alert alert-danger dpdShippingEmpikDpdPickupAlert" style="display: none">
|
||||
<p>{{ 'Warning! You are generating a shipment to Empik without the DPD Pickup Point service.'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</p>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-primary float-right" id="save-button">
|
||||
{{ 'Generate shipping'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
|
||||
{# MODAL #}
|
||||
<div class="modal fade" id="dpdShippingCustomShippingModal" tabindex="-1" role="dialog" aria-labelledby="dpdShippingCustomShippingModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="dpdShippingCustomShippingModalLabel">{{ 'DPD Poland custom shipping'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-inline">
|
||||
<div class="form-group mr-3">
|
||||
<label for="dpdShippingCustomShippingParcels" class="mr-2">{{ 'Packages'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</label>
|
||||
<input type="number" class="form-control" id="dpdShippingCustomShippingParcels" name="dpdShippingCustomShippingParcels" value="1">
|
||||
</div>
|
||||
<button id="dpdShippingCalcShippingRows" type="button"
|
||||
class="btn btn-secondary">{{ 'Change'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% for product in products %}
|
||||
<table class="table mb-0 pb-0">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="col-xs-12 col-md-9">{{ 'Product'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-xs-12 col-md-3">{{ 'Package'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for productRow in range(0, (product.product_quantity|round(0, 'ceil'))-1) %}
|
||||
<tr>
|
||||
<td> {{ productRow+1 }} : {{ product.product_name }}
|
||||
<input type="hidden" name="dpdShippingCustomShippingProductName[{{ productRow }}][]" value="{{ product.product_name }}">
|
||||
<input type="hidden" name="dpdShippingCustomShippingProductId[{{ productRow }}][]" value="{{ product.product_id }}">
|
||||
<input type="hidden" name="dpdShippingCustomShippingProductWeight[{{ productRow }}][]" value="{{ product.product_weight }}">
|
||||
<input type="hidden" name="dpdShippingCustomShippingProductReference[{{ productRow }}][]" value="{{ product.product_reference }}">
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control dpdShippingCustomParcelSelect" name="dpdShippingCustomShippingParcel[{{ productRow }}][]">
|
||||
<option value="">-</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row hidden" id="dpdShippingParcelSummaryRow">
|
||||
<div class="col">
|
||||
<h3 class="mt-3">{{ 'Summary'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</h3>
|
||||
<table class="table mb-0 pb-0">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="col-xs-12 col-md-2">{{ 'Package number'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-xs-12 col-md-6">{{ 'Content'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-xs-12 col-md-6">{{ 'Customer data'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-xs-12 col-md-4">{{ 'Products weight'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="dpdShippingCustomParcelSummaryTable">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="dpdShippingCustomParcelSave" type="button" class="btn btn-secondary"
|
||||
data-dismiss="modal">{{ 'Save'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="dpdshippingPudoModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dpd-xl" role="document">
|
||||
<div class="modal-content modal-dpd-content">
|
||||
<div class="modal-body modal-dpd-body">
|
||||
|
||||
<script id="dpdshiping-widget-pudo" type="text/javascript">
|
||||
function dpdShippingPointSelected(pudoCode) {
|
||||
$('#dpd_shipping_generate_shipping_service_dpd_pickup_value').val(pudoCode);
|
||||
$('#dpdshippingPudoModal').modal('toggle');
|
||||
$(".modal-backdrop").hide();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
const dpdshipping_iframe = document.createElement("iframe");
|
||||
dpdshipping_iframe.setAttribute("id", "dpdshiping-widget-pudo-iframe");
|
||||
dpdshipping_iframe.setAttribute("allow", "geolocation");
|
||||
dpdshipping_iframe.src = '//pudofinder.dpd.com.pl/widget?key=1ae3418e27627ab52bebdcc1a958fa04';
|
||||
dpdshipping_iframe.style.width = "100%";
|
||||
dpdshipping_iframe.style.border = "none";
|
||||
dpdshipping_iframe.style.minHeight = "400px";
|
||||
dpdshipping_iframe.style.height = "700px";
|
||||
|
||||
const dpdshipping_script = document.getElementById("dpdshiping-widget-pudo");
|
||||
if (dpdshipping_script)
|
||||
dpdshipping_script.parentNode.insertBefore(dpdshipping_iframe, dpdshipping_script);
|
||||
|
||||
const dpdshipping_eventListener = window[window.addEventListener ? "addEventListener" : "attachEvent"];
|
||||
const dpdshipping_messageEvent = ("attachEvent" === dpdshipping_eventListener) ? "onmessage" : "message";
|
||||
dpdshipping_eventListener(dpdshipping_messageEvent, function (a) {
|
||||
if (a.data.height && !isNaN(a.data.height)) {
|
||||
dpdshipping_iframe.style.height = a.data.height + "px"
|
||||
} else if (a.data.point_id)
|
||||
dpdShippingPointSelected(a.data.point_id);
|
||||
}, !1);
|
||||
|
||||
</script>
|
||||
</div>
|
||||
<div class="modal-footer modal-dpd-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ 'Close'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block stylesheets %}
|
||||
{% set currentTimestampOrderDetailsCss = date("now")|date("U") %}
|
||||
<link rel="stylesheet" href="{{ asset('../modules/dpdshipping/views/css/order-details.css?' ~ currentTimestampOrderDetailsCss) }}"/>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% set currentTimestampOrderDetailsJs = date("now")|date("U") %}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/order-details.js?' ~ currentTimestampOrderDetailsJs) }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
33
modules/dpdshipping/views/templates/admin/order/index.php
Normal file
33
modules/dpdshipping/views/templates/admin/order/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,17 @@
|
||||
{% trans_default_domain 'Module.Dpdshipping.Admin.Order' %}
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link"
|
||||
id="dpdShippingTrackingTab"
|
||||
data-toggle="tab"
|
||||
href="#dpdShippingTrackingTabContent"
|
||||
role="tab"
|
||||
aria-controls="dpdShippingTrackingTabContent"
|
||||
aria-expanded="true"
|
||||
aria-selected="false"
|
||||
>
|
||||
<img class="dpdshipping-logo" src="/modules/dpdshipping/logo.png"
|
||||
alt="DPD Poland" style="width: 25px; margin-right: 10px;"/>
|
||||
{{ 'DPD Shipping history'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
</a>
|
||||
</li>
|
||||
@@ -0,0 +1,62 @@
|
||||
{% trans_default_domain 'Module.Dpdshipping.Admin.Order' %}
|
||||
|
||||
<div class="tab-pane fade show" id="dpdShippingTrackingTabContent" role="tabpanel" aria-labelledby="trackingTab">
|
||||
<table class="table p-0 m-0">
|
||||
<tbody>
|
||||
{% if shippingHistory|length <= 0 %}
|
||||
{{ 'No shipments'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
{% endif %}
|
||||
|
||||
{% for shipment in shippingHistory %}
|
||||
<tr>
|
||||
<td class="col-md-3"><strong><a href="https://tracktrace.dpd.com.pl/parcelDetails?typ=1&p1={{ shipment.shippingNumber }}"
|
||||
target="_blank">{{ shipment.shippingNumber }}</a></strong>
|
||||
</td>
|
||||
<td class="col-md-1">
|
||||
{% set isDelivered = false %}
|
||||
{% for stateObject in shipment.states %}
|
||||
{% if stateObject.state|trim == "Przesyłka doręczona" %}
|
||||
{% set isDelivered = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if shipment.states|length <= 0 %}
|
||||
<i class="material-icons icon">not_listed_location</i>
|
||||
{% elseif isDelivered %}
|
||||
<i class="material-icons icon">done</i>
|
||||
{% else %}
|
||||
<i class="material-icons icon">flight_takeoff</i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="col-md-8">
|
||||
{% if shipment.states is defined and shipment.states|length > 0 %}
|
||||
<button class="btn dpdshipping-tracking-detail-btn btn-icon-right dpdshipping-btn-full-width mb-2">
|
||||
{{ shipment.states[0].dateTime |date("d-m-Y H:i:s") }} - {{ shipment.states[0].state }}
|
||||
<i class="material-icons icon">expand_more</i>
|
||||
</button>
|
||||
{% else %}
|
||||
{{ 'No data'|trans({}, 'Modules.Dpdshipping.AdminOrder') }}
|
||||
{% endif %}
|
||||
|
||||
<table class="table pb-0 mb-0 dpdshipping-tracking-detail hidden">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="col-md-4 col-xl-3 border-0">{{ 'Date and time '|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
<th class="col-md-8 col-xs-9 border-0">{{ 'State '|trans({}, 'Modules.Dpdshipping.AdminOrder') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for state in shipment.states %}
|
||||
<tr>
|
||||
<td><strong>{{ state.dateTime |date("d-m-Y H:i:s") }}</strong></td>
|
||||
<td>{{ state.state }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,129 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
{% block quotes_list_panel %}
|
||||
|
||||
<p class="alert alert-danger errorMessagePickupCourier" style="display: none"></p>
|
||||
<p class="alert alert-warning warnMessagePickupCourier" style="display: none"></p>
|
||||
|
||||
<div class="bg-white p-2">
|
||||
<h2 class="pt-2 pb-2"> {{ 'Pickup courier'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}</h2>
|
||||
|
||||
{{ form_start(form, { 'attr' : { 'class': 'row','id': 'dpdshipping_pickup_courier_form' } }) }}
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<h3>
|
||||
{{ 'Sender address'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}
|
||||
</h3>
|
||||
|
||||
{{ form_label(form.dpdshipping_pickup_courier_sender_address) }}
|
||||
{{ form_widget(form.dpdshipping_pickup_courier_sender_address) }}
|
||||
|
||||
<div class="card bg-light" id="senderAddressContainer" style="display: none">
|
||||
<div class="card-body">
|
||||
<p class="m-0" id="senderFullName"></p>
|
||||
<p class="m-0" id="senderName"></p>
|
||||
<p class="m-0" id="senderAddress"></p>
|
||||
<p class="m-0" id="senderPostalCode"></p>
|
||||
<p class="m-0" id="senderCity"></p>
|
||||
<p class="m-0" id="senderCountryCode"></p>
|
||||
<p class="m-0" id="senderPhone"></p>
|
||||
<p class="m-0"><strong>{{ 'Payer number:'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}
|
||||
</strong> <span id="payerNumber"></span></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% set senderAddress = [
|
||||
form.customer_company,
|
||||
form.customer_name,
|
||||
form.customer_phone
|
||||
] %}
|
||||
{% for item in senderAddress %}
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item, { 'attr' : { 'class': 'mb-2' } }) }}
|
||||
{{ form_errors(item) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<h3>
|
||||
{{ 'Pickup date and time'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}
|
||||
</h3>
|
||||
{% set pickup = [
|
||||
form.pickup_date
|
||||
] %}
|
||||
{% for item in pickup %}
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item) }}
|
||||
{{ form_errors(item) }}
|
||||
<div class="mb-2"></div>
|
||||
{% endfor %}
|
||||
|
||||
<div id="button_get_pickup_time_frames" class="btn btn-primary btn-sm mb-3" style="float: right;">
|
||||
{{ 'Get pickup time frames'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div id="pickupTimeContainer" style="display: none">
|
||||
{% set pickup = [
|
||||
form.pickup_time
|
||||
] %}
|
||||
{% for item in pickup %}
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item) }}
|
||||
<div class="mb-2"></div>
|
||||
{% endfor %}
|
||||
|
||||
<p class="mt-2 alert alert-info">
|
||||
{{ 'Date available until'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}
|
||||
<span class="p-0" id="timeFrameHour"></span> {{ 'on '|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }} <span class="p-0" id="timeFrameDate"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<h3>
|
||||
{{ 'Shipping'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}
|
||||
</h3>
|
||||
{% set shipping = [
|
||||
form.letters,
|
||||
form.letters_count,
|
||||
form.packages,
|
||||
form.packages_count,
|
||||
form.packages_weight_sum,
|
||||
form.packages_weight_max,
|
||||
form.packages_size_x_max,
|
||||
form.packages_size_y_max,
|
||||
form.packages_size_z_max,
|
||||
|
||||
form.palette,
|
||||
form.palette_count,
|
||||
form.palette_weight_sum,
|
||||
form.palette_weight_max,
|
||||
form.palette_size_y_max,
|
||||
] %}
|
||||
{% for item in shipping %}
|
||||
{{ form_label(item) }}
|
||||
{{ form_widget(item, { 'attr' : { 'class': 'mb-2' } }) }}
|
||||
{{ form_errors(item) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="col-12 mt-3 mb-3">
|
||||
<button class="btn btn-primary float-right" id="pickup-courier-add-save-button">
|
||||
{{ 'Pickup courier'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/dpdshipping-pickup-courier.js') }}"></script>
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/dpdshipping-pickup-courier-ajax.js') }}"></script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,26 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
{% block quotes_list_panel %}
|
||||
<div class="row">
|
||||
<div class="col-12 mb-2">
|
||||
<a class="btn btn-primary float-right"
|
||||
href="{{ path('dpdshipping_pickup_courier_edit_form') }}">{{ 'Pickup courier'|trans({}, 'Modules.Dpdshipping.AdminPickupCourier') }}</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
{% include '@PrestaShop/Admin/Common/Grid/grid_panel.html.twig' with {'grid': quoteGrid} %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/pickup-courier-grid.js') }}"></script>
|
||||
<script src="{{ asset('themes/default/js/bundle/pagination.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,260 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
<div class="container-fluid pt-2 pb-2 bg-white">
|
||||
|
||||
<h2 class="pt-2">
|
||||
{{ 'Shipping details'|trans({}, 'Modules.Dpdshipping.Admin') }}
|
||||
<p class="dpdshipping-order-detail-shipping-subtitle">2024-03-15 10:30:00</p>
|
||||
<p class="dpdshipping-order-detail-shipping-subtitle">{{ 'Order'|trans({}, 'Modules.Dpdshipping.Admin') }}: <b>{{ orderId }}</b></p>
|
||||
</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<p class="mb-0">{{ 'Sender Address'|trans({}, 'Modules.Dpdshipping.Admin') }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Company'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">Company name</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Sender Name'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">John Doe</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Address'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">123 Main Street, City, State, ZIP</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Phone'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">123-456-7890</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<p class="mb-0">{{ 'Receiver Address'|trans({}, 'Modules.Dpdshipping.Admin') }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Company'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">Company name</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Sender Name'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">John Doe</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Address'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">123 Main Street, City, State, ZIP</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Phone'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">123-456-7890</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<p class="mb-0">{{ 'Services'|trans({}, 'Modules.Dpdshipping.Admin') }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="card-text"><strong>COD</strong> 70,00 PLN</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<p class="mb-0">{{ 'Additional Fields'|trans({}, 'Modules.Dpdshipping.Admin') }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Reference 1'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">ref 1</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Reference 2'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">ref 2</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<p class="mb-0">{{ 'Payer'|trans({}, 'Modules.Dpdshipping.Admin') }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Payer FID'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">14002</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<p class="mb-0">{{ 'Tracking'|trans({}, 'Modules.Dpdshipping.Admin') }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<table class="table table-bordered pb-0 mb-0">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="col-md-6 col-xl-5 border-0">{{ 'Date and time'|trans({}, 'Modules.Dpdshipping.Admin') }}</th>
|
||||
<th class="col-md-6 col-xs-7 border-0">{{ 'State'|trans({}, 'Modules.Dpdshipping.Admin') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>2024-03-15 10:30:00</strong></td>
|
||||
<td>In transit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>2024-03-16 08:45:00</strong></td>
|
||||
<td>Arrived at destination</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>2024-03-17 14:20:00</strong></td>
|
||||
<td>Delivered</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12">
|
||||
<h3 class="">Parcels</h3>
|
||||
<div class="card-columns">
|
||||
|
||||
{% for item in range(0,10) %}
|
||||
<div class="card bg-light mb-4" style="">
|
||||
<div class="card-header"><a href="https://tracktrace.dpd.com.pl/parcelDetails?typ=1&p1=1000729568879U"
|
||||
target="_blank">1000729568879U</a></div>
|
||||
<div class="card-body bg-white ">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Content'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">Content data</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Customer data'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text">Customer data</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Size X'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Size Y'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p class="card-text"><strong>{{ 'Size Z'|trans({}, 'Modules.Dpdshipping.Admin') }}:</strong></p>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<p class="card-text"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
{% set currentTimestampOrderDetailsCss = date("now")|date("U") %}
|
||||
<link rel="stylesheet" href="{{ asset('../modules/dpdshipping/views/css/admin/shipping-detail.css?' ~ currentTimestampOrderDetailsCss) }}"/>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,22 @@
|
||||
{% extends '@PrestaShop/Admin/layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include '@Modules/dpdshipping/views/templates/admin/_partials/navbar.html.twig' %}
|
||||
|
||||
{% block quotes_list_panel %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% include '@PrestaShop/Admin/Common/Grid/grid_panel.html.twig' with {'grid': quoteGrid} %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src="{{ asset('../modules/dpdshipping/views/js/shipping-history-grid.js') }}"></script>
|
||||
<script src="{{ asset('themes/default/js/bundle/pagination.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
{**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*
|
||||
*}
|
||||
|
||||
<div class="col-xs-12 dpdshipping-pudo-cod-container">
|
||||
|
||||
<div class="form-group container_dpdshipping_pudo_cod_warning" style="display:none">
|
||||
<p class="alert alert-danger">{l s='Selected point does not provide the cod service' d='Modules.Dpdshipping.Checkout'}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group container_dpdshipping_pudo_cod_error" style="display:none">
|
||||
<p class="alert alert-danger">{l s='Error occured. Please try again' d='Modules.Dpdshipping.Checkout'}</p>
|
||||
</div>
|
||||
|
||||
<div class="dpdshipping-pudo-cod-new-point">
|
||||
<span> {l s='DPD pickup point:' d='Modules.Dpdshipping.Checkout'}</span>
|
||||
<div class="dpdshipping-pudo-cod-open-map-btn btn btn-secondary"
|
||||
data-toggle="modal" data-target="#dpdshippingPudoCodModal" data-bs-toggle="modal"
|
||||
data-bs-target="#dpdshippingPudoCodModal">
|
||||
{l s='Select from map' d='Modules.Dpdshipping.Checkout'}
|
||||
</div>
|
||||
</div>
|
||||
<div class="dpdshipping-pudo-cod-selected-point" style="display: none">
|
||||
<p> {l s='Selected DPD pickup point:' d='Modules.Dpdshipping.Checkout'} <span
|
||||
class="dpdshipping-cod-selected-point font-weight-bold"></span></p>
|
||||
<div class="dpdshipping-pudo-cod-change-map-btn btn btn-secondary float-xs-right"
|
||||
data-toggle="modal" data-target="#dpdshippingPudoCodModal" data-bs-toggle="modal"
|
||||
data-bs-target="#dpdshippingPudoCodModal">
|
||||
{l s='Change' d='Modules.Dpdshipping.Checkout'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="dpdshippingPudoCodModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dpd-xl" role="document">
|
||||
<div class="modal-content modal-dpd-content">
|
||||
<div class="modal-body modal-dpd-body">
|
||||
<script id="dpdshipping-widget-pudo-cod" type="text/javascript"></script>
|
||||
</div>
|
||||
<div class="modal-footer modal-dpd-footer">
|
||||
<button type="button" class="btn btn-secondary"
|
||||
data-dismiss="modal"
|
||||
data-bs-dismiss="modal">{l s='Close' d='Modules.Dpdshipping.Checkout'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,64 @@
|
||||
{**
|
||||
* Copyright 2025 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2025 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*
|
||||
*}
|
||||
|
||||
<div class="col-xs-12 dpdshipping-pudo-swipbox-container">
|
||||
|
||||
<div class="form-group container_dpdshipping_pudo_swipbox_error" style="display:none">
|
||||
<p class="alert alert-danger">{l s='Error occured. Please try again' d='Modules.Dpdshipping.Checkout'}</p>
|
||||
</div>
|
||||
|
||||
<div class="dpdshipping-pudo-swipbox-new-point">
|
||||
<span> {l s='DPD pickup point:' d='Modules.Dpdshipping.Checkout'}</span>
|
||||
<div class="dpdshipping-pudo-swipbox-open-map-btn btn btn-secondary"
|
||||
data-toggle="modal" data-target="#dpdshippingPudoSwipBoxModal" data-bs-toggle="modal"
|
||||
data-bs-target="#dpdshippingPudoSwipBoxModal">
|
||||
{l s='Select from map' d='Modules.Dpdshipping.Checkout'}
|
||||
</div>
|
||||
</div>
|
||||
<div class="dpdshipping-pudo-swipbox-selected-point" style="display: none">
|
||||
<p> {l s='Selected DPD pickup point:' d='Modules.Dpdshipping.Checkout'} <span
|
||||
class="dpdshipping-swipbox-selected-point font-weight-bold"></span></p>
|
||||
<div class="dpdshipping-pudo-swipbox-change-map-btn btn btn-secondary float-xs-right"
|
||||
data-toggle="modal" data-target="#dpdshippingPudoSwipBoxModal" data-bs-toggle="modal"
|
||||
data-bs-target="#dpdshippingPudoSwipBoxModal">
|
||||
{l s='Change' d='Modules.Dpdshipping.Checkout'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="dpdshippingPudoSwipBoxModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dpd-xl" role="document">
|
||||
<div class="modal-content modal-dpd-content">
|
||||
<div class="modal-body modal-dpd-body">
|
||||
<script id="dpdshipping-widget-pudo-swipbox" type="text/javascript"></script>
|
||||
</div>
|
||||
<div class="modal-footer modal-dpd-footer">
|
||||
<button type="button" class="btn btn-secondary"
|
||||
data-dismiss="modal"
|
||||
data-bs-dismiss="modal">{l s='Close' d='Modules.Dpdshipping.Checkout'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,64 @@
|
||||
{**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*
|
||||
*}
|
||||
|
||||
<div class="col-xs-12 dpdshipping-pudo-container">
|
||||
|
||||
<div class="form-group container_dpdshipping_pudo_error" style="display:none">
|
||||
<p class="alert alert-danger">{l s='Error occured. Please try again' d='Modules.Dpdshipping.Checkout'}</p>
|
||||
</div>
|
||||
|
||||
<div class="dpdshipping-pudo-new-point">
|
||||
<span> {l s='DPD pickup point:' d='Modules.Dpdshipping.Checkout'}</span>
|
||||
<div class="dpdshipping-pudo-open-map-btn btn btn-secondary"
|
||||
data-toggle="modal" data-target="#dpdshippingPudoModal" data-bs-toggle="modal"
|
||||
data-bs-target="#dpdshippingPudoModal">
|
||||
{l s='Select from map' d='Modules.Dpdshipping.Checkout'}
|
||||
</div>
|
||||
</div>
|
||||
<div class="dpdshipping-pudo-selected-point" style="display: none">
|
||||
<p> {l s='Selected DPD pickup point:' d='Modules.Dpdshipping.Checkout'} <span
|
||||
class="dpdshipping-selected-point font-weight-bold"></span></p>
|
||||
<div class="dpdshipping-pudo-change-map-btn btn btn-secondary float-xs-right"
|
||||
data-toggle="modal" data-target="#dpdshippingPudoModal" data-bs-toggle="modal"
|
||||
data-bs-target="#dpdshippingPudoModal">
|
||||
{l s='Change' d='Modules.Dpdshipping.Checkout'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="dpdshippingPudoModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dpd-xl" role="document">
|
||||
<div class="modal-content modal-dpd-content">
|
||||
<div class="modal-body modal-dpd-body">
|
||||
<script id="dpdshipping-widget-pudo" type="text/javascript"></script>
|
||||
</div>
|
||||
<div class="modal-footer modal-dpd-footer">
|
||||
<button type="button" class="btn btn-secondary"
|
||||
data-dismiss="modal"
|
||||
data-bs-dismiss="modal">{l s='Close' d='Modules.Dpdshipping.Checkout'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
33
modules/dpdshipping/views/templates/hook/index.php
Normal file
33
modules/dpdshipping/views/templates/hook/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
33
modules/dpdshipping/views/templates/index.php
Normal file
33
modules/dpdshipping/views/templates/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
Reference in New Issue
Block a user