Voraussichtliche Versandkosten im Warenkorb Bug

  • Es wird eine Währung verwendet, deren Wert(Lan/Steuern->Währungen->[Währung]->Wert) von 1.0 abweicht.
    Voraussichtliche Versandkosten im Warenkorb werden falsch berechnet. Nur mit Währungswert 1.0 funktioniert es richtig.
    Fehler ist in shipping_estimate.php

    ab Zeile 104:
    $quote['methods'][0]['cost'] = $xtPrice->xtcCalculateCurr($quote['methods'][0]['cost']);
    hier werden die Kosten (in währunglosen Einheiten) in die aktuelle Währung konvertiert.
    ...
    $total += ((isset($quote['tax']) && $quote['tax'] > 0) ? $xtPrice->xtcAddTax($quote['methods'][0]['cost'], $quote['tax']) : (!empty($quote['methods'][0]['cost']) ? $quote['methods'][0]['cost'] : '0'));
    ...
    'VALUE' => $xtPrice->xtcFormat(((isset($quote['tax']) && $quote['tax'] > 0) ? $xtPrice->xtcAddTax($quote['methods'][0]['cost'], $quote['tax']) : (!empty($quote['methods'][0]['cost']) ? $quote['methods'][0]['cost'] : '0')), true)
    xtcAddTax ruft intern xtcCalculateCurr auf, womit die Währung-Konvertierung findet doppelt statt.

  • Also das nenne ich wirklich mal professionelles Arbeiten. Gleich mit Lösungsansatz / Behebung. Danke, wird mit aufgenommen.

    <p>Wir geben nur Anregungen und Hilfestellung auf Basis unserer Erfahrung, keine Rechtshilfe!<br>\m/('_')\m/</p>

  • In der Funktion xtcAddTax ist aber die Funktion xtcCalculateCurr enthalten, eine Änderung bringt hier keine ersichtliche Änderung

    <p>Wir geben nur Anregungen und Hilfestellung auf Basis unserer Erfahrung, keine Rechtshilfe!<br>\m/('_')\m/</p>

  • Dann verstehe ich Deine Frage oben nicht ganz. In der Estimate wird die Funktion AddTax verwendet, wobei in dieser Funktion bereits die Währung berücksichtigt wird. Warum hast Du obige Frage gestellt? Habe das mal durch gespielt und die Währungsumrechnung funktioniert an dieser Stelle.

    <p>Wir geben nur Anregungen und Hilfestellung auf Basis unserer Erfahrung, keine Rechtshilfe!<br>\m/('_')\m/</p>

  • $quote['methods'][0]['cost'] = $xtPrice->xtcCalculateCurr($quote['methods'][0]['cost']);
    $total += ((isset($quote['tax']) && $quote['tax'] > 0) ? $xtPrice->xtcAddTax($quote['methods'][0]['cost'], $quote['tax']) : (!empty($quote['methods'][0]['cost']) ? $quote['methods'][0]['cost'] : '0'));

    xtcCalculateCurr wird 2 Mal aufgerufen (siehe fettmarkiert). Meinst du, dass es richtig ist?

  • Versandkosten: 10.00 Einheiten
    CHF Kurs: 2.50 (nicht realer Kurs, nur zum Zeigen)

    $quote['methods'][0]['cost'] = $xtPrice->xtcCalculateCurr($quote['methods'][0]['cost']);
    $quote['methods'][0]['cost'] hat 25.00 CHF (hier ist der Betrag richtig)
    'VALUE' => $xtPrice->xtcFormat(((isset($quote['tax']) && $quote['tax'] > 0) ? $xtPrice->xtcAddTax($quote['methods'][0]['cost'], $quote['tax']) : (!empty($quote['methods'][0]['cost']) ? $quote['methods'][0]['cost'] : '0')), true)
    'VALUE' hat 62.50 CHF
    'VALUE' wird auf dem Frontend angezeigt.
    $total += ((isset($quote['tax']) && $quote['tax'] > 0) ? $xtPrice->xtcAddTax($quote['methods'][0]['cost'], $quote['tax']) : (!empty($quote['methods'][0]['cost']) ? $quote['methods'][0]['cost'] : '0'));
    $total wird um 62.50 CHF erhöht, was falsch ist, weil Versandkosten nur 25.00 CHF beträgt.

    Wo korrekt?
    Warenkorb:
    [ATTACH=CONFIG]587[/ATTACH]
    Kasse:
    [ATTACH=CONFIG]586[/ATTACH]

  • Absolut sauber getestet :) Kannst Du mal testen mit folgender Zeile (statt den 2 anderen Zeilen):

    Code
    $total += ((isset($quote['tax']) && $quote['tax'] > 0) ? $xtPrice->xtcCalculateCurr($quote['methods'][0]['cost'], $quote['tax']) : (!empty($quote['methods'][0]['cost']) ? $quote['methods'][0]['cost'] : '0'));

    <p>Wir geben nur Anregungen und Hilfestellung auf Basis unserer Erfahrung, keine Rechtshilfe!<br>\m/('_')\m/</p>

  • Ich glaube, das läuft was anders schief. Das $total ist ja für die Gesamtsumme und nicht für die Versandkosten! Da wo die einzelnen Versandkosten ausgegeben werden, ist es etwas weiter unten > $shipping_content[$i]
    Ist es möglich, dass ich es mir bei Dir mal anschaue? FTP und so bitte per Mail oder PN. Egal wie ich es anstelle, bei mir geht es korrekt.

    <p>Wir geben nur Anregungen und Hilfestellung auf Basis unserer Erfahrung, keine Rechtshilfe!<br>\m/('_')\m/</p>