From e1ac461143eded52ab8781ed06d06d4673d05adc Mon Sep 17 00:00:00 2001 From: Sebastian Bossert Date: Mon, 18 Nov 2019 16:14:32 +0100 Subject: [PATCH] Release 1.0.31 --- README.md | 4 ++-- docs/en/documentation.html | 4 ++-- .../library/postfinancecheckout/service/line_item.php | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7234c50..0730647 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ This repository contains the OpenCart PostFinance Checkout payment module that ## Documentation -* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/opencart-2.3/1.0.30/docs/en/documentation.html) +* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/opencart-2.3/1.0.31/docs/en/documentation.html) ## License -Please see the [license file](https://github.com/pfpayments/opencart-2.3/blob/1.0.30/LICENSE) for more information. \ No newline at end of file +Please see the [license file](https://github.com/pfpayments/opencart-2.3/blob/1.0.31/LICENSE) for more information. \ No newline at end of file diff --git a/docs/en/documentation.html b/docs/en/documentation.html index 888d1a6..d47b445 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -21,7 +21,7 @@

Documentation

  • - + Source
  • @@ -48,7 +48,7 @@

    1. -

      Download the extension.

      +

      Download the extension.

    2. Extract the files and upload the content of the Upload directory into the root directory of your store using FTP/SSH.

      diff --git a/upload/system/library/postfinancecheckout/service/line_item.php b/upload/system/library/postfinancecheckout/service/line_item.php index 85fb208..c11b631 100644 --- a/upload/system/library/postfinancecheckout/service/line_item.php +++ b/upload/system/library/postfinancecheckout/service/line_item.php @@ -381,12 +381,12 @@ private function createLineItemFromProduct($product){ $product['tax_class_id'] = $this->getTaxClassByProductId($product['product_id']); if ($this->coupon && (!$this->coupon['product'] || in_array($product['product_id'], $this->coupon['product']))) { - $count = 1; - if(!empty($this->coupon['product'])) { - $count = count($this->coupon['product']); - } if ($this->coupon['type'] == 'F') { - $discount = $this->coupon['discount'] / $count; + if(empty($this->coupon['product'])) { + $discount = $this->coupon['discount'] * ($product['total'] / $this->sub_total); + }else { + $discount = $this->coupon['discount'] / count($this->coupon['product']); + } } elseif ($this->coupon['type'] == 'P') { $discount = $product['total'] / 100 * $this->coupon['discount'];