diff --git a/CHANGELOG.md b/CHANGELOG.md index bd68904..e3174c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/wuunderconnector/classes/WuunderCarrier.php b/wuunderconnector/classes/WuunderCarrier.php index 89ff3a1..2d81d7b 100644 --- a/wuunderconnector/classes/WuunderCarrier.php +++ b/wuunderconnector/classes/WuunderCarrier.php @@ -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, ), @@ -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'))); } } diff --git a/wuunderconnector/controllers/admin/AdminWuunderConnector.php b/wuunderconnector/controllers/admin/AdminWuunderConnector.php index 277de59..f2b3073 100644 --- a/wuunderconnector/controllers/admin/AdminWuunderConnector.php +++ b/wuunderconnector/controllers/admin/AdminWuunderConnector.php @@ -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, $_)