Noch ein Hinweis zu einem Logik-Problem. Darüber bin ich auch schon gestolpert
Was passiert, wenn Samstags versendet wird und eine Zeit bspw. 16 Uhr eingestellt ist?
In der Woche sollte die Zeit kein Problem sein. Samstags versendet man gewöhnlich bis max. 12 Uhr!
Ich würde den Samstag generell auf 0 stellen. Aber das ist nur meine persönliche Meinung.
Bin noch nicht dazu gekommen, dass Modul mal einzubauen. Deshalb weiß ich jetzt nicht, ob ich den Countdown richtig angeklemmt habe.
Einbauanleitung für modified 1.06 Template xtc5
/templates/xtc5/javascript/general.js.php
Die JS-Dateien werden eingebunden. Dabei wird geprüft, ob die Sprache in der Session gespeichert ist. Wenn ja, wird die jeweilige Sprachdatei eingebunden.
suche
<?php // BOF - web28 - 2010-07-09 - TABS/ACCORDION in product_info ?>
füge davor ein
<?php // BOF Countdown für Versand by Gulliver72 ?><script src
="<?php echo 'templates/'.CURRENT_TEMPLATE; ?>/javascript/jquery.plugin.min.js" type
="text/javascript"></script><script src
="<?php echo 'templates/'.CURRENT_TEMPLATE; ?>/javascript/jquery.countdown.min.js" type
="text/javascript"></script><?php if ((isset($_SESSION['language_code'])) && ($_SESSION['language_code'] != 'en')) { ?><script src="
<?php echo 'templates/'.CURRENT_TEMPLATE
; ?>/javascript/jquery.countdown-
<?php echo $_SESSION['language_code']; ?>.js" type="text/javascript"></script>
<?php } // EOF Countdown für Versand by Gulliver72 ?> suche
</script>
füge davor ein
// BOF Countdown für Versand by Gulliver72
$(function () {
var austDay = new Date(); // heutiges Datum
var AbsolutJetzt = austDay.getTime(); // aktuelle Zeit
var AbsolutDann = AbsolutJetzt +
<?php echo $countdown_time; ?>; // Berechnung der Zeitdifferenz für Countdown
austDay.setTime(AbsolutDann); // Zeitdifferenz als Countdown-Zeit setzen
$.countdown.setDefaults($.countdown.regionalOptions[
<?php if ((isset($_SESSION['language_code'])) && ($_SESSION['language_code'] != 'en')) { echo $_SESSION['language_code'];} ?>]); // Countdown auf jeweilige Sprache setzen
$('#defaultCountdown').countdown({until: austDay, layout: '{hn} {hl}, {mn} {ml}, {sn} {sl}'}); // mit Format einzeilig
});
// EOF Countdown für Versand by Gulliver72
includes/modules/product_info.php
suche
// get default product_info template
füge davor ein
// BOF Countdown für Versand by Gulliver72 date_default_timezone_set('Europe/Berlin'); setlocale (LC_ALL
, 'de_DE'); // wenn heute kein Wochenende oder Feiertag ist, wird der Countdown angezeigt if ((is_object($modDelivery) && $modDelivery->isFreeDay($tamo) !== TRUE) || strftime("%w",$tamo) != 0 || (DELIVERY_ON_SATURDAY
== 0 && strftime("%w",$tamo) != 6)) { $tamo = time(); // aktuelles Datum und Zeit $aktuelle_zeit = strftime("%H:%M:%S:%d:%m:%Y"); // Differenz bis Versandzeitgrenze berechnen // aktuelle Zeit in Array zerlegen $start_time = explode(":", $aktuelle_zeit); // eingestellte Endzeit in Array ablegen $end_time = array(); $end_time[] = DELIVERY_MAX_HOUR
; // Stunde $minute = DELIVERY_MAX_MINUTE
; $end_time[] = strlen($minute) == 1 ?
'0' . $minute : $minute; // Minute $end_time[] = '00'; // Sekunde $ende_zeit = $end_time[0] . ':' . $end_time[1] . ':' . $end_time[2]; // Timestamp der Startzeit berechnen $start_time_stamp = mktime($start_time[0], $start_time[1], $start_time[2], $start_time[3], $start_time[4], $start_time[5]); // Timestamp der Endzeit berechnen $end_time_stamp = mktime($end_time[0], $end_time[1], $end_time[2], $start_time[3], $start_time[4], $start_time[5]); // Zeitdifferenz als Timestamp, benötigt für Javascript-Funktion $time_difference = $end_time_stamp - $start_time_stamp; // Zeitdifferenz in Millisekunden $countdown_time = $time_difference * 1000; $akt_zeit = strftime("%T"); if (($akt_zeit <= $ende_zeit) && ($product->data['products_quantity'] >0)) { $delivery_start_countdown = TEXT_COUNTDOWN_START
. '<span id="defaultCountdown"> </span>' . TEXT_COUNTDOWN_END
; $info_smarty->assign('DELIVERY_START_COUNTDOWN', $delivery_start_countdown); } } // EOF Countdown für Versand by Gulliver72 /templates/xtc5/modules/product_info/product_info_v1.html
suche
<p class="taxandshippinginfo" style="white-space:nowrap"><small>{$PRODUCTS_TAX_INFO}<br />{if $PRODUCTS_SHIPPING_LINK}{$PRODUCTS_SHIPPING_LINK|replace:'thickbox':'contentbox'|replace:'&KeepThis=true&TB_iframe=true&height=400&width=600':''|replace:'rel="nofollow" target="_blank"':''}{/if}</small></p>
füge danach ein
{if $DELIVERY_START_COUNTDOWN}<p>{$DELIVERY_START_COUNTDOWN}</p>{/if}
/lang/german/german.php
füge am Ende ein
// BOF Countdown für Versand by Gulliver72define('TEXT_COUNTDOWN_START', 'Bestellen sie innerhalb der nächsten');define('TEXT_COUNTDOWN_END', ', erfolgt der Versand noch heute');// EOF Countdown für Versand by Gulliver72