Skip to content

Commit

Permalink
Merge pull request wuunder#37 from wuunder/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
TimD90 authored Aug 3, 2020
2 parents 50491d6 + 392bfbf commit 1fb3f86
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

## Released

## [1.3.7](https://github.com/kabisa/wuunder-webshopplugin-prestashop/releases/tag/1.3.7)

### Fixed
- Checkout JS ver 1.6


## [1.3.6](https://github.com/kabisa/wuunder-webshopplugin-prestashop/releases/tag/1.3.6)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion wuunderconnector/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>wuunderconnector</name>
<displayName><![CDATA[Wuunder shipping module]]></displayName>
<version><![CDATA[1.3.6]]></version>
<version><![CDATA[1.3.7]]></version>
<description><![CDATA[Send and receive your shipments easily, personally and efficiently. You can ship via more then 23 carriers. Wuunder takes care of all your transport and warehouse solutions you need.]]></description>
<author><![CDATA[Wuunder]]></author>
<tab><![CDATA[shipping_logistics]]></tab>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct()
$this->logger->setFilename(_PS_ROOT_DIR_ . ((_PS_VERSION_ < '1.7') ? "/log/wuunder.log" : "/app/logs/wuunder.log"));
$this->bootstrap = true;
$this->override_folder = "";
$this->sourceObj = array("product" => "Prestashop extension", "version" => array("build" => "1.3.6", "plugin" => "1.0"));
$this->sourceObj = array("product" => "Prestashop extension", "version" => array("build" => "1.3.7", "plugin" => "1.0"));
}

private function setBookingToken($order_id, $booking_url, $booking_token)
Expand Down
37 changes: 19 additions & 18 deletions wuunderconnector/views/js/hook/checkoutjavascript1.6.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,22 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Get the modal
// Get the modal
$(window).on("load", function() {
// Get the modal
var selectParcelshopLink = '<div id="parcelshopsSelectedContainer16"><a href="#/" id="selectParcelshop">' + innerHtml + '</a></div>';
var parcelshopShippingMethodElem = jQuery('[value="' + shippingCarrierId + ',"].delivery_option_radio');
var parcelshopShippingMethodElemRadio = jQuery('[value="' + shippingCarrierId + ',"].delivery_option_radio');
if (parcelshopShippingMethodElemRadio.length > 0){
var parcelshopDescriptionElem = jQuery('[value="' + shippingCarrierId + ',"].delivery_option_radio').parents()[3].children[2];
}
var shippingMethodElems = jQuery('input.delivery_option_radio');
var shippingAddress;
var getAddressUrl = "index.php?fc=module&module=wuunderconnector&controller=parcelshop&getAddress=1";
var setParcelshopId = "index.php?fc=module&module=wuunderconnector&controller=parcelshop&setParcelshopId=1";
var container = document.createElement('div');
container.className += "chooseParcelshop";
container.innerHTML = selectParcelshopLink;


initParcelshopLocator(baseUrl, baseApiUrl, availableCarriers);

Expand All @@ -34,32 +41,26 @@ $(window).on("load", function() {
availableCarrierList = carrierList;
parcelshopAddress = _markupParcelshopAddress(parcelshopAddress);

jQuery('.delivery_options').append('<div class="delivery_option alternate_item parcelshop_container"></div>');
if (parcelshopShippingMethodElem) {
//parcelshopShippingMethodElem.onchange = _onShippingMethodChange;
if (parcelshopShippingMethodElemRadio) {
parcelshopShippingMethodElemRadio.onchange = _onShippingMethodChange;
if (parcelshopAddress !== "") {
parcelshopId = "{/literal}{$cookieParcelshopId}{literal}";
}
//jQuery(shippingMethodElems).change(_onShippingMethodChange);
jQuery(shippingMethodElems).on('change', _onShippingMethodChange);
jQuery(shippingMethodElems).change(_onShippingMethodChange);
_onShippingMethodChange();
}
}
function _onShippingMethodChange() {
if (parcelshopShippingMethodElem.is(':checked')) {
var container = document.createElement('div');
container.className += "chooseParcelshop";
container.innerHTML = selectParcelshopLink;
// window.parent.document.getElementsByClassName('shipping')[0].appendChild(container);
jQuery(jQuery('[value="' + shippingCarrierId + ',"].delivery_option_radio')).parentsUntil('#form > div > div.delivery_options_address > div.delivery_options > div:nth-child(1)').last().append(container);
if ($("#parcelshopsSelectedContainer16").is(":hidden") && parcelshopShippingMethodElemRadio.is(':checked')) {
$("#parcelshopsSelectedContainer16").show();
} else if (parcelshopShippingMethodElemRadio.is(':checked')) {
parcelshopLink = parcelshopShippingMethodElemRadio.parents()[4].append(container);
parcelshopDescriptionElem.append(container);
jQuery("#selectParcelshop").on('click',_showParcelshopLocator);
_printParcelshopAddress();

} else {
var containerElems = window.parent.document.getElementsByClassName('chooseParcelshop');
if (containerElems.length) {
containerElems[0].remove();
}
}
$("#parcelshopsSelectedContainer16").hide(); }
}
// add selected parcelshop to page
function _printParcelshopAddress() {
Expand Down
2 changes: 1 addition & 1 deletion wuunderconnector/wuunderconnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct()
$this->name = 'wuunderconnector';
$this->tab = 'shipping_logistics';

$this->version = '1.3.6';
$this->version = '1.3.7';

$this->author = 'Wuunder';
$this->need_instance = 0;
Expand Down

0 comments on commit 1fb3f86

Please sign in to comment.