rechtstexte für onlineshop
Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: ANLEITUNG: Ablaufdatum aus Tabelle SPECIALS in product_listing anzeigen

    h-h-h

    • modified Team
    • Beiträge: 4.562
    Hallo Karl und mouseworx,
    gute Arbeit ! Könntet ihr es mal zusammenfassen?
    Statt die xtc_date_short Funktion direkt in die class reinzuschreiben sollte es besser sein diese per require_once einzubinden:
    Code: PHP  [Auswählen]
    require_once (DIR_FS_INC.'xtc_date_short.inc.php');

    Code: PHP  [Auswählen]
        if ($special = $this->xtcCheckSpecial($pID))
              return $this->xtcFormatSpecial($pID, $this->xtcAddTax($special['price'], $products_tax), $pPrice, $format, $vpeStatus, $special['expires_date']);

    Würde ich vielleicht so lassen und dann:

    Code: PHP  [Auswählen]
        return isset($product['specials_new_products_price']) ? array('price' => $product['specials_new_products_price'], 'expires_date' => $product_price['expires_date']) : false;

    Besten Gruß

    h-h-h
    Werbung / Banner buchen

    mouseworx

    • Schreiberling
    • Beiträge: 254
    • Geschlecht:
    Code: PHP  [Auswählen]
    return isset($product['specials_new_products_price']) ? array('price' => $product['specials_new_products_price'], 'expires_date' => $product_price['expires_date']) : false;

    ist leider falsch - wenn dann

    Code: PHP  [Auswählen]
    return isset($product['specials_new_products_price']) ? array('price' => $product['specials_new_products_price'], 'expires_date' => $product['expires_date']) : false;

    Aber ich fasse das gleich nochmal zusammen.

    Grüße
    Sebastian

    mouseworx

    • Schreiberling
    • Beiträge: 254
    • Geschlecht:
    Wer die Ausgabe des Ablaufdatum eines Sonderangebotes quer durch den Shop realisieren möchte, kann sich die Klassen product und xtcPrice wie folgt anpassen.

    includes/classes/xtcPrice.php

    Suche

    Code: PHP  [Auswählen]
    // check special
    if ($sPrice = $this->xtcCheckSpecial($pID))
        return $this->xtcFormatSpecial($pID, $this->xtcAddTax($sPrice, $products_tax), $pPrice, $format, $vpeStatus);

    und ersetze es hiermit

    Code: PHP  [Auswählen]
    // check special
    if($special = $this->xtcCheckSpecial($pID))
        return $this->xtcFormatSpecial($pID, $this->xtcAddTax($special['price'], $products_tax), $pPrice, $format, $vpeStatus, $special['expires_date']);

    Suche

    Code: PHP  [Auswählen]
    function xtcCheckSpecial($pID) {
        $product_query = "select specials_new_products_price
                          from "
    .TABLE_SPECIALS."
                          where products_id = '"
    .$pID."'
                          and status = '1'"
    ;
       
        $product_query = xtDBquery($product_query);
        $product = xtc_db_fetch_array($product_query, true);
       
        return $product['specials_new_products_price'];
    }

    und ersetze es hiermit

    Code: PHP  [Auswählen]
    function xtcCheckSpecial($pID) {
        $product_query = "select specials_new_products_price, expires_date
                          from "
    .TABLE_SPECIALS."
                          where products_id = '"
    .$pID."'
                          and status = '1'"
    ;
       
        $product_query = xtDBquery($product_query);
        $product = xtc_db_fetch_array($product_query, true);
       
        return isset($product['specials_new_products_price']) ? array('price' => $product['specials_new_products_price'], 'expires_date' => $product['expires_date']) : false;
    }

    Suche

    Code: PHP  [Auswählen]
    function xtcFormatSpecial($pID, $sPrice, $pPrice, $format, $vpeStatus = 0) {

    ersetze

    Code: PHP  [Auswählen]
    function xtcFormatSpecial($pID, $sPrice, $pPrice, $format, $vpeStatus = 0, $expires_date = '') {

    und ersetze innerhalb der Funktion

    Code: PHP  [Auswählen]
    return array ('formated' => $price, 'plain' => $sPrice);

    mit

    Code: PHP  [Auswählen]
    return array ('formated' => $price, 'plain' => $sPrice, 'expires_date' => $expires_date);

    includes/classes/product.php

    Suche innerhalb der Funktion buildDataArray()

    Code: PHP  [Auswählen]
    return array ('COUNT' = > ....

    und innerhalb des Arrays folgendes hinzufügen

    Code: PHP  [Auswählen]
    'PRODUCTS_EXPIRES_DATE' => isset($products_price['expires_date']) ? $this->xtc_date_short($products_price['expires_date']) : '',

    Ich habe hier mit xtc_date_short() gleich die Formatierung des Datums übernommen. Damit die Funktion in der product Klasse zur Verfügung steht kann man die Funktion in die Klasse aufnehmen

    Suchen

    Code: PHP  [Auswählen]
    class product {

    einfügen

    Code: PHP  [Auswählen]
            // added
            function xtc_date_short($raw_date) {
            if ( ($raw_date == '0000-00-00 00:00:00') || empty($raw_date) ) return false;

                    $year = substr($raw_date, 0, 4);
                    $month = (int)substr($raw_date, 5, 2);
                    $day = (int)substr($raw_date, 8, 2);
                    $hour = (int)substr($raw_date, 11, 2);
                    $minute = (int)substr($raw_date, 14, 2);
                    $second = (int)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 preg_replace('/2037' . '$/', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
                    }
            }

    oder man beschäftigt das File System ein wenig und nimmt ein require_once wie von h-h-h vorgeschlagen.

    WICHTIG - Die Änderung gilt für alle Seiten für die die Funktion buildDataArray() die Daten bereit stellt, aber es gibt da leider immer noch Ausnahmen wie die product_info.php. Für die product_info.php geht aber folgendes:

    includes/modules/product_info.php

    Suchen

    Code: PHP  [Auswählen]
    require_once (DIR_FS_INC.'get_cross_sell_name.inc.php');

    darunter hinzufügen

    Code: PHP  [Auswählen]
    require_once (DIR_FS_INC.'xtc_date_short.inc.php');

    Suchen

    Code: PHP  [Auswählen]
    $info_smarty->assign('PRODUCTS_PRICE', $products_price['formated']);

    darunter hinzufügen

    Code: PHP  [Auswählen]
    $info_smarty->assign('PRODUCTS_EXPIRES_DATE', isset($products_price['expires_date']) ? xtc_date_short($products_price['expires_date']) : '');

    Damit steht dann auch in den Produkt Info Templates {$PRODUCTS_EXPIRES_DATE} zur Verfügung.

    Grüße
    Sebastian

    h-h-h

    • modified Team
    • Beiträge: 4.562
     :thx: Sebastian!

    Ich hatte für mein Beispiel die Daten aus dem Trunk genommen, daher waren da ein paar Differenzen vorhanden.

    Besten Gruß

    h-h-h

    karl

    • Schreiberling
    • Beiträge: 439
    Hallo Sebastian,
    klappt alles bestens!  :king:

    Könntest Du, weil du ja gerade so in Fahrt bist, auch mal eine Vorgabe machen zu der shopping_cart, der checkout_confirmation, der account_history_info und natürlich der E-Mail-Bestätigung. Dann sind wir das Thema wenigstens für immer durch.

    Hatte in der shopping_cart mein Glück probiert, jedoch nach 2 Stündigen Versuchen es wieder sein gelassen. Mir fehlen einfach die Kenntnisse um in den verschiedenen Seiten den Code einzubauen.

    h-h-h

    • modified Team
    • Beiträge: 4.562
    includes/classes/shopping_cart.php

    Suche:

    Code: PHP  [Auswählen]
                                    $products_price = $xtPrice->xtcGetPrice($products['products_id'], $format = false, $this->contents[$products_id]['qty'], $products['products_tax_class_id'], $products['products_price']);

                                    $products_array[] = array (
                                    'id' => $products_id,
                                    'name' => $products['products_name'],
                                    'model' => $products['products_model'],
                                    'image' => $products['products_image'],
                                    'price' => $products_price + $this->attributes_price($products_id),

    Ersetzen mit:

    Code: PHP  [Auswählen]
                                    $products_price = $xtPrice->xtcGetPrice($products['products_id'], $format = false, $this->contents[$products_id]['qty'], $products['products_tax_class_id'], $products['products_price']);
                                    $products_price_formated = $xtPrice->xtcGetPrice($products['products_id'], true, $this->contents[$products_id]['qty'], $products['products_tax_class_id'], $products['products_price']);

                                    $products_array[] = array (
                                    'id' => $products_id,
                                    'name' => $products['products_name'],
                                    'model' => $products['products_model'],
                                    'image' => $products['products_image'],
                                    'price' => $products_price + $this->attributes_price($products_id),
                                    'expires_date' => isset($products_price_formated['expires_date']) ? $products_price_formated['expires_date'] : '',

    includes/modules/order_details_cart.php

    Suche:

    Code: PHP  [Auswählen]
                                    'PRODUCTS_PRICE' => $xtPrice->xtcFormat($products[$i]['price'] * $products[$i]['quantity'], true),

    Füge danach ein:

    Code: PHP  [Auswählen]
                                    'EXPIRE_DATE' => $products[$i]['expires_date'],

    Und dann noch im Template einfügen:

    order_details.html

    Code: XML  [Auswählen]
    {$module_data.EXPIRE_DATE}

    Einfach mal testen für den Warenkorb, alles weitere ist IMHO egal.

    Besten Gruß

    h-h-h

    mouseworx

    • Schreiberling
    • Beiträge: 254
    • Geschlecht:
    Ich halte schon die Angabe des Ablaufdatums für das Sonderangebot im Warenkorb für überflüssig, da im Warenkorb ja bereits der neue, günstigere Preis ausgewiesen und der alte, ursprüngliche Preis nicht mehr ausgegeben wird. Aus der Rechtsberatung kenne ich bisher auch keine gegenteilige Meinung, es geht hier immer um das 'bewerben' eines Sonderangebots.

    Aber wenn man im Warenkorb den formatierten Sonderangebotspreis ausgibt, dann wird man auch um das Ablaufdatum für das Sonderangebot nicht herum kommen. Daher würde ich es lassen wie es war, Karl.

    Wie es geht hat h-h-h ja schon geschrieben, da war ich zu lahm. Auf den anderen Seiten (checkout / account) halte ich die Ausgabe ebenfalls für überflüssig, da kein Sonderangebot mehr beworben wird.

    Grüße
    Sebastian

    karl

    • Schreiberling
    • Beiträge: 439
    Hi H-H-H,
    werde das mal morgen testen.

    @mouseworx
    Na ich dachte wenn schon dann überall. Aber wenn man nicht muß kann ich mir die Arbeit auch sparen. Wäre auch die Frage ob das in der account_history_info richtig angezeigt wird, auch wenn man das Angebot zurück nimt. Müßte man ja wieder extra speichern den Wert. Ich glaub ich lass es. Im Warenkorn ist noch OK, so hat der Kunde den Hinweis, den Überblick und evtl. den Kaufreiz (Angebot).

    Besten Dank für Eure Hilfe! :good:

    karl

    • Schreiberling
    • Beiträge: 439
    Mit dem Warenkorb klappt das nicht. Keine Ausgabe.

    @Sebastian
    Hast Du eine Idee?

    Habe versucht mit der Abfrage: in der shopping cart direkt nach function get_products() {
    Code: PHP  [Auswählen]
    function products_daten() {
                   
                    $products_daten_query = xtc_db_query("select    p.products_id,                                         
                                                                    s.expires_date
                                                            from    "
    .TABLE_PRODUCTS." p,
                                                                    "
    .TABLE_SPECIALS." s
                                                                    where p.products_id='"
    .xtc_get_prid($products_id)."'
                                                                    and s.products_id = p.products_id
                                                                    and pd.language_id = '"
    .$_SESSION['languages_id']."'");
           
                            if ($products_daten = xtc_db_fetch_array($products_daten_query)) {
           
                                $products_daten_array[] = array (
                                    'expires_date_cart' => $products['expires_date'],
                           
                                );
                            }

                    return $products_daten_array;
            }

    und das in der order_details_cart

    Code: PHP  [Auswählen]
    'PRODUCTS_DATEN_EXPIRES_DATE_CART' => $products_daten[$i]['expires_date'],

    in der
    Code: PHP  [Auswählen]
    $module_content[$i] = array ('PRODUCTS_NAME' => $products[$i]['name'].$mark_stock,

    und zuletzt in der order_details.html
    Code: PHP  [Auswählen]
    {$module_data.PRODUCTS_DATEN_EXPIRES_DATE_CART}

    Geht das so überhaupt oder habe ich da Fehler eingebaut.
    Eigentlich abgekupfert und reduziert, nur nichts passiert.

    mouseworx

    • Schreiberling
    • Beiträge: 254
    • Geschlecht:
    Das ich die Angabe des Ablaufdatums für das Sonderangebot im Warenkorb für überflüssig halte, habe ich schon geschrieben. Dennoch - im Beitag von h-h-h ist ein kleiner Fehler drin - hier also nochmal alle Schritte zusammengefasst:

    includes/classes/shopping_cart.php

    Suche

    Code: PHP  [Auswählen]
    $products_price = $xtPrice->xtcGetPrice($products['products_id'], $format = false, $this->contents[$products_id]['qty'], $products['products_tax_class_id'], $products['products_price']);

    und füge darunter ein

    Code: PHP  [Auswählen]
    $products_price_formated = $xtPrice->xtcGetPrice($products['products_id'], $format = true, $this->contents[$products_id]['qty'], $products['products_tax_class_id'], $products['products_price'], 1);
     

    Suche

    Code: PHP  [Auswählen]
    'tax_class_id' => $products['products_tax_class_id'],

    und füge darunter ein

    Code: PHP  [Auswählen]
    'expires_date' => isset($products_price_formated['expires_date']) ? $products_price_formated['expires_date'] : '',

    shopping_cart.php

    Suche

    Code: PHP  [Auswählen]
    require_once (DIR_FS_INC.'xtc_recalculate_price.inc.php');

    und füge darunter ein

    Code: PHP  [Auswählen]
    require_once (DIR_FS_INC.'xtc_date_short.inc.php');

    includes/modules/order_details_cart.php

    Suche

    Code: PHP  [Auswählen]
    'PRODUCTS_PRICE' => $xtPrice->xtcFormat($products[$i]['price'] * $products[$i]['quantity'], true),

    und füge darunter ein

    Code: PHP  [Auswählen]
    'PRODUCTS_EXPIRES_DATE' => xtc_date_short($products[$i]['expires_date']),

    Jetzt kann man das Ablaufdatum auf der templates/DEIN_TEMPLATE/modules/order_details.html mit {$module_data.PRODUCTS_EXPIRES_DATE} an der gewünschten Stelle ausgeben.

    Grüße
    Sebastian

    karl

    • Schreiberling
    • Beiträge: 439
    Hallo Sebastian,
    klappte auf Anhieb. :thx:

    Bin aber bisher nicht wirklich hinter gestiegen, woher
    Code: PHP  [Auswählen]
    'expires_date' => isset($products_price_formated['expires_date']) ? $products_price_formated['expires_date'] : '',
    expires_date geholt wird wenn die Tabelle dort nicht ausgelesen wird.

    Und auch die "formated" Angabe ist mir ein Rätsel.
    Auf sowas wäre ich ja nie gekommen.

    Und was soll die 1 hinten bei:
    Code: PHP  [Auswählen]
    $products_price_formated = $xtPrice->xtcGetPrice($products['products_id'], $format = true, $this->contents[$products_id]['qty'], $products['products_tax_class_id'], $products['products_price'], 1);

    Kann man auf diese Art noch weitere Daten ausgeben?

    Kannst Du das kurz Erläutern damit ich daraus auch für die Zukunft etwas lerne oder ist das zu tief in der Materie drin, um es in kurze Zeilen zu packen?

    mouseworx

    • Schreiberling
    • Beiträge: 254
    • Geschlecht:
    Wir haben doch die Funktion xtcCheckSpecial() in der Datei includes/classes/xtcPrice.php bereits angepasst, daher bekommt jedes Sonderangebot nun sein expires_date mitgeliefert.

    Die Variablen $products_price['plain'] und $products_price['formated'] sind Standard Variablen für den unformatierten bzw. den formatierten Preis, die quer durch den Shop zur Verfügung stehen und über xtcFormat() bzw. xtcFormatSpecial() etc. bereitgestellt werden - dieses Array haben wir doch um $products_price['expires_date'] erweitert.

    Und die 1 bei

    Code: PHP  [Auswählen]
    $products_price_formated = $xtPrice->xtcGetPrice($products['products_id'], $format = true, $this->contents[$products_id]['qty'], $products['products_tax_class_id'], $products['products_price'], 1);

    war der kleine Fehler von h-h-h denn ohne diese 1 würde es keine formatierten Daten geben.

    Grüße
    Sebastian

    karl

    • Schreiberling
    • Beiträge: 439
    Ha, habe ich nun verstanden. Aber ob ich sowas mal, in einer anderen Situation, selbst hin bekomme  :-|

    Im übrigen habe ich jetzt auch weitere Angabe hinzugefügt, die in der Tabelle products und products_description zur Verfügung stehen. Das war einfach. Wie gehabt auslesen und angeben.

    Damit habe ich jetzt die Anforderungen für http://www.modified-shop.org/forum/index.php?topic=19203.msg185197#msg185197 - das evtl neu kommende Gesetz erfüllt.

    Hatte zuvor schon recht viele Extra-Felder eingebaut (Front- und Backend) da mit die Kurzbeschreibung und Detalbeschreibung schon immer ein Dron im Auge war. Einfach zu wenig und zu unkonfortabel.

    So kann ich z.B. Autor, ISBN, MHD, Verpackungseinheit usw. separat eintragen und auch abfragen, was nun auch sehr zum Vorteil wurde. So bleiben die Texte in der Kurzbeschreibung reine Verkaufstexte und die wichtigen Angaben zum Produkt, werden extra erfasst.

    Ich weiß, aber versuche jetzt die bisherigen Angaben in die checkout usw. einzutragen. Wenn schon dann einmal durch. Habe keine Lust auf noch eine offene Baustelle. Weil irgendwann kommt der Gesetzgeber auf die Idee, man müßte das ja überall angeben.  :crazy: Weiß man das?

    karl

    • Schreiberling
    • Beiträge: 439
    Hallo Sebastian,
    nach SP1d funktioniert expires nicht mehr!
    Da wurde die xtcPrice verändert. Bekomme das z.Z. nicht wieder auf die Reihe.
    ++++++++++
    geht wieder.
    Hatte ein paar Angaben übersehen.

    Hier mal die komplette Datei nach SP1d mit expires_date:

    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: xtcPrice.php 1402 2010-10-03 16:48:20Z dokuman $

       modified eCommerce Shopsoftware - community made shopping
       http://www.modified eCommerce Shopsoftware.org

       Copyright (c) 2010 modified eCommerce Shopsoftware
       Edit by kahno - Umbau Template - NEU: SPECILAS expires_date ueberall verfuegbar gemacht
            - siehe auch includes/classes/product.php =>> PRODUCTS_EXPIRES_DATE
            - SP1d
       - EDIT by kahno 07.2012 ->> SP1d    
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(currencies.php,v 1.15 2003/03/17); www.oscommerce.com
       (c) 2003 nextcommerce (currencies.php,v 1.9 2003/08/17); www.nextcommerce.org
       (c) 2006 XT-Commerce (xtcPrice.php 1316 2005-10-21)

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------
       Modified by Gunnar Tillmann (August 2006)
       http://www.gunnart.de

       Everywhere a price is displayed you see any existing kind of discount in percent and
       in saved money in your chosen currency
       ---------------------------------------------------------------------------------------*/


    /**
     * This class calculates and formates all prices within the shop frontend
     *
     */

    class xtcPrice {
            var $currencies;

        /**
         * Constructor initialises all required values like currencies, tax classes, tax zones etc.
         *
         * @param String $currency
         * @param Integer $cGroup
         * @return xtcPrice
         */

            function xtcPrice($currency, $cGroup) {

                    $this->currencies = array ();
                    $this->cStatus = array ();
                    $this->actualGroup = (int)$cGroup;
                    $this->actualCurr = $currency;
                    $this->TAX = array ();
                    $this->SHIPPING = array();
                    $this->showFrom_Attributes = true;
        if (!defined('HTTP_CATALOG_SERVER') && isset($_SESSION['cart'])) {
          if (is_object($_SESSION['cart'])) {
            $this->content_type = $_SESSION['cart']->get_content_type();
          }
        }

                    // select Currencies
                    $currencies_query = xtDBquery("SELECT * FROM ".TABLE_CURRENCIES);
                    while ($currencies = xtc_db_fetch_array($currencies_query, true)) {
                            $this->currencies[$currencies['code']] = array (
                            'title' => $currencies['title'],
                            'symbol_left' => $currencies['symbol_left'],
                            'symbol_right' => $currencies['symbol_right'],
                            'decimal_point' => $currencies['decimal_point'],
                            'thousands_point' => $currencies['thousands_point'],
                            'decimal_places' => $currencies['decimal_places'],
                            'value' => $currencies['value']
                            );
                    }
        //BOF - DokuMan - 2011-01-21 - Fix an issue when the currency in user's preference is not existing
        if (!isset($this->currencies[$this->actualCurr])) {
          $this->actualCurr = DEFAULT_CURRENCY;
        }
        //BOF - DokuMan - 2011-01-21 - Fix an issue when the currency in user's preference is not existing

                    // select Customers Status data
                    $customers_status_query = xtDBquery( "SELECT *
                                                  FROM "
    .TABLE_CUSTOMERS_STATUS."
                                                 WHERE customers_status_id = '"
    .$this->actualGroup."'
                                                   AND language_id = '"
    .(int)$_SESSION['languages_id']."'");
                    $customers_status_value = xtc_db_fetch_array($customers_status_query, true);
                    $this->cStatus = array ('customers_status_id' => $this->actualGroup,
                                'customers_status_name' => $customers_status_value['customers_status_name'],
                                'customers_status_image' => $customers_status_value['customers_status_image'],
                                'customers_status_public' => $customers_status_value['customers_status_public'],
                                'customers_status_discount' => $customers_status_value['customers_status_discount'],
                                'customers_status_ot_discount_flag' => $customers_status_value['customers_status_ot_discount_flag'],
                                'customers_status_ot_discount' => $customers_status_value['customers_status_ot_discount'],
                                'customers_status_graduated_prices' => $customers_status_value['customers_status_graduated_prices'],
                                'customers_status_show_price' => $customers_status_value['customers_status_show_price'],
                                'customers_status_show_price_tax' => $customers_status_value['customers_status_show_price_tax'],
                                'customers_status_add_tax_ot' => $customers_status_value['customers_status_add_tax_ot'],
                                'customers_status_payment_unallowed' => $customers_status_value['customers_status_payment_unallowed'],
                                'customers_status_shipping_unallowed' => $customers_status_value['customers_status_shipping_unallowed'],
                                'customers_status_discount_attributes' => $customers_status_value['customers_status_discount_attributes'],
                                'customers_fsk18' => $customers_status_value['customers_fsk18'],
                                'customers_fsk18_display' => $customers_status_value['customers_fsk18_display']
                                );

                    // prefetch tax rates for standard zone
                    $zones_query = xtDBquery("SELECT tax_class_id as class FROM ".TABLE_TAX_CLASS);
                    while ($zones_data = xtc_db_fetch_array($zones_query,true)) {
                            // calculate tax based on shipping or deliverey country (for downloads)
                            if (isset($_SESSION['billto']) && isset($_SESSION['sendto'])) {
                              $tax_address_query = xtc_db_query("SELECT ab.entry_country_id,
                                                      ab.entry_zone_id
                                                 FROM "
    . TABLE_ADDRESS_BOOK . " ab
                                            LEFT JOIN "
    . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                                WHERE ab.customers_id = '"
    . $_SESSION['customer_id'] . "'
                                                  AND ab.address_book_id = '"
    . ($this->content_type == 'virtual' ? $_SESSION['billto'] : $_SESSION['sendto']) . "'"); //DokuMan - leave content_type as it is
                    $tax_address = xtc_db_fetch_array($tax_address_query);
                            $this->TAX[$zones_data['class']]=xtc_get_tax_rate($zones_data['class'],$tax_address['entry_country_id'], $tax_address['entry_zone_id']);
                            } else {
                            $this->TAX[$zones_data['class']]=xtc_get_tax_rate($zones_data['class']);
                            }
                    }
            }

        /**
         * This function searchs the inividual price for a product using the product id $pID
         *
         * @param Integer $pID product id
         * @param Boolean $format Format the result?
         * @param Double $qty quantity
         * @param Integer $tax_class tax class id
         * @param Double $pPrice product price
         * @param Integer $vpeStatus vpe status
         * @param Integer $cedit_id customer specify tax conditions
         * @return String/Array Price (if format = true both plain and formatted)
         */

      function xtcGetPrice($pID, $format = true, $qty, $tax_class, $pPrice, $vpeStatus = 0, $cedit_id = 0) {

        // check if group is allowed to see prices
        if ($this->cStatus['customers_status_show_price'] == '0'){
          return $this->xtcShowNote($vpeStatus);
        }

        // get Tax rate
        if ($cedit_id != 0) {
          //BOC - web28 - 2012-04-07 - FIX edit orders in admin guest account
          if (defined('HTTP_CATALOG_SERVER')) {
            global $order;
            $cinfo = get_c_infos($order->customer['ID'], trim($order->delivery['country_iso_2']));
          } else {
            $cinfo = xtc_oe_customer_infos($cedit_id);
          }
          //EOC - web28 - 2012-04-07 - FIX edit orders in admin guest account
          $products_tax = xtc_get_tax_rate($tax_class, $cinfo['country_id'], $cinfo['zone_id']);
        } else {
          //BOF - DokuMan - 2010-08-23 - set undefined index
          //$products_tax = $this->TAX[$tax_class];
          $products_tax = isset($this->TAX[$tax_class]) ? $this->TAX[$tax_class] : 0;
          //EOF - DokuMan - 2010-08-23 - set undefined index
        }

        if ($this->cStatus['customers_status_show_price_tax'] == '0'){
          $products_tax = '';
        }

        // add taxes
        if ($pPrice == 0) {
          $pPrice = $this->getPprice($pID);
        }
        $pPrice = $this->xtcAddTax($pPrice, $products_tax);    
       
        // BOF - Tomcraft - 2009-11-28 - Included xs:booster
        // xs:booster Auktionspreis pruefen
        if ($sPrice = $this->xtcCheckXTBAuction($pID)){
          return $this->xtcFormatSpecial($pID, $sPrice, $pPrice, $format, $vpeStatus);
        }
        // EOF - Tomcraft - 2009-11-28 - Included xs:booster

        // check specialprice original von SP1d
    /*     if ($sPrice = $this->xtcCheckSpecial($pID)){
          return $this->xtcFormatSpecial($pID, $this->xtcAddTax($sPrice, $products_tax), $pPrice, $format, $vpeStatus, $special['expires_date']);
        }
         */

    // check special von mouseworx http://www.modified-shop.org/forum/index.php?topic=19834.15
    // wurde von vor SP1d uebernommen falls obige Angabe Fehler produziert
     if($special = $this->xtcCheckSpecial($pID))
          return $this->xtcFormatSpecial($pID, $this->xtcAddTax($special['price'], $products_tax), $pPrice, $format, $vpeStatus, $special['expires_date']);
         

        // check graduated
        if ($this->cStatus['customers_status_graduated_prices'] == '1') {
          if ($sPrice = $this->xtcGetGraduatedPrice($pID, $qty)){
            return $this->xtcFormatSpecialGraduated($pID, $this->xtcAddTax($sPrice, $products_tax), $pPrice, $format, $vpeStatus, $pID);
          }
        } else {
          // check Group Price
          if ($sPrice = $this->xtcGetGroupPrice($pID, 1)){
            return $this->xtcFormatSpecialGraduated($pID, $this->xtcAddTax($sPrice, $products_tax), $pPrice, $format, $vpeStatus, $pID);
          }
        }

        // check Product Discount
        if ($discount = $this->xtcCheckDiscount($pID)){
          return $this->xtcFormatSpecialDiscount($pID, $discount, $pPrice, $format, $vpeStatus);
        }
        return $this->xtcFormat($pPrice, $format, 0, false, $vpeStatus, $pID);
      }

        /**
         * This function returns the reqular price of a product,
         * no mather if its a special offer or has graduated prices
         *
         * @param Integer $pID product id
         * @return Double price
         */

            function getPprice($pID) {
                    $pQuery = "SELECT products_price FROM ".TABLE_PRODUCTS." WHERE products_id='".$pID."'";
                    $pQuery = xtDBquery($pQuery);
                    $pData = xtc_db_fetch_array($pQuery, true);
                    return $pData['products_price'];

            }

        /**
         * Adding a tax percentage to a price
         * This function also converts the price with currency factor,
         * so take care to avoid double conversions!
         *
         * @param Double $price net price
         * @param Double $tax tax value(%)
         * @return Double gross price
         */

            function xtcAddTax($price, $tax) {
                    $price += $price / 100 * $tax;
                    $price = $this->xtcCalculateCurr($price);
                    return round($price, $this->currencies[$this->actualCurr]['decimal_places']);
            }

      // BOF - Tomcraft - 2009-11-28 - Included xs:booster
            // xs:booster start (v1.041)
            function xtcCheckXTBAuction($pID)
            {
                    if(($pos=strpos($pID,"{"))) $pID=substr($pID,0,$pos);
        //BOF - DokuMan - 2010-08-23 - suppress error php-notice on undefined index xtb0
                    //if(!is_array($_SESSION['xtb0']['tx'])) return false;
                    if(@!is_array($_SESSION['xtb0']['tx'])) return false;
        //EOF - DokuMan - 2010-08-23 - suppress error php-notice on undefined index xtb0
                    foreach($_SESSION['xtb0']['tx'] as $tx) {
                            if($tx['products_id']==$pID&&$tx['XTB_QUANTITYPURCHASED']!=0) {
                                    $this->actualCurr=$tx['XTB_AMOUNTPAID_CURRENCY'];
                                    return round($tx['XTB_AMOUNTPAID'], $this->currencies[$this->actualCurr]['decimal_places']);
                            }
                    }
                    return false;
            }
            // xs:booster end
      // EOF - Tomcraft - 2009-11-28 - Included xs:booster

        /**
         * Returns the product sepcific discount
         *
         * @param Integer $pID product id
         * @return Mixed boolean false if not found or 0.00, double if found and > 0.00
         */

            function xtcCheckDiscount($pID) {

                    // check if group got discount
                    if ($this->cStatus['customers_status_discount'] != '0.00') {

                            $discount_query = "SELECT products_discount_allowed FROM ".TABLE_PRODUCTS." WHERE products_id = '".$pID."'";
                            $discount_query = xtDBquery($discount_query);
                            $dData = xtc_db_fetch_array($discount_query, true);

                            $discount = $dData['products_discount_allowed'];
                            if ($this->cStatus['customers_status_discount'] < $discount)
                                    $discount = $this->cStatus['customers_status_discount'];
                            if ($discount == '0.00')
                                    return false;
                            return $discount;

                    }
                    return false;
            }

        /**
         * Searches the graduated price of a product for a specified quantity
         *
         * @param Integer $pID product id
         * @param Double $qty quantity
         * @return Double graduated price
         */

      function xtcGetGraduatedPrice($pID, $qty) {
        if (defined('GRADUATED_ASSIGN') && GRADUATED_ASSIGN == 'true') {
          if (xtc_get_qty($pID) > $qty) {
            $qty = xtc_get_qty($pID);
          }
        }

        if (empty($this->actualGroup)) {
          $this->actualGroup = DEFAULT_CUSTOMERS_STATUS_ID_GUEST;
        }

        $graduated_price_query = xtDBquery("SELECT max(quantity) AS qty
                                              FROM "
    .TABLE_PERSONAL_OFFERS_BY.$this->actualGroup."
                                             WHERE products_id='"
    .$pID."'
                                               AND quantity<='"
    .$qty."'");    
        $graduated_price_data = xtc_db_fetch_array($graduated_price_query, true);
        if ($graduated_price_data['qty']) {
          $graduated_price_query = xtDBquery("SELECT personal_offer
                                                FROM "
    .TABLE_PERSONAL_OFFERS_BY.$this->actualGroup."
                                               WHERE products_id='"
    .$pID."'
                                                 AND quantity='"
    .$graduated_price_data['qty']."'");
          $graduated_price_data = xtc_db_fetch_array($graduated_price_query, true);

          $sPrice = $graduated_price_data['personal_offer'];
          if ($sPrice != 0.00){
            return $sPrice;
          }
        } else {
          return;
        }
            }

        /**
         * Searches the group price of a product
         *
         * @param Integer $pID product id
         * @param Double $qty quantity
         * @return Double group price
         */

            function xtcGetGroupPrice($pID, $qty) {

                    $graduated_price_query = "SELECT max(quantity) as qty
                                                                    FROM "
    .TABLE_PERSONAL_OFFERS_BY.$this->actualGroup."
                                                                    WHERE products_id='"
    .$pID."'
                                                                    AND quantity<='"
    .$qty."'";
                    $graduated_price_query = xtDBquery($graduated_price_query);
                    $graduated_price_data = xtc_db_fetch_array($graduated_price_query, true);
                    if ($graduated_price_data['qty']) {
                            $graduated_price_query = "SELECT personal_offer
                                                                    FROM "
    .TABLE_PERSONAL_OFFERS_BY.$this->actualGroup."
                                                                   WHERE products_id='"
    .$pID."'
                                                                     AND quantity='"
    .$graduated_price_data['qty']."'";
                            $graduated_price_query = xtDBquery($graduated_price_query);
                            $graduated_price_data = xtc_db_fetch_array($graduated_price_query, true);

                            $sPrice = $graduated_price_data['personal_offer'];
                            if ($sPrice != 0.00)
                                    return $sPrice;
                    } else {
                            return;
                    }

            }
        /**
         * Returns the option price of a selected option
         *
         * @param Integer $pID product id
         * @param Integer $option option id
         * @param Integer $value value id
         * @return Double option price
         */

            function xtcGetOptionPrice($pID, $option, $value) {
        $price = 0; //DokuMan - set variable $price
                    $attribute_price_query = "select pd.products_discount_allowed,
                                        pd.products_tax_class_id,
                                        p.options_values_price,
                                        p.price_prefix,
                                        p.options_values_weight,
                                        p.weight_prefix
                                        from "
    .TABLE_PRODUCTS_ATTRIBUTES." p,
                                        "
    .TABLE_PRODUCTS." pd
                                        where p.products_id = '"
    .$pID."'
                                        and p.options_id = '"
    .$option."'
                                        and pd.products_id = p.products_id
                                        and p.options_values_id = '"
    .$value."'";
                    $attribute_price_query = xtDBquery($attribute_price_query);
                    $attribute_price_data = xtc_db_fetch_array($attribute_price_query, true);
                    $discount = 0;
                    if ($this->cStatus['customers_status_discount_attributes'] == 1 && $this->cStatus['customers_status_discount'] != 0.00) {
                            $discount = $this->cStatus['customers_status_discount'];
                            if ($attribute_price_data['products_discount_allowed'] < $this->cStatus['customers_status_discount'])
                                    $discount = $attribute_price_data['products_discount_allowed'];
                    }
        //BOC web28 -2012-05-31 several currencies on product attributes
        $CalculateCurr = ($attribute_price_data['products_tax_class_id'] == 0) ? true : false;
        $price = $this->xtcFormat($attribute_price_data['options_values_price'], false, $attribute_price_data['products_tax_class_id'],$CalculateCurr);
        //EOC web28 -2012-05-31 several currencies on product attributes
                    if ($attribute_price_data['weight_prefix'] != '+')
                            $attribute_price_data['options_values_weight'] *= -1;
                    if ($attribute_price_data['price_prefix'] == '+') {
                            $price = $price - $price / 100 * $discount;
                    } else {
                            $price *= -1;
                    }
                    return array ('weight' => $attribute_price_data['options_values_weight'], 'price' => $price);
            }

        /**
         * Returns the text info for customers, whose customer group isn't allowed to see prices
         *
         * @param Integer $vpeStatus
         * @param Boolean $format
         * @return String / Array of String
         */

            function xtcShowNote($vpeStatus = 0) {
                    if ($vpeStatus == 1)
                            return array ('formated' => NOT_ALLOWED_TO_SEE_PRICES, 'plain' => 0);
                    return NOT_ALLOWED_TO_SEE_PRICES;
            }

        /**
         * Returns the special offer price of a product
         *
         * @param Integer $pID product id
         * @return Double special offer
         */

            // Edit by kahno 04.05.2012 siehe oben mouseworx
            function xtcCheckSpecial($pID) {
                    $product_query = "SELECT specials_new_products_price, expires_date
                                            FROM "
    .TABLE_SPECIALS."
                                           WHERE products_id = '"
    .$pID."'
                                             AND status=1"
    ;
                    $product_query = xtDBquery($product_query);
                    $product = xtc_db_fetch_array($product_query, true);
                    // original nach SP1d
                    //return $product['specials_new_products_price'];
    // return vor SP1d -> wieder aktiviert
    return isset($product['specials_new_products_price']) ? array('price' => $product['specials_new_products_price'], 'expires_date' => $product['expires_date']) : false;

            }

        /**
         * Converts the price  with the currency factor
         *
         * @param Double $price
         * @return Double converted price
         */

            function xtcCalculateCurr($price) {
                    return $this->currencies[$this->actualCurr]['value'] * $price;
            }

        /**
         * Returns the tax part of a net price
         *
         * @param Double $price price
         * @param Double $tax tax value
         * @return Double tax part
         */

            function calcTax($price, $tax) {
                    return $price * $tax / 100;
            }

        /**
         * Removes the currency factor of a price
         *
         * @param Double $price
         * @return Double
         */

            function xtcRemoveCurr($price) {

                    // check if used Curr != DEFAULT curr
                    if (DEFAULT_CURRENCY != $this->actualCurr) {
          //BOF- web28 - 2011-04-19 - FIX for division by zero
          if ($this->currencies[$this->actualCurr]['value'] > 0) {
                              return $price * (1 / $this->currencies[$this->actualCurr]['value']);
          }
          //EOF- web28 - 2011-04-19 - FIX for division by zero
                    } else {
                            return $price;
                    }
            }

        /**
         * Removes the tax from a price, e.g. to calculate a net price from gross price
         *
         * @param Double $price price
         * @param Double $tax tax value
         * @return Double net price
         */

            function xtcRemoveTax($price, $tax) {
                    $price = ($price / (($tax +100) / 100));
                    return $price;
            }

        /**
         * Returns the tax part of a gross price
         *
         * @param Double $price price
         * @param Double $tax tax value
         * @return Double tax part
         */

            function xtcGetTax($price, $tax) {
                    $tax = $price - $this->xtcRemoveTax($price, $tax);
                    return $tax;
            }

        /**
         * Removes the discount part of a price
         *
         * @param Double $price price
         * @param Double $dc discount
         * @return Double discount part
         */

            function xtcRemoveDC($price,$dc) {
                    $price = $price - ($price/100*$dc);
                    return $price;
            }

        /**
         * Returns the discount part of a price
         *
         * @param Double $price price
         * @param Double $dc discount
         * @return Double discount part
         */

            function xtcGetDC($price,$dc) {
                    $dc = $price/100*$dc;
                    return $dc;
            }

        /**
         * Check if the product has attributes which can modify the price
         * If so, it returns a prefix ' from '
         *
         * @param Integer $pID product id
         * @return String
         */

            function checkAttributes($pID) {
                    if (!$this->showFrom_Attributes) return;
                    if ($pID == 0)
                            return;
                    // BOF - Tomcraft - 2009-10-09 - Bugfix: Don't show "from" in front of price, when all priceoptions are "0".
                    //$products_attributes_query = "select count(*) as total from ".TABLE_PRODUCTS_OPTIONS." popt, ".TABLE_PRODUCTS_ATTRIBUTES." patrib where patrib.products_id='".$pID."' and patrib.options_id = popt.products_options_id and popt.language_id = '".(int) $_SESSION['languages_id']."'";
                    $products_attributes_query = "select count(*) as total
                                                             FROM "
    .TABLE_PRODUCTS_OPTIONS." popt,
                                                                  "
    .TABLE_PRODUCTS_ATTRIBUTES." patrib
                                                            WHERE patrib.products_id='"
    .$pID."'
                                                              AND patrib.options_id = popt.products_options_id
                                                              AND popt.language_id = '"
    .(int) $_SESSION['languages_id']."'
                                                              AND patrib.options_values_price > 0"
    ;
                    // EOF - Tomcraft - 2009-10-09 - Bugfix: Don't show "from" in front of price, when all priceoptions are "0".
                    $products_attributes = xtDBquery($products_attributes_query);
                    $products_attributes = xtc_db_fetch_array($products_attributes, true);
                    if ($products_attributes['total'] > 0)
                            return ' '.strtolower(FROM).' ';
            }



            function xtcCalculateCurrEx($price, $curr) {
                    return $price * ($this->currencies[$curr]['value'] / $this->currencies[$this->actualCurr]['value']);
            }

      /**
       * xtcFormat
       *
       * @param double $price
       * @param boolean $format
       * @param integer $tax_class
       * @param boolean $curr
       * @param integer $vpeStatus
       * @param integer $pID
       * @param integer $decimal_places
       * @return unknown
       */

            function xtcFormat($price, $format, $tax_class = 0, $curr = false, $vpeStatus = 0, $pID = 0, $decimal_places = 0) {
                    if ($curr) {
                            $price = $this->xtcCalculateCurr($price);
        }
                    if ($tax_class != 0) {
                            $products_tax = ($this->cStatus['customers_status_show_price_tax'] == '0') ? '' : $this->TAX[$tax_class];
                            $price = $this->xtcAddTax($price, $products_tax);
                    }
        $decimal_places = ($decimal_places > 0) ? $decimal_places : $this->currencies[$this->actualCurr]['decimal_places'];
                    if ($format) {
                            $Pprice = number_format(floatval($price), $decimal_places, $this->currencies[$this->actualCurr]['decimal_point'], $this->currencies[$this->actualCurr]['thousands_point']);
                            $Pprice = $this->checkAttributes($pID).$this->currencies[$this->actualCurr]['symbol_left'].' '.$Pprice.' '.$this->currencies[$this->actualCurr]['symbol_right'];
                            if ($vpeStatus == 0) {
                                    return $Pprice;
                            } else {
                                    return array ('formated' => $Pprice, 'plain' => $price);
                            }
                    } else {
                            return round($price, $decimal_places);
                    }
            }

            function xtcFormatSpecialDiscount($pID, $discount, $pPrice, $format, $vpeStatus = 0) {
                    $sPrice = $pPrice - ($pPrice / 100) * $discount;
                    if ($format) {
        //BOF - Dokuman - 2009-06-03 - show 'ab' / 'from' for the lowest price, not for the highest!
            //$price = '<span class="productOldPrice">'.INSTEAD.$this->xtcFormat($pPrice, $format).'</span><br />'.ONLY.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format).'<br />'.YOU_SAVE.$discount.'%';
        //$price = '<span class="productOldPrice"><small>'.INSTEAD.'</small><del>'.$this->xtcFormat($pPrice, $format).'</del></span><br />'.ONLY.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format).'<br /><small>'.YOU_SAVE.round(($pPrice-$sPrice) / $pPrice * 100).' % /'.$this->xtcFormat($pPrice-$sPrice, $format);
        // EDIT by kahno Umbau Template - div-klassen zugefuegt fuer angebot und sparen nun besser zu positionieren
          $price = '<span class="productOldPrice"><small>'.INSTEAD.'</small><del>'.$this->xtcFormat($pPrice, $format).'</del></span><div class="price_angebot">'.ONLY.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format).'</div><div class="price_angebot_sparen"><small>'.YOU_SAVE.round(($pPrice-$sPrice) / $pPrice * 100).' % /'.$this->xtcFormat($pPrice-$sPrice, $format);       
                    // Ausgabe des gültigen Kundengruppen-Rabatts (sofern vorhanden)
                            if ($discount != 0)     {
            $price .= '<div class="price_angebot_discount"><small>'.BOX_LOGINBOX_DISCOUNT.': '.round($discount).' %</small></div>';
          }
                            $price .= '</small></div>';
        //EOF - Dokuman - 2009-06-03 - show 'ab' / 'from' for the lowest price, not for the highest!
                            if ($vpeStatus == 0) {
                                    return $price;
                            } else {
                                    return array ('formated' => $price, 'plain' => $sPrice);
                            }
                    } else {
                            return round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']);
                    }
            }
     
        // Edit by kahno 04.05.2012 - aus Forum von mouseworx - vor SP1d
        // benutzt in (u.a.) product_listing + box right
            function xtcFormatSpecial($pID, $sPrice, $pPrice, $format, $vpeStatus = 0, $expires_date = '') {       
            //function xtcFormatSpecial($pID, $sPrice, $pPrice, $format, $vpeStatus = 0) {
                    if ($format) {
        //BOF - Dokuman - 2009-06-03 - show 'ab' / 'from' for the lowest price, not for the highest!
                            //$price = '<span class="productOldPrice">'.INSTEAD.$this->xtcFormat($pPrice, $format).'</span><br />'.ONLY.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format);
                            //BOF - vr - 2009-12-11 avoid div / 0 if product price is 0
                            if (!isset($pPrice) || $pPrice == 0)
                              $discount = 0;
                            else
                              $discount = ($pPrice - $sPrice) / $pPrice * 100;
                            $price = '<div class="productOldPrice"><small>'.INSTEAD.'</small><del>'.$this->xtcFormat($pPrice, $format).'</del></div><div class="price_angebot">'.ONLY.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format).'</div><div class="price_angebot_sparen"><small>'.YOU_SAVE.round($discount).' % /'.$this->xtcFormat($pPrice-$sPrice, $format).'</small></div>';
                            //$price = '<span class="productOldPrice"><small>'.INSTEAD.'</small><del>'.$this->xtcFormat($pPrice, $format).'</del></span><br />'.ONLY.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format).'<br /><small>'.YOU_SAVE.round($discount).' % /'.$this->xtcFormat($pPrice-$sPrice, $format).'</small>';
                            //EOF - vr - 2009-12-11 avoid div / 0 if product price is 0
        //EOF - Dokuman - 2009-06-03 - show 'ab' / 'from' for the lowest price, not for the highest!
                            if ($vpeStatus == 0) {
                                    return $price;
                            } else {
                                    // Edit by kahno 04.05.2012 - aus Forum von h-h-h
                                    return array ('formated' => $price, 'plain' => $sPrice, 'expires_date' => $expires_date);
                                    //return array ('formated' => $price, 'plain' => $sPrice);
                            }
                    } else {
                            return round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']);
                    }
            }

      /**
       * xtcFormatSpecialGraduated
       *
       * @param integer $pID
       * @param double $sPrice
       * @param double $pPrice
       * @param boolean $format
       * @param integer $vpeStatus
       * @param integer $pID
       * @return unknown
       */

      function xtcFormatSpecialGraduated($pID, $sPrice, $pPrice, $format, $vpeStatus = 0, $pID) {
        //BOF - Dokuman - 2009-06-03 - show 'ab' / 'from' for the lowest price, not for the highest! - NEU HINZUGEFÜGT "Steuerklasse ermitteln"
        $tQuery = xtc_db_query("SELECT products_tax_class_id FROM ".TABLE_PRODUCTS." WHERE products_id='".$pID."'");
        $tQuery = xtc_db_fetch_array($tQuery);
        $tax_class = $tQuery['products_tax_class_id'];
        //EOF - Dokuman - 2009-06-03 - show 'ab' / 'from' for the lowest price, not for the highest! - ENDE "Steuerklasse ermitteln"
        if ($pPrice == 0) {
          return $this->xtcFormat($sPrice, $format, 0, false, $vpeStatus);
        }
        if ($discount = $this->xtcCheckDiscount($pID)) {
          $sPrice -= $sPrice / 100 * $discount;
        }
        if ($format) {
          //BOF - Dokuman - 2009-06-03 - show 'ab' / 'from' for the lowest price, not for the highest!
          $sQuery = xtDBquery("SELECT max(quantity) AS qty
                                 FROM "
    .TABLE_PERSONAL_OFFERS_BY.$this->actualGroup."
                                WHERE products_id='"
    .$pID."'");
          $sQuery = xtc_db_fetch_array($sQuery, true);
          // NEU! Damit "UVP"-Anzeige wieder möglich ist
          // if ( ($this->cStatus['customers_status_graduated_prices'] == '1') || ($sQuery['qty'] > 1) ) {
          if ( ($this->cStatus['customers_status_graduated_prices'] == '1') && ($sQuery['qty'] > 1) ) {
            $bestPrice = $this->xtcGetGraduatedPrice($pID, $sQuery['qty']);
            if ($discount) {
              $bestPrice -= $bestPrice / 100 * $discount;
            }
            $price .= FROM.$this->xtcFormat($bestPrice, $format, $tax_class)
              .' <br /><small>' . UNIT_PRICE
              .$this->xtcFormat($sPrice, $format)
              .'</small>';
          } else if ($sPrice != $pPrice) { // if ($sPrice != $pPrice) {
           // Edot by kahno 27.04.2012 - Umbau Template - MSRP = "UVP" gegen INSTEAD = "Statt" getauscht
           // Klasse price_angebot gegen br getauscht - hinten Layer Abschluss neu
            $price = '<div id="SpecialGraduated"><span class="productOldPrice">'.INSTEAD.' '.$this->xtcFormat($pPrice, $format).'</span></div><div class="price_angebot"><small>'.YOUR_PRICE. '</small>' .$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format). '</div>';        
                    //$price = '<span class="productOldPrice">'.MSRP.' '.$this->xtcFormat($pPrice, $format).'</span><br />'.YOUR_PRICE.$this->checkAttributes($pID).$this->xtcFormat($sPrice, $format);
            //EOF - Dokuman - 2009-06-03 - show 'ab' / 'from' for the lowest price, not for the highest!
            } else {
            $price = $this->xtcFormat($sPrice, $format);
          }
         
          if ($vpeStatus == 0) {
            return $price;
          } else {
            return array ('formated' => $price, 'plain' => $sPrice);
          }
        } else {
          return round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']);
        }
      }

      /**
       * get_decimal_places
       *
       * @param unknown_type $code
       * @return unknown
       */

      function get_decimal_places($code) {
        return $this->currencies[$this->actualCurr]['decimal_places'];
      }

    }
    ?>

    Teichbau

    • Fördermitglied
    • Beiträge: 385
    • Geschlecht:
    Hallo,
    ich habe den Umbau an den 3 Dateien gemäß Antwort 17 von mouseworx ausgeführt.

    In der Produktdetailseite: product_info_tabs_v1.html
    konnte ich mit {$PRODUCTS_EXPIRES_DATE} das Datum anzeigen lassen.

    Wenn ich jetzt in der Produktliste: product_listing_v1.html {$PRODUCTS_EXPIRES_DATE} einfüge
    erscheint nirgendwo das Datum. 
    Kann mir jemand helfen wie ich das Datum sichtbar bekomme?

    Gruß Teichbau
    34 Antworten
    21532 Aufrufe
    15. Januar 2013, 23:21:25 von Gradler
    10 Antworten
    6970 Aufrufe
    10. Oktober 2011, 18:08:38 von Jürgen
    2 Antworten
    2659 Aufrufe
    20. September 2014, 21:48:21 von lullifatz
    17 Antworten
    5965 Aufrufe
    27. November 2015, 16:35:42 von Viol