PDA

Shop Support News Archive - Shopbetreiber News -> Forum : ECB: Gunnart Template - Anzeige Angebotsdauer


okidoki
05.01.2010, 20:59
Hallo ich hab mal wieder eine Frage zum Design gunnart

folgendes
--
Produkt Name des Jahres
ehemaliger Verkaufspreis
Statt 83,00 EUR
Nur 72,00 EUR
Angebot gültig bis 31.01.2010
(inkl. 19% MwSt. zzgl. Versand) (http://www.pferdeladen-online.de/shop_content.php?coID=1&XTCsid=c4f5f5d430ce8eb43cf314700d257036)

---

So nun die Frage: Oben im angezeigtem Text steht die Angebotsdauer(Angebot gültig bis 31.01.2010) nun zur Frage wie bekomm ich diese im Gunnart-Design zum laufen. Es geht hierbei um die Standart Angebote und nicht ums Liveshopping.
Vielen Dank vorab für die qualifizierte Hilfe welche man hier immer erhalten hat!

LG

ulli81
06.01.2010, 01:43
die ganze formatierung läuft in der /includes/classes/xtcPrice.php ab. daher muss man dort ein paar änderungen machen.

als 1. brauchen wir in der classe einen neue funktion:


/
xtcGetSpecialExpire

@param integer $pID
@return date
/
function xtcGetSpecialExpire($pID) {
$sql = "SELECT expires_date
FROM ".TABLE_SPECIALS."
WHERE products_id = '".$pID."'
AND status = 1";
$res = xtDBquery($sql);
$product = xtc_db_fetch_array($res, true);
$raw_date = $product['expires_date'];


// copy from /inc/xtc_date_short.inc.php
if ( ($raw_date == '0000-00-00 00:00:00') || empty($raw_date) ) return false;

$year = ecb_substr($raw_date, 0, 4);
$month = (int)ecb_substr($raw_date, 5, 2);
$day = (int)ecb_substr($raw_date, 8, 2);
$hour = (int)ecb_substr($raw_date, 11, 2);
$minute = (int)ecb_substr($raw_date, 14, 2);
$second = (int)ecb_substr($raw_date, 17, 2);

if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
} else {
return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
}
}
diese können wir dann in der funktion xtcFormatSpecial verwenden und erweitern somit den $price string:


if ($this -> xtcGetSpecialExpire($pID)) {
$price .= '<span class="priceSpecialExpire">'. EXPIRE . $this -> xtcGetSpecialExpire($pID) .'</span><br />';
}
nun noch den text in der /lang/german/german.php definieren:


define('EXPIRE','Angebot gültig bis ');
und im /template/{dein_tpl}/stylesheet.css entsprechend gestalten:


.priceSpecialExpire { font-size: 10px; font-weight: bold; }
thats all!
have fun


gruß
ulli