Skip to content

Commit

Permalink
Version 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Aug 8, 2022
1 parent c1bba76 commit 5cb7afa
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 66 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Demo links may not work, don't panic, it's not a bug.
| **Store delivery** | | [online demo](https://cellu.blue/OmRX8p): 07200, Aubenas, FR<br>source of data: a TSV file |
| **Store locator** | | [online demo](https://cellu.blue/h9dhKJ)<br>source of data: a TSV file |

Do you want more? Contact us, perhaps we can work together to add new methods!
Do you want more? Contact us, perhaps we can work together to add new methods! For example: Colissimo, Relais Colis, Swiss Post...

## Customization

Expand Down Expand Up @@ -95,7 +95,7 @@ To display delivery times, you must edit your template with:

## Copyright and Credits

- Current version: 2.4.0 (07/07/2022)
- Current version: 2.4.1 (08/08/2022)
- Compatibility: OpenMage 19.x / 20.x / 21.x, PHP 7.2 / 7.3 / 7.4 / 8.0 / 8.1
- Client compatibility: Firefox 36+, Chrome 32+, Opera 19+, Edge 16+, Safari 9+
- Translations: English (en), French (fr-FR/fr-CA), German (de), Italian (it), Portuguese (pt-PT/pt-BR), Spanish (es) / Chinese (zh), Czech (cs), Dutch (nl), Greek (el), Hungarian (hu), Japanese (ja), Polish (pl), Romanian (ro), Russian (ru), Slovak (sk), Turkish (tr), Ukrainian (uk)
Expand All @@ -107,7 +107,7 @@ If you like, take some of your time to improve the translations, go to https://b

Warning: there are two packages, one that contains a lite and modified version (without jquery/editor/phpparser/doc) of owebia/shipping ([kyrena/openmage-shippingmax](https://github.com/kyrena/openmage-shippingmax)), and another one without owebia/shipping ([kyrena/openmage-shippingmax-alone](https://github.com/kyrena/openmage-shippingmax-alone)).

#### For kyrena/openmage-shippingmax)
#### For kyrena/openmage-shippingmax

With composer:
- `composer remove owebia/magento1-module-advanced-shipping`
Expand Down
5 changes: 3 additions & 2 deletions src/app/code/community/Kyrena/Shippingmax/Model/Carrier.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created V/12/04/2019
* Updated V/24/06/2022
* Updated L/08/08/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand Down Expand Up @@ -235,7 +235,8 @@ public function loadItemsFromCache(object $address, bool $dataOnly = false) {
// filtre les points relais
if (!empty($items) && !$this->_postcodesOnly) {
foreach ($items as $key => &$item) {
if (empty($item['id']) || !$this->checkItem($address, $item))
// conserve uniquement les relais du même pays que l'adresse
if (empty($item['id']) || (($this->_code != 'shippingmax_storelocator') && ($item['country_id'] != $address->getData('country_id'))) || !$this->checkItem($address, $item))
unset($items[$key]);
}
unset($item);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created V/06/11/2020
* Updated V/24/06/2022
* Updated J/28/07/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand Down Expand Up @@ -89,7 +89,7 @@ public function loadItemsFromApi(object $address) {
'postcode' => $data['CODE_POSTAL'],
'city' => $data['VILLE'],
'country_id' => $data['PAYS'],
'description' => $this->createDescCurl($data)
'description' => $this->createDescCurl($data),
];
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created V/12/04/2019
* Updated M/07/12/2021
* Updated J/28/07/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand Down Expand Up @@ -31,15 +31,15 @@ public function loadItemsFromApi(object $address, bool $ignoreLatLng = false) {

try {
// https://www.mondialrelay.fr/solutionspro/documentation-technique/cahier-des-charges-informatiques/
// https://www.mondialrelay.fr/media/108937/Solution-Web-Service-V5.6.pdf
// https://www.mondialrelay.fr/media/123560/solution-web-service-v58.pdf
$client = new SoapClient($this->getConfigData('api_url'), ['trace' => 1]);
$params = [
'Enseigne' => $this->getConfigData('api_username'),
'Pays' => ($address->getData('country_id') == 'MC') ? 'FR' : $address->getData('country_id'),
'CP' => trim(is_numeric($address->getData('city')) ? $address->getData('city') : $address->getData('postcode')),
'Latitude' => number_format(round($address->getData('lat'), 11), 6),
'Longitude' => number_format(round($address->getData('lng'), 11), 6),
'RayonRecherche' => $this->getConfigData('dst_search')
'RayonRecherche' => $this->getConfigData('dst_search'),
];

// géolocalisation navigateur ou coordonnées nominatim
Expand Down Expand Up @@ -87,7 +87,7 @@ public function loadItemsFromApi(object $address, bool $ignoreLatLng = false) {
'city' => $result->Ville,
'country_id' => $result->Pays,
'description' => $this->createDesc($result),
'dst' => round($result->Distance / 1000, 1)
'dst' => round($result->Distance / 1000, 1),
];
}
}
Expand Down
12 changes: 5 additions & 7 deletions src/app/code/community/Kyrena/Shippingmax/Model/Rewrite/Rate.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created V/06/11/2020
* Updated M/05/07/2022
* Updated M/26/07/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand Down Expand Up @@ -35,19 +35,17 @@ public function getIterator() {

foreach ($this->_items as $item) {

if (!empty($group)) {
$keys = array_filter(explode(',', Mage::getStoreConfig('carriers/'.$item->getData('carrier').'/show_for_customer_group')));
if (!empty($keys) && !in_array($group, $keys))
$item->isDeleted(true);
}

$keys = array_filter(explode(',', Mage::getStoreConfig('carriers/'.$item->getData('carrier').'/hide_when')));
if (!empty($keys)) {
foreach ($keys as $key) {
if (in_array($key, $codes))
$item->isDeleted(true);
}
}

$keys = array_filter(explode(',', Mage::getStoreConfig('carriers/'.$item->getData('carrier').'/show_for_customer_group')));
if (!empty($keys) && (empty($group) || !in_array($group, $keys)))
$item->isDeleted(true);
}

return new ArrayIterator($this->_items);
Expand Down
4 changes: 2 additions & 2 deletions src/app/code/community/Kyrena/Shippingmax/etc/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Created V/12/04/2019
* Updated M/05/07/2022
* Updated V/05/08/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand All @@ -21,7 +21,7 @@
<config>
<modules>
<Kyrena_Shippingmax>
<version>2.4.0</version>
<version>2.4.1</version>
</Kyrena_Shippingmax>
</modules>
<global>
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

52 changes: 23 additions & 29 deletions src/skin/frontend/base/default/css/kyrena/shippingmax/map.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Created V/12/04/2019
* Updated V/20/05/2022
* Updated V/22/07/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Mickaël Vang <mickael~cellublue~com>
Expand All @@ -17,9 +17,7 @@
* GNU General Public License (GPL) for more details.
*/

/*
* Local common variables
*/
// Local common variables

$font-text: sans-serif;
$color-text-default: #0a2346;
Expand All @@ -31,9 +29,7 @@ $color-blue-main: #6480ff;
$color-blue-transparent: rgba(48, 127, 226, 0.7);
$color-blue-shadow: rgba(200, 216, 237, 0.6);

/*
* Responsive configuration
*/
// Responsive configuration

$large-breakpoint: 1440px;
$medium-breakpoint: 992px;
Expand All @@ -51,9 +47,7 @@ $small-down: "only screen and (max-width: #{$medium-breakpoint - 1px})";
$extra-small-only: "only screen and (max-width: #{$small-breakpoint - 1px})";
$xs-small-only: "only screen and (max-width: #{$xs-breakpoint})";

/*
* Placeholders
*/
// Placeholders

@mixin placeholder($color: #767676) {
&:-moz-placeholder {
Expand All @@ -74,9 +68,7 @@ $xs-small-only: "only screen and (max-width: #{$xs-breakpoint})";
} // Safari and Chrome
}

/*
* Style for map
*/
// Style for map

* {
padding: 0;
Expand Down Expand Up @@ -605,18 +597,20 @@ button {
padding-bottom: 10px;
}

&:hover {
.item-container {
box-shadow: 0 2.8px 2.2px rgba(0, 0, 0, 0.04),
0 6.7px 5.3px rgba(0, 0, 0, 0.048), 0 12.5px 10px rgba(0, 0, 0, 0.075);
@media (hover: hover) and (pointer: fine) {
&:hover {
.item-container {
box-shadow: 0 2.8px 2.2px rgba(0, 0, 0, 0.04),
0 6.7px 5.3px rgba(0, 0, 0, 0.048), 0 12.5px 10px rgba(0, 0, 0, 0.075);

.name {
color: $color-blue-main;
}
.name {
color: $color-blue-main;
}

button {
background-color: $color-blue-main;
color: $color-white;
button {
background-color: $color-blue-main;
color: $color-white;
}
}
}
}
Expand Down Expand Up @@ -1057,8 +1051,10 @@ div.leaflet-container {
cursor: default;
}

&.multi li:hover .country-item {
background-color: #eaedfd !important;
@media (hover: hover) and (pointer: fine) {
&.multi li:hover .country-item {
background-color: #eaedfd !important;
}
}

& > li {
Expand Down Expand Up @@ -1157,10 +1153,8 @@ div.leaflet-container {
}
}

/**
* pseudo fullscreen button
* sur une idée de https://github.com/Leaflet/Leaflet.fullscreen
*/
// pseudo fullscreen button
// sur une idée de https://github.com/Leaflet/Leaflet.fullscreen
.leaflet-bar .leaflet-control-fullscreen-button {
background:#fff url("../../../images/kyrena/shippingmax/fullscreen.svg") no-repeat 2px 2px;
background-size: 26px 52px;
Expand Down
26 changes: 13 additions & 13 deletions src/skin/frontend/base/default/js/kyrena/shippingmax/map.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Created V/12/04/2019
* Updated J/09/06/2022
* Updated V/22/07/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand Down Expand Up @@ -66,86 +66,86 @@ var shippingmax = new (function () {
attribution: osmcopy,
name: 'Open Street Map',
minZoom: 4,
maxZoom: 18,
maxZoom: 19,
detectRetina: true
}),
osmfr: L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {
attribution: osmcopy,
name: 'Open Street Map France',
minZoom: 4,
maxZoom: 18,
maxZoom: 19,
detectRetina: true
}),
osmde: L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', {
attribution: osmcopy,
name: 'Open Street Map Deutschland',
minZoom: 4,
maxZoom: 18,
maxZoom: 19,
detectRetina: true
}),
osmbre: L.tileLayer('https://tile.openstreetmap.bzh/br/{z}/{x}/{y}.png', {
attribution: osmcopy,
name: 'Open Street Map Brezhoneg',
minZoom: 4,
maxZoom: 17,
maxZoom: 19,
detectRetina: true
}),
osmoci: L.tileLayer('https://tile.openstreetmap.bzh/oc/{z}/{x}/{y}.png', {
attribution: osmcopy,
name: 'Open Street Map Occitan',
minZoom: 4,
maxZoom: 17,
maxZoom: 19,
detectRetina: true
}),
osmeus: L.tileLayer('https://tile.openstreetmap.bzh/eu/{z}/{x}/{y}.png', {
attribution: osmcopy,
name: 'Open Street Map Euskara',
minZoom: 4,
maxZoom: 17,
maxZoom: 19,
detectRetina: true
}),
osmbot: L.tileLayer('https://{s}.tile.openstreetmap.fr/openriverboatmap/{z}/{x}/{y}.png', {
attribution: osmcopy,
name: 'Open Street Map Boat',
minZoom: 4,
maxZoom: 17,
maxZoom: 19,
detectRetina: true
}),
ocm: L.tileLayer('https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', {
attribution: '<a href="https://github.com/cyclosm/cyclosm-cartocss-style" target="_blank">CyclOSM<\/a>',
name: 'Open Cyclo Map',
minZoom: 4,
maxZoom: 17,
maxZoom: 19,
detectRetina: true
}),
otm: L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
attribution: osmcopy,
name: 'Open Topo Map',
minZoom: 4,
maxZoom: 17,
maxZoom: 19,
detectRetina: true
}),
chm: L.tileLayer('https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/{z}/{x}/{y}.jpeg', {
attribution: '<a href="https://www.swisstopo.admin.ch/" target="_blank">Swisstopo<\/a>',
name: 'Swiss Topo Map',
minZoom: 4,
maxZoom: 17,
maxZoom: 19,
detectRetina: true
}),
ggm: L.tileLayer('https://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', {
subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
attribution: ggmcopy,
name: 'Google Map',
minZoom: 4,
maxZoom: 17,
maxZoom: 19,
detectRetina: true
}),
ggmst: L.tileLayer('httpS://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
attribution: ggmcopy,
name: 'Google Map Sat',
minZoom: 4,
maxZoom: 17,
maxZoom: 19,
detectRetina: true
})
};
Expand Down
Loading

0 comments on commit 5cb7afa

Please sign in to comment.