Modify

Opened 10 years ago

Closed 6 years ago

Last modified 6 years ago

#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 Gerhard Waldemair, 10 years ago

Milestone: modified-shop-2.00modified-shop-2.10
Version: 2.02.10

comment:2 by Volker Strähle, 10 years ago

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.

comment:3 by Torsten Riemer, 8 years ago

Milestone: modified-shop-2.1.0.0

comment:4 by Gerhard Waldemair, 6 years ago

Milestone: modified-shop-2.0.5.0

comment:5 by Gerhard Waldemair, 6 years ago

Resolution: fixed
Status: newclosed

In 11974:

fix #821

comment:6 by Gerhard Waldemair, 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

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.