Skip to content

Commit

Permalink
Merge pull request #35 from wuunder/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
TimD90 authored May 18, 2020
2 parents 455dd94 + 44425b3 commit 5be4baa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 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.6](https://github.com/kabisa/wuunder-webshopplugin-prestashop/releases/tag/1.3.6)

### Fixed
- Parcelshop carrier install settings
- No longer overwrite default carrier's rates

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

### Fixed
Expand Down
10 changes: 4 additions & 6 deletions wuunderconnector/classes/WuunderCarrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ public function install()
$carrierConfig = array(
0 => array(
'name' => $this->l('Wuunder parcelshop'),
'id_tax_rules_group' => 0,
'active' => true,
'deleted' => 0,
'shipping_handling' => false,
'range_behavior' => 0,
'delay' => array('nl' => 'Haal uw pakket op bij een pakketpunt in de buurt!', 'en' => 'Collect your package at a nearby parcelshop!', Language::getIsoById(Configuration::get('PS_LANG_DEFAULT')) => 'Collect your package at a nearby parcelshop!'),
'id_zone' => 1,
'is_module' => true,
'shipping_external' => true,
'is_module' => false,
'shipping_external' => false,
'external_module_name' => 'Wuunder_parcelshop_locator',
'need_range' => true,
),
Expand Down Expand Up @@ -213,8 +211,8 @@ public static function installExternalCarrier($config)
} else {
foreach ($zones as $zone) {
Db::getInstance()->insert('carrier_zone', array('id_carrier' => (int)($carrier->id), 'id_zone' => (int)($zone['id_zone'])));
Db::getInstance()->update('delivery', array('id_carrier' => (int)($carrier->id), 'id_range_price' => (int)($rangePrice->id), 'id_range_weight' => null, 'id_zone' => (int)($zone['id_zone']), 'price' => pSQL('0')));
Db::getInstance()->update('delivery', array('id_carrier' => (int)($carrier->id), 'id_range_price' => pSQL(null), 'id_range_weight' => (int)($rangeWeight->id), 'id_zone' => (int)($zone['id_zone']), 'price' => pSQL('0')));
Db::getInstance()->insert('delivery', array('id_carrier' => (int)($carrier->id), 'id_range_price' => (int)($rangePrice->id), 'id_range_weight' => null, 'id_zone' => (int)($zone['id_zone']), 'price' => pSQL('0')));
Db::getInstance()->insert('delivery', array('id_carrier' => (int)($carrier->id), 'id_range_price' => pSQL(null), 'id_range_weight' => (int)($rangeWeight->id), 'id_zone' => (int)($zone['id_zone']), 'price' => pSQL('0')));
}
}

Expand Down
11 changes: 10 additions & 1 deletion wuunderconnector/controllers/admin/AdminWuunderConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,16 @@ private function getOrderProductDetails($product_id)
$sql = 'SELECT ' . ((_PS_VERSION_ < "1.7") ? pSQL(implode(', ', $fieldlist)) : implode(', ', $fieldlist)) . '
FROM ' . _DB_PREFIX_ . 'product
WHERE id_product=' . (int)$product_id;
return Db::getInstance()->ExecuteS($sql)[0];
$res = Db::getInstance()->ExecuteS($sql);
if($res && !empty($res) && isset($res[0])){
return $res[0];
}
return array(
'depth' => 0,
'width' => 0,
'height' => 0
);

}

public function getOrderState($params, $_)
Expand Down

0 comments on commit 5be4baa

Please sign in to comment.