Skip to content

Commit

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

## Released

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

### Added
- Validation check if a parcelshop is selected whenever the wuunder parcelshop method is used.

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

### 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.2]]></version>
<version><![CDATA[1.3.3]]></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
4 changes: 2 additions & 2 deletions wuunderconnector/controllers/admin/AdminWuunderConnector.php
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.2.6", "plugin" => "1.0"));
$this->sourceObj = array("product" => "Prestashop extension", "version" => array("build" => "1.3.4", "plugin" => "1.0"));
}

private function setBookingToken($order_id, $booking_url, $booking_token)
Expand Down Expand Up @@ -272,7 +272,7 @@ private function buildWuunderData($order_info)
$bookingConfig->setLength($product_length);
$bookingConfig->setWidth($product_width);
$bookingConfig->setHeight($product_height);
$bookingConfig->setWeight((int)$order_info['weight']);
$bookingConfig->setWeight((int)($order_info['weight'] * 1000));
$bookingConfig->setCustomerReference($order_info['id_order']);
$bookingConfig->setPreferredServiceLevel($preferredServiceLevel);
$bookingConfig->setSource($this->sourceObj);
Expand Down
15 changes: 15 additions & 0 deletions wuunderconnector/wuunderconnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class WuunderConnector extends Module
private $parcelshopcarrier;

private $hooks = array(
'actionValidateStepComplete',
'actionValidateOrder',
'displayHeader',
'displayFooter',
Expand Down Expand Up @@ -343,6 +344,20 @@ public function hookActionValidateOrder($params)
$this->context->smarty->clearAssign('cookieParcelshopId');
}

public function hookActionValidateStepComplete($params) {
if ($params['step_name'] === 'delivery') {
$carrier_id = $params['cart']->id_carrier;
if (Configuration::get('MYCARRIER1_CARRIER_ID') == $carrier_id) {
if(empty($this->context->cookie->parcelId)){
$controller = $this->context->controller;
$controller->errors[] = $this->l('Please select a parcelshop');
$params['completed'] = false;
}
}
}
return;
}

public function parcelshop_urls()
{
$tmpEnvironment = new \Wuunder\Api\Environment((int) Configuration::get('testmode') === 1 ? 'staging' : 'production');
Expand Down

0 comments on commit c21affe

Please sign in to comment.