Skip to content

Commit

Permalink
Merge pull request #116 from Paazl/release/1.17.3
Browse files Browse the repository at this point in the history
Release/1.17.3
  • Loading branch information
Marvin-Magmodules authored Sep 20, 2024
2 parents 059a4e5 + 15bbbb8 commit 2bd5ef9
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 78 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codesniffer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ jobs:
--volume $(pwd)/:/app/workdir
michielgerritsen/magento-coding-standard:latest
--severity=6
-s
21 changes: 0 additions & 21 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,6 @@ name: Lint PHP files
on: [push, pull_request]

jobs:
php-71:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'

php-72:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'

php-73:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'

php-74:
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/setup-di-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ jobs:
strategy:
matrix:
include:
- PHP_VERSION: php71-fpm
MAGENTO_VERSION: 2.3.3
- PHP_VERSION: php73-fpm
MAGENTO_VERSION: 2.3.7
- PHP_VERSION: php74-fpm
MAGENTO_VERSION: 2.4.0
MAGENTO_VERSION: 2.3.7
- PHP_VERSION: php81-fpm
MAGENTO_VERSION: 2.4.4
- PHP_VERSION: php82-fpm
MAGENTO_VERSION: 2.4.6
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ jobs:
strategy:
matrix:
include:
- PHP_VERSION: php71-fpm
MAGENTO_VERSION: 2.3.3
- PHP_VERSION: php73-fpm
- PHP_VERSION: php74-fpm
MAGENTO_VERSION: 2.3.7
- PHP_VERSION: php74-fpm
MAGENTO_VERSION: 2.4.0
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "paazl/magento2-checkout-widget",
"description": "Paazl checkoutWidget for Magento 2",
"type": "magento2-module",
"version": "1.17.2",
"version": "1.17.3",
"keywords": [
"Paazl",
"Magento 2",
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<default>
<carriers>
<paazlshipping>
<version>v1.17.2</version>
<version>v1.17.3</version>
<active>0</active>
<sallowspecific>0</sallowspecific>
<price>0</price>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ use Paazl\CheckoutWidget\Ui\Component\Order\Listing\Column\Status\Options;
</span>
<?php endif; ?>
<?php if ($estimatedDeliveryRange = $shippingInfo->getEstimatedDeliveryRange()) : ?>
<span class="estimated-delivery-range date-wrapper">
<span class="label"><?= /* @escapeNotVerified */ __('Earliest Delivery Date'); ?></span>:
<span class="value"><?= /* @escapeNotVerified */ $estimatedDeliveryRange['earliestDate']; ?></span>
</span>
<?php if (isset($estimatedDeliveryRange['earliestDate'])) : ?>
<span class="estimated-delivery-range date-wrapper">
<span class="label"><?= /* @escapeNotVerified */ __('Latest Delivery Date'); ?></span>:
<span class="value"><?= /* @escapeNotVerified */ $estimatedDeliveryRange['latestDate']; ?></span>
</span>
<span class="label"><?= /* @escapeNotVerified */ __('Earliest Delivery Date'); ?></span>:
<span class="value"><?= /* @escapeNotVerified */ $estimatedDeliveryRange['earliestDate']; ?></span>
</span>
<?php endif;?>
<?php if (isset($estimatedDeliveryRange['latestDate'])) : ?>
<span class="estimated-delivery-range date-wrapper">
<span class="label"><?= /* @escapeNotVerified */ __('Latest Delivery Date'); ?></span>:
<span class="value"><?= /* @escapeNotVerified */ $estimatedDeliveryRange['latestDate']; ?></span>
</span>
<?php endif;?>
<?php endif; ?>
<?php if ($carrierPickupDate = $shippingInfo->getCarrierPickupDate()) : ?>
<span class="carrier-pickup-date date-wrapper">
Expand Down
89 changes: 49 additions & 40 deletions view/frontend/web/js/view/shipping-information-ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
*/

define([
'jquery',
'Magento_Checkout/js/model/quote'
], function (quote) {
], function ($, quote) {
'use strict';

var storePickupShippingInformation = {
Expand All @@ -14,7 +15,26 @@ define([
shippingMethodTitle: '',
},

initObservable: function () {
initialize: function () {
this._super();

$(document).ajaxComplete((e, xhr, settings) => {
if (settings.url.includes('shipping-information')) {
if (xhr.status === 200) {
let response = JSON.parse(xhr.responseText);

window.checkoutConfig.totalsData.extension_attributes[0] = {
'carrier_title': response.totals.extension_attributes.shipping_methods[0].carrier_title,
'method_title': response.totals.extension_attributes.shipping_methods[0].method_title
}

this.setShippingMethodTitle();
}
}
});
},

initObservable() {
this._super().observe(['shippingMethodTitle']);
return this;
},
Expand All @@ -24,58 +44,47 @@ define([
*
* @return {String}
*/
getShippingMethodTitle: function () {
getShippingMethodTitle() {
this.shippingMethodTitle('');

quote.totals.subscribe(() => {
var shippingMethod = quote.shippingMethod(),
shippingMethodTitle = '',
locationName = '',
title;

if (window.checkoutConfig.totalsData.extension_attributes[0]) {
const carrier_title = shippingMethod['carrier_title'] ? `${shippingMethod['carrier_title']}` : '';
const method_title = shippingMethod['method_title'] ? shippingMethod['method_title'] : '';

if (typeof shippingMethod['method_title'] !== 'undefined') {
shippingMethodTitle = carrier_title + ' - ' + method_title;
}

shippingMethod = window.checkoutConfig.totalsData.extension_attributes[0];
this.shippingMethodTitle(shippingMethodTitle);
} else {
shippingMethod = quote.shippingMethod();
// Trigger setting shipping method title if quote total subscribe doesn't trigger
this.setShippingMethodTitle();

if (!this.isStorePickup()) {
if (!shippingMethod) return '';
quote.totals.subscribe(() => {
this.setShippingMethodTitle();
});
},

shippingMethodTitle = shippingMethod['carrier_title'];
setShippingMethodTitle() {
if (window.checkoutConfig.totalsData.extension_attributes[0] && window.checkoutConfig.paazlshipping) {
const shippingMethod = window.checkoutConfig.totalsData.extension_attributes[0];
const carrier_title = shippingMethod['carrier_title'];
const method_title = shippingMethod['method_title'];

if (typeof shippingMethod['method_title'] !== 'undefined') {
shippingMethodTitle += ' - ' + shippingMethod['method_title'];
}

return shippingMethodTitle;
}

title = shippingMethod['carrier_title'] + ' - ' + shippingMethod['method_title'];
if (carrier_title && method_title) {
this.shippingMethodTitle(carrier_title + ' - ' + method_title);
}
} else {
this.getDefaultShippingMethodTitle();
}
},

if (quote.shippingAddress().firstname !== undefined) {
locationName = quote.shippingAddress().firstname + ' ' + quote.shippingAddress().lastname;
title += ' "' + locationName + '"';
}
getDefaultShippingMethodTitle() {
const shippingMethod = quote.shippingMethod();
const carrier_title = shippingMethod ? shippingMethod['carrier_title'] : '';
const method_title = shippingMethod ? shippingMethod['method_title'] : '';

return title;
}
});
if (carrier_title && method_title) {
this.shippingMethodTitle(carrier_title + ' - ' + method_title);
}
},

/**
* Get is store pickup delivery method selected.
*
* @returns {Boolean}
*/
isStorePickup: function () {
isStorePickup() {
var shippingMethod = quote.shippingMethod(),
isStorePickup = false;

Expand Down

0 comments on commit 2bd5ef9

Please sign in to comment.