Skip to content

Commit 2bd5ef9

Browse files
Merge pull request #116 from Paazl/release/1.17.3
Release/1.17.3
2 parents 059a4e5 + 15bbbb8 commit 2bd5ef9

File tree

8 files changed

+67
-78
lines changed

8 files changed

+67
-78
lines changed

.github/workflows/codesniffer.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ jobs:
1313
--volume $(pwd)/:/app/workdir
1414
michielgerritsen/magento-coding-standard:latest
1515
--severity=6
16+
-s

.github/workflows/linting.yml

-21
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,6 @@ name: Lint PHP files
22
on: [push, pull_request]
33

44
jobs:
5-
php-71:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: StephaneBour/[email protected]
9-
with:
10-
dir: './'
11-
12-
php-72:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: StephaneBour/[email protected]
16-
with:
17-
dir: './'
18-
19-
php-73:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: StephaneBour/[email protected]
23-
with:
24-
dir: './'
25-
265
php-74:
276
runs-on: ubuntu-latest
287
steps:

.github/workflows/setup-di-compile.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ jobs:
66
strategy:
77
matrix:
88
include:
9-
- PHP_VERSION: php71-fpm
10-
MAGENTO_VERSION: 2.3.3
11-
- PHP_VERSION: php73-fpm
12-
MAGENTO_VERSION: 2.3.7
139
- PHP_VERSION: php74-fpm
14-
MAGENTO_VERSION: 2.4.0
10+
MAGENTO_VERSION: 2.3.7
1511
- PHP_VERSION: php81-fpm
1612
MAGENTO_VERSION: 2.4.4
13+
- PHP_VERSION: php82-fpm
14+
MAGENTO_VERSION: 2.4.6
1715
runs-on: ubuntu-latest
1816
steps:
1917
- uses: actions/checkout@v1

.github/workflows/unit-test.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
include:
9-
- PHP_VERSION: php71-fpm
10-
MAGENTO_VERSION: 2.3.3
11-
- PHP_VERSION: php73-fpm
9+
- PHP_VERSION: php74-fpm
1210
MAGENTO_VERSION: 2.3.7
1311
- PHP_VERSION: php74-fpm
1412
MAGENTO_VERSION: 2.4.0

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "paazl/magento2-checkout-widget",
33
"description": "Paazl checkoutWidget for Magento 2",
44
"type": "magento2-module",
5-
"version": "1.17.2",
5+
"version": "1.17.3",
66
"keywords": [
77
"Paazl",
88
"Magento 2",

etc/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<default>
99
<carriers>
1010
<paazlshipping>
11-
<version>v1.17.2</version>
11+
<version>v1.17.3</version>
1212
<active>0</active>
1313
<sallowspecific>0</sallowspecific>
1414
<price>0</price>

view/adminhtml/templates/order/view/shipping-and-handling-info/paazl-status.phtml

+11-7
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,18 @@ use Paazl\CheckoutWidget\Ui\Component\Order\Listing\Column\Status\Options;
4444
</span>
4545
<?php endif; ?>
4646
<?php if ($estimatedDeliveryRange = $shippingInfo->getEstimatedDeliveryRange()) : ?>
47-
<span class="estimated-delivery-range date-wrapper">
48-
<span class="label"><?= /* @escapeNotVerified */ __('Earliest Delivery Date'); ?></span>:
49-
<span class="value"><?= /* @escapeNotVerified */ $estimatedDeliveryRange['earliestDate']; ?></span>
50-
</span>
47+
<?php if (isset($estimatedDeliveryRange['earliestDate'])) : ?>
5148
<span class="estimated-delivery-range date-wrapper">
52-
<span class="label"><?= /* @escapeNotVerified */ __('Latest Delivery Date'); ?></span>:
53-
<span class="value"><?= /* @escapeNotVerified */ $estimatedDeliveryRange['latestDate']; ?></span>
54-
</span>
49+
<span class="label"><?= /* @escapeNotVerified */ __('Earliest Delivery Date'); ?></span>:
50+
<span class="value"><?= /* @escapeNotVerified */ $estimatedDeliveryRange['earliestDate']; ?></span>
51+
</span>
52+
<?php endif;?>
53+
<?php if (isset($estimatedDeliveryRange['latestDate'])) : ?>
54+
<span class="estimated-delivery-range date-wrapper">
55+
<span class="label"><?= /* @escapeNotVerified */ __('Latest Delivery Date'); ?></span>:
56+
<span class="value"><?= /* @escapeNotVerified */ $estimatedDeliveryRange['latestDate']; ?></span>
57+
</span>
58+
<?php endif;?>
5559
<?php endif; ?>
5660
<?php if ($carrierPickupDate = $shippingInfo->getCarrierPickupDate()) : ?>
5761
<span class="carrier-pickup-date date-wrapper">

view/frontend/web/js/view/shipping-information-ext.js

+49-40
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
*/
55

66
define([
7+
'jquery',
78
'Magento_Checkout/js/model/quote'
8-
], function (quote) {
9+
], function ($, quote) {
910
'use strict';
1011

1112
var storePickupShippingInformation = {
@@ -14,7 +15,26 @@ define([
1415
shippingMethodTitle: '',
1516
},
1617

17-
initObservable: function () {
18+
initialize: function () {
19+
this._super();
20+
21+
$(document).ajaxComplete((e, xhr, settings) => {
22+
if (settings.url.includes('shipping-information')) {
23+
if (xhr.status === 200) {
24+
let response = JSON.parse(xhr.responseText);
25+
26+
window.checkoutConfig.totalsData.extension_attributes[0] = {
27+
'carrier_title': response.totals.extension_attributes.shipping_methods[0].carrier_title,
28+
'method_title': response.totals.extension_attributes.shipping_methods[0].method_title
29+
}
30+
31+
this.setShippingMethodTitle();
32+
}
33+
}
34+
});
35+
},
36+
37+
initObservable() {
1838
this._super().observe(['shippingMethodTitle']);
1939
return this;
2040
},
@@ -24,58 +44,47 @@ define([
2444
*
2545
* @return {String}
2646
*/
27-
getShippingMethodTitle: function () {
47+
getShippingMethodTitle() {
2848
this.shippingMethodTitle('');
2949

30-
quote.totals.subscribe(() => {
31-
var shippingMethod = quote.shippingMethod(),
32-
shippingMethodTitle = '',
33-
locationName = '',
34-
title;
35-
36-
if (window.checkoutConfig.totalsData.extension_attributes[0]) {
37-
const carrier_title = shippingMethod['carrier_title'] ? `${shippingMethod['carrier_title']}` : '';
38-
const method_title = shippingMethod['method_title'] ? shippingMethod['method_title'] : '';
39-
40-
if (typeof shippingMethod['method_title'] !== 'undefined') {
41-
shippingMethodTitle = carrier_title + ' - ' + method_title;
42-
}
43-
44-
shippingMethod = window.checkoutConfig.totalsData.extension_attributes[0];
45-
this.shippingMethodTitle(shippingMethodTitle);
46-
} else {
47-
shippingMethod = quote.shippingMethod();
50+
// Trigger setting shipping method title if quote total subscribe doesn't trigger
51+
this.setShippingMethodTitle();
4852

49-
if (!this.isStorePickup()) {
50-
if (!shippingMethod) return '';
53+
quote.totals.subscribe(() => {
54+
this.setShippingMethodTitle();
55+
});
56+
},
5157

52-
shippingMethodTitle = shippingMethod['carrier_title'];
58+
setShippingMethodTitle() {
59+
if (window.checkoutConfig.totalsData.extension_attributes[0] && window.checkoutConfig.paazlshipping) {
60+
const shippingMethod = window.checkoutConfig.totalsData.extension_attributes[0];
61+
const carrier_title = shippingMethod['carrier_title'];
62+
const method_title = shippingMethod['method_title'];
5363

54-
if (typeof shippingMethod['method_title'] !== 'undefined') {
55-
shippingMethodTitle += ' - ' + shippingMethod['method_title'];
56-
}
57-
58-
return shippingMethodTitle;
59-
}
60-
61-
title = shippingMethod['carrier_title'] + ' - ' + shippingMethod['method_title'];
64+
if (carrier_title && method_title) {
65+
this.shippingMethodTitle(carrier_title + ' - ' + method_title);
66+
}
67+
} else {
68+
this.getDefaultShippingMethodTitle();
69+
}
70+
},
6271

63-
if (quote.shippingAddress().firstname !== undefined) {
64-
locationName = quote.shippingAddress().firstname + ' ' + quote.shippingAddress().lastname;
65-
title += ' "' + locationName + '"';
66-
}
72+
getDefaultShippingMethodTitle() {
73+
const shippingMethod = quote.shippingMethod();
74+
const carrier_title = shippingMethod ? shippingMethod['carrier_title'] : '';
75+
const method_title = shippingMethod ? shippingMethod['method_title'] : '';
6776

68-
return title;
69-
}
70-
});
77+
if (carrier_title && method_title) {
78+
this.shippingMethodTitle(carrier_title + ' - ' + method_title);
79+
}
7180
},
7281

7382
/**
7483
* Get is store pickup delivery method selected.
7584
*
7685
* @returns {Boolean}
7786
*/
78-
isStorePickup: function () {
87+
isStorePickup() {
7988
var shippingMethod = quote.shippingMethod(),
8089
isStorePickup = false;
8190

0 commit comments

Comments
 (0)