diff --git a/CHANGELOG.md b/CHANGELOG.md index e23f8e5b..2f79e159 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # Changelog # +#### Changes in release 9.0.5 + + Fixed notice error when shipping method is used that isn't linked to a tax class. + + Fixed update functionality. + #### Changes in release 9.0.4 + Added conditional checking for OC 1.5, so OCMod checks are not attempted on a version that doesn't support it. diff --git a/admin/controller/payment/mollie/base.php b/admin/controller/payment/mollie/base.php index 5d7a20c7..886b60d8 100644 --- a/admin/controller/payment/mollie/base.php +++ b/admin/controller/payment/mollie/base.php @@ -714,7 +714,7 @@ function update() //save tmp file $temp_file = MOLLIE_TMP . "/mollieUpdate.zip"; $handle = fopen($temp_file, "w+"); - $content = $client->get($info["zipball_url"], false, false); + $content = $client->get($info["assets"][0]["browser_download_url"], false, false); fwrite($handle, $content); fclose($handle); diff --git a/catalog/controller/payment/mollie/base.php b/catalog/controller/payment/mollie/base.php index 98c032bf..ffe681a4 100644 --- a/catalog/controller/payment/mollie/base.php +++ b/catalog/controller/payment/mollie/base.php @@ -254,7 +254,7 @@ public function payment() $tax_rates = $this->tax->getRates($orderProduct['price'], $productDetails['tax_class_id']); $rates = $this->getTaxRate($tax_rates); //Since Mollie only supports VAT so '$rates' must contains only one(VAT) rate. - $vatRate = $rates[0]; + $vatRate = isset($rates[0]) ? $rates[0] : 0; $total = $orderProduct['total'] + ($orderProduct['tax'] * $orderProduct['quantity']); $vatAmount = $total * ( $vatRate / (100 + $vatRate)); @@ -276,7 +276,7 @@ public function payment() $taxClass = $this->session->data['shipping_method']['tax_class_id']; $tax_rates = $this->tax->getRates($cost, $taxClass); $rates = $this->getTaxRate($tax_rates); - $vatRate = $rates[0]; + $vatRate = isset($rates[0]) ? $rates[0] : 0; $costWithTax = $this->tax->calculate($cost, $taxClass, $this->config->get('config_tax')); $shippingVATAmount = $costWithTax * ( $vatRate / (100 + $vatRate)); $lineForShipping[] = array( @@ -311,7 +311,7 @@ public function payment() $tax_rates = $this->tax->getRates($coupon['value'], $taxClass); $rates = $this->getTaxRate($tax_rates); - $vatRate = $rates[0]; + $vatRate = isset($rates[0]) ? $rates[0] : 0; $unitPriceWithTax = $this->tax->calculate($coupon['value'], $taxClass, $this->config->get('config_tax')); $couponVATAmount = $unitPriceWithTax * ( $vatRate / (100 + $vatRate)); $lineForCoupon[] = array( @@ -361,6 +361,10 @@ public function payment() } } + if(!isset($vatRate) || empty($vatRate)) { + $vatRate = 0; + } + $unitPriceWithTax = $this->tax->calculate($rewardPoints['value'], $taxClass, $this->config->get('config_tax')); $rewardVATAmount = $unitPriceWithTax * ( $vatRate / (100 + $vatRate)); @@ -399,7 +403,7 @@ public function payment() $tax_rates = $this->tax->getRates($orderTotals['value'], $taxClass); $rates = $this->getTaxRate($tax_rates); - $vatRate = $rates[0]; + $vatRate = isset($rates[0]) ? $rates[0] : 0; $unitPriceWithTax = $this->tax->calculate($orderTotals['value'], $taxClass, $this->config->get('config_tax')); $totalsVATAmount = $unitPriceWithTax * ( $vatRate / (100 + $vatRate)); diff --git a/catalog/controller/payment/mollie/helper.php b/catalog/controller/payment/mollie/helper.php index 3f2c46f1..33f6b773 100644 --- a/catalog/controller/payment/mollie/helper.php +++ b/catalog/controller/payment/mollie/helper.php @@ -5,7 +5,7 @@ class MollieHelper { - const PLUGIN_VERSION = "9.0.4"; + const PLUGIN_VERSION = "9.0.5"; // All available modules. These should correspond to the Mollie_API_Object_Method constants. const MODULE_NAME_BANKTRANSFER = "banktransfer"; diff --git a/release.sh b/release.sh index f9b37b33..03c5ce75 100755 --- a/release.sh +++ b/release.sh @@ -8,10 +8,11 @@ echo "3/5 Unzip temporary zip to upload dir..." unzip -q temp.zip -d upload echo "4/5 Create opencart installable zip..." rm mollie-opencart-2.3-and-up.ocmod.zip +rm mollie-opencart-1.5-and-up.vqmod.zip zip -9 -rq mollie-opencart-1.5-and-up.vqmod.zip upload LICENSE readme.md -x *.git* *.DS_Store echo "5/5 Cleanup..." rm -rf ./upload rm -rf ./temp.zip -echo "Done!" \ No newline at end of file +echo "Done!"