Hallo,
ich würde gerne die Prozentangabe der Ersparnis bei reduzierten Artikeln separat, also nicht unter dem neuen Preis ausgeben.
Wenn ich nun die ursprüngliche Funktion xtcFormatSpecial
function xtcFormatSpecial($pID, $sPrice, $pPrice, $format, $vpeStatus = 0) {
if ($format) {
$price = '<span class="productOldPrice"><small>'.INSTEAD.'</small><del>'.$this->xtcFormat($pPrice, $format).'</del></span><br />'.ONLY.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format).'<br /><small>'.YOU_SAVE.round(($pPrice-$sPrice) / $pPrice * 100,1).' % /'.$this->xtcFormat($pPrice-$sPrice, $format).'</small>';
if ($vpeStatus == 0) {
return $price;
} else {
return array ('formated' => $price, 'plain' => $sPrice);
}
} else {
return round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']);
}
}[/PHP]
so bearbeite, dass ich den Teil abspalte, der die Ersparnis ausgibt:
[PHP]'<small>'.YOU_SAVE.round(($pPrice-$sPrice) / $pPrice * 100,1).' % /'.$this->xtcFormat($pPrice-$sPrice, $format).'</small>'[/PHP]
und eine neue Funktion xtcFormatErspanis schreibe:
[PHP] function xtcFormatErsparnis($pID, $sPrice, $pPrice, $format, $vpeStatus = 0) {
if ($format) {
$ersparnis = '<small>'.YOU_SAVE.round(($pPrice-$sPrice) / $pPrice * 100,1).' % /'.$this->xtcFormat($pPrice-$sPrice, $format).'</small>';
if ($vpeStatus == 0) {
return $ersparnis;
} [/PHP]
wie kann ich diese Funktion dann in mein Template einbinden?
Ich würde die Anzeige gerne in der new_products_default.html einbauen. Dort wird das Preismodul ja mit {$module_data.PRODUCTS_PRICE} eingebunden.
Wo habe ich entsprechende Definitionen und Eintragungen vorzunehmen, um das Ergebnis der Ersparnis-Funktion auszugeben?
Danke im Voraus,
Martin