Zum Inhalt springen

Rabatt je FE-USER/ Kalkulation im Basket Falsch

Erstellt am 16. April 2008 · 2 Antworten · letzte Antwort am 17. April 2008

Tags: Frage

Jojo Leon ·

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:

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
  }
}
Eros ·

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

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

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:

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:

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;
}