diff --git a/README.md b/README.md index 329ab4e..7234c50 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.29/docs/en/documentation.html) +* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/opencart-2.3/1.0.30/docs/en/documentation.html) ## License -Please see the [license file](https://github.com/pfpayments/opencart-2.3/blob/1.0.29/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.30/LICENSE) for more information. \ No newline at end of file diff --git a/docs/en/documentation.html b/docs/en/documentation.html index ab1a7e4..888d1a6 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 719e4dc..85fb208 100644 --- a/upload/system/library/postfinancecheckout/service/line_item.php +++ b/upload/system/library/postfinancecheckout/service/line_item.php @@ -381,8 +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'] * ($product['total'] / $this->sub_total); + $discount = $this->coupon['discount'] / $count; } elseif ($this->coupon['type'] == 'P') { $discount = $product['total'] / 100 * $this->coupon['discount'];