#821 closed Aufgabe (fixed)
xtc_expire_specials()
| Reported by: | Volker Strähle | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | modified-shop-2.0.5.0 |
| Component: | Shop | Version: | 2.0.1.0 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description
verschieben aus application_top.php nach includes/extra/application_top_begin/ alternativ nach admin/includes/extra/application_top_begin/
Funktion ist nicht bei jedem Seitenaufruf notwendig, da u. a. in products_info.php die Gültigkeit sowieso geprüft wird. Gelegentliches automatiscjes Aktualisieren durch einloggen in den Adminbereich reicht aus.
Attachments (0)
Change History (6)
comment:1 by , 10 years ago
| Milestone: | modified-shop-2.00 → modified-shop-2.10 |
|---|---|
| Version: | 2.0 → 2.10 |
comment:2 by , 10 years ago
comment:3 by , 8 years ago
| Milestone: | modified-shop-2.1.0.0 |
|---|
comment:4 by , 6 years ago
| Milestone: | → modified-shop-2.0.5.0 |
|---|
comment:6 by , 6 years ago
Es gibt sehr viele Variationsmöglichkeiten warum es nicht ausreicht den SQL nur x mal am Tag auszuführen. Angefangen von Übereinstimmung mit den rich snippets beim Besuch von Google bis hin zu einer mögloichen Lösung für Uhrzeiten bei SOndernageboten. Deshalb bleibt der Aufruf in der application_top.php

der Vollständigkeit halber - inc/xtc_expire_specials.php:
//require_once(DIR_FS_INC . 'xtc_set_specials_status.inc.php'); // Auto expire products on special function xtc_expire_specials() { $specials_query = xtc_db_query("SELECT specials_id FROM " . TABLE_SPECIALS . " WHERE status = '1' AND expires_date <= NOW() AND expires_date > 0"); if (xtc_db_num_rows($specials_query)) { xtc_db_query("UPDATE " . TABLE_SPECIALS . " SET status = '0', date_status_change = now() WHERE expires_date <= NOW() AND expires_date > 0"); /* while ($specials = xtc_db_fetch_array($specials_query)) { xtc_set_specials_status($specials['specials_id'], '0'); } */ } }Das spart bei mehreren Artikel die while-Schlife und damit entsprechende Anzahl an Abfragen.
Weiterhin sollte diese Funktion in die Klasse xtcPrice eingebaut werden und ggf. schon im Konstruktor der Klasse aufgerufen werden.