---
title: "Rabatt je FE-USER/ Kalkulation im Basket Falsch"
url: "https://www.typo3.net/d/76176-rabatt-je-fe-user-kalkulation-im-basket-falsch"
source: "typo3.net"
tags: ["Extensions","Frage"]
created: "2008-04-16"
last_reply: "2008-04-17"
replies: 2
solved: false
page: 1
pages: 1
lang: "de"
---

# Rabatt je FE-USER/ Kalkulation im Basket Falsch

Extensions · 2 Antworten · gestartet 2008-04-16

## Eröffnungsbeitrag

**Jojo Leon** · 2008-04-16 · [Beitrag #1](https://www.typo3.net/d/76176-rabatt-je-fe-user-kalkulation-im-basket-falsch/1)

Hallo

Kann jemand Helfen?

Ein FE-User wir ein Rabatt von z.B. 10 % eingeräumt.
FE-User legt einen Artikel im Wert von 160 € in den Korb. (Weniger 10 % also 144 €)
Im Warenkorb wird jetzt folgendes (vollkommen falsch) kalkuliert:

> Preis      Gesamt
> 144,00     129,60
>
> Insgesamt: 129,60 EUR
> Insgesamt ohne MwSt: 115,20 EUR
> enthaltene MwSt: 14,40 EUR

Das ist einfach nur extrem falsch.

tt_products ist Version 2.5.5

Mein TS:

```typoscript
plugin.tt_products {
  priceDecPoint = ,
  TAXincluded = 1
   PIDuserFolder = 9
  loginUserInfoAddress = 1
  lockLoginUserInfo = 1
  PIDlistDisplay = 281
  PIDpayment = 230
  PIDfinalize = 231
  orderByCategoryTitle = 1
  stdSearchFieldExt = subtitle
  payment >
  payment {
    radio = 1
    TAXpercentage = 19
    TAXincluded = 1
    10.title = Rechnung
    10.visibleForGroupID = 1
    40.title = Lastschrift
    40.visibleForGroupID = 1
    50.title = Vorkasse
    70.title = Nachnahme
  }
  shipping >
  shipping {
    TAXpercentage = 19
    TAXincluded = 1
    10.title = Versand
    10.calculationScript = fileadmin/php/products_comp_calcScript.inc.php
    10.price.type = count
    10.price.1 = 4.5 
    10.price.noCostsAmount = 100 
  }
  stdSearchFieldExt = subtitle
  }
}
```

## Antworten

### [#2](https://www.typo3.net/d/76176-rabatt-je-fe-user-kalkulation-im-basket-falsch/2) · Eros · 2008-04-16

In der Datei lib/class.tx_ttproducts_price.php den folgenden Teil der function getPrice ans Ende der function getResellerPrice verschieben:

```php
if ($TSFE->fe_user->user['tt_products_discount'] != 0) {
	$price = $price - ($price * ($TSFE->fe_user->user['tt_products_discount'] / 100));
}
```

### [#3](https://www.typo3.net/d/76176-rabatt-je-fe-user-kalkulation-im-basket-falsch/3) · Jojo Leon · 2008-04-17

Vielen Dank, das war der richtige Hinweis.
Zusammenfassung der Lösung:

Ändere die Funktion getPrice in der Datei lib/class.tx_ttproducts_price.php wie hier:

```php
function getPrice($price,$tax=true,&$taxpercentage,$taxIncluded=false,$bEnableTaxZero=false)	{
	global $TSFE;
	$rc = 0;
	$bTax = ($tax==1);
	$price = $this->toNumber(true, $price);
	if (doubleval($taxpercentage) == 0 && !$bEnableTaxZero)	{
		$taxpercentage = doubleval($this->conf['TAXpercentage']);
	}
	$taxFactor = 1 + $taxpercentage / 100;
	$taxFromShipping = $this->paymentshipping->getReplaceTAXpercentage(); 
	if (isset($taxFromShipping) && is_double($taxFromShipping))	{
		$newtaxFactor = 1 + $taxFromShipping / 100;
		$corrTaxFactor = 1;
		if ($taxIncluded)	{
			$price = $price / $taxFactor;
			$taxIncluded = false;
		}
		$taxFactor = $newtaxFactor * $corrTaxFactor;
	}
	$rc = $this->getPriceTax($price, $bTax, $taxIncluded, $taxFactor);
	return $rc;
}
```

Und ändere die Funktion getResellerPrice in der Datei lib/class.tx_ttproducts_price.php wie hier:

```php
function getResellerPrice($row,$tax=1)	{
	global $TSFE;
	$returnPrice = 0;
	$priceNo = intval($this->config['priceNoReseller']);
	if ($priceNo > 0) {
		$returnPrice = $this->getPrice($row['price'.$priceNo],$tax,$row['tax'],$this->conf['TAXincluded']);
	}
	if ($returnPrice == 0) {
		$returnPrice = $this->getPrice($row['price'],$tax,$row['tax'],$this->conf['TAXincluded']);
	}
	if ($TSFE->fe_user->user['tt_products_discount'] != 0) {
		$returnPrice = $returnPrice - ($returnPrice * ($TSFE->fe_user->user['tt_products_discount'] / 100));
	}
	return $returnPrice;
}
```

---

Quelle: „Rabatt je FE-USER/ Kalkulation im Basket Falsch“, typo3.net, https://www.typo3.net/d/76176-rabatt-je-fe-user-kalkulation-im-basket-falsch
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
