Forum Internet Service Backes

Bitte loggen sie sich ein oder registrieren sie sich.

Einloggen mit Benutzername, Passwort und Sitzungslänge
Erweiterte Suche  

Neuigkeiten:

Autor Thema: Produkt Preis formatieren (Variable PRODUCTS_PRICE)  (Gelesen 4558 mal)

Boni

  • Member
  • ***
  • Offline Offline
  • Beiträge: 15
Produkt Preis formatieren (Variable PRODUCTS_PRICE)
« am: 09 April, 2009, 20:00:52 Nachmittag »

Hallo,

Ich möchte die Preis Angaben (Alter Preis, Neuer Preis, Rabatt) über CSS formatieren.

Der Produkte Preis wird so wie ich das feststellen konnte in der /includes/classes/xtcPrice.php mit dieser function generiert.

-----------

function xtcFormatSpecialDiscount($pID, $discount, $pPrice, $format, $vpeStatus = 0) {
      $sPrice = $pPrice - ($pPrice / 100) * $discount;
      if ($format) {
         $price = '<span class="productOldPrice">'.INSTEAD.$this->xtcFormat($pPrice, $format).'</span><br />'
                  .ONLY.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format).'<br />'
                .YOU_SAVE.$discount.'%';
         if ($vpeStatus == 0) {
            return $price;
         } else {
            return array ('formated' => $price, 'plain' => $sPrice);
         }
      } else {
         return round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']);
      }
   }

-----------

Wenn man einen Rabatt angibt, kann man die Formatierung über das Stylesheet ändern da hierfür die Klasse "pructOldPrice" definiert ist.

Ich möchte aber nun für den neuen Preis  (Zeile begint mit .ONLY) und für die Rabatt Anzeige (Zeile beginnt mit .YOU_SAVE...) auch einen eigene Style festlegen. Am liebsten würde ich sie in eigene DIVs setzen.

Ist das überhaupt möglich, und wo müsste ich den HTML code einfügen.

Habe schon alles mögliche versucht aber leider ohne Erfolg. ???

Gruss

Boni
Gespeichert

Boni

  • Member
  • ***
  • Offline Offline
  • Beiträge: 15
Re: Produkt Preis formatieren (Variable PRODUCTS_PRICE)
« Antwort #1 am: 16 April, 2009, 17:48:18 Nachmittag »

Habe es nun selbst zum Funktionieren gebracht.

Also in xtcPrice.php ab Zeile 338 bis 351, div's wie folgt eingefügt:

function xtcFormatSpecialDiscount($pID, $discount, $pPrice, $format, $vpeStatus = 0) {
$sPrice = $pPrice - ($pPrice / 100) * $discount;
if ($format) {
$price = '<div id ="productOldPrice">'.INSTEAD.$this->xtcFormat($pPrice, $format).'</div>
      <div id="onlyNewPrice">'.ONLY.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format).'</div>
      <div id="rabatt">'.YOU_SAVE.$discount. '% </div>';
if ($vpeStatus == 0) {
return $price;
} else {
return array ('formated' => $price, 'plain' => $sPrice);
}
} else {
return round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']);
}
}

Nun kann man per CSS den alten Preis, den neuen Preis sowie die Rabatt Angabe separat formatieren und natürlich in den verschiedenen Templates (product_info und product_listiing) unterschiedlich je nach Bedarf.
Gespeichert
 

User Contact