Marktplatz - Eine große Auswahl an neuen und hilfreichen Modulen sowie modernen Templates für die modified eCommerce Shopsoftware
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: Prozent oder Neu Ecken in den Artikeln V2.0

    martin-schulz1

    • Fördermitglied
    • Beiträge: 353
    • Geschlecht:
    Prozent oder Neu Ecken in den Artikeln V2.0
    am: 27. September 2016, 08:42:25
    Hallo Leute wie bekomme ich es hin das in den Artikel NEU oder Prozentzeichen angezeigt werden für die Version 2.0

    LG Martin

    Linkback: https://www.modified-shop.org/forum/index.php?topic=35786.0
    Trade Republic - Provisionsfrei Aktien handeln

    Viol

    • Fördermitglied
    • Beiträge: 2.279
    Re: Prozent oder Neu Ecken in den Artikeln V2.0
    Antwort #1 am: 27. September 2016, 10:09:28
    Hallo Martin,
    kannst Du Deine Frage mal etwas detaillierter stellen?

    martin-schulz1

    • Fördermitglied
    • Beiträge: 353
    • Geschlecht:
    Re: Prozent oder Neu Ecken in den Artikeln V2.0
    Antwort #2 am: 27. September 2016, 10:14:12
    Ja gerne.
    Ich denke das dies Bild meine Frage genau darstellt.

    h-h-h

    • modified Team
    • Beiträge: 4.562
    Re: Prozent oder Neu Ecken in den Artikeln V2.0
    Antwort #3 am: 27. September 2016, 10:49:02
    /includes/modules/product/listing_product_extra.php
    Code: PHP  [Auswählen]
    <?php

    class listing_product_extra {
        function __construct() {
            $this->code = 'listing_product_extra';
            $this->title = 'Artikelisten Extra';
            $this->description = '';
            $this->name = 'MODULE_PRODUCT_'.strtoupper($this->code);
            $this->enabled = defined($this->name.'_STATUS') && constant($this->name.'_STATUS') == 'true' ? true : false;
            $this->sort_order = defined($this->name.'_SORT_ORDER') ? constant($this->name.'_SORT_ORDER') : '';
            $this->translate();
        }

        function translate() {
        }

        function check() {
            if (!isset($this->_check)) {
                $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '".$this->name."_STATUS'");
                $this->_check = xtc_db_num_rows($check_query);
            }
            return $this->_check;
        }

        function keys() {
            define($this->name.'_STATUS_TITLE', TEXT_DEFAULT_STATUS_TITLE);
            define($this->name.'_STATUS_DESC', TEXT_DEFAULT_STATUS_DESC);
            define($this->name.'_SORT_ORDER_TITLE', TEXT_DEFAULT_SORT_ORDER_TITLE);
            define($this->name.'_SORT_ORDER_DESC', TEXT_DEFAULT_SORT_ORDER_DESC);

            return array(
                $this->name.'_STATUS',
                $this->name.'_SORT_ORDER'
            );
        }

        function install() {
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('".$this->name."_STATUS', 'true','6', '1','xtc_cfg_select_option(array(\'true\', \'false\'), ', now())");
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('".$this->name."_SORT_ORDER', '10','6', '2', now())");
        }

        function remove() {
            xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key LIKE '".$this->name."_%'");
        }

        function buildDataArray($productData, $array, $image)
        {
            $productData['neu'] = 0;
            $productData['rabatt'] = 0;
    /*
            if (...$array['products_id']...) {
                $productData['neu'] = 1;
            }
    */

            return $productData;
        }
    }

    Jetzt da noch die Logik einbauen für NEU und Rabatt, das Modul installieren und dann noch dein Listing Template erweitern.

    Hier noch ein ausschnitt der includes/classes/product.php:
    Code: PHP  [Auswählen]
        $productDataAdds = array (
          'PRODUCTS_PRICE' => $products_price['formated'],
          'PRICE_ALLOWED' => (($_SESSION['customers_status']['customers_status_show_price'] != '0') ? 'true' : 'false'),
          'COUNT' => isset($array['ID']) ? $array['ID'] : 0,
          'PRODUCTS_VPE' => $main->getVPEtext($array, $products_price['plain']),
          'PRODUCTS_VPE_VALUE' => $array['products_vpe_value'],
          'PRODUCTS_VPE_NAME' => $main->vpe_name,
          'PRODUCTS_IMAGE' => $products_image,
          'PRODUCTS_IMAGE_SIZE' => $img_attr,
          'PRODUCTS_IMAGE_TITLE' => str_replace(array('"', "'"), array('&quot;', '&apos;'), $array['products_name']),
          'PRODUCTS_LINK' => $products_link,
          'PRODUCTS_TAX_INFO' => $main->getTaxInfo($tax_rate),
          'PRODUCTS_SHIPPING_LINK' => $main->getShippingLink(),
          'PRODUCTS_BUTTON_BUY_NOW' => $buy_now,
          'PRODUCTS_SHIPPING_NAME' => $shipping_status_name,
          'PRODUCTS_SHIPPING_IMAGE' => $shipping_status_image,
          'PRODUCTS_SHIPPING_NAME_LINK' => $shipping_status_link,
          'PRODUCTS_EXPIRES' => isset($array['expires_date']) ? $array['expires_date'] : 0,
          'PRODUCTS_CATEGORY_URL' => isset($array['cat_url']) ? $array['cat_url'] : '',
          'PRODUCTS_BUTTON_DETAILS' => '<a href="'.$products_link.'">'.xtc_image_button('button_product_more.gif', TEXT_INFO_DETAILS).'</a>',
          'PRODUCTS_BUTTON_WISHLIST_NOW' => $wishlist_now,
          'PRODUCTS_LINK_WISHLIST_NOW' => $wishlist_now_link,
        );

        $productData = array_merge($productData,$productDataAdds);                    

        foreach((array)$products_price as $key => $entry) {                  
          $productData['PRODUCTS_PRICE_'.strtoupper($key)] = $entry;
          $productData['PRODUCTS_PRICE_ARRAY'][0]['PRODUCTS_PRICE_'.strtoupper($key)] = $entry;
        }
        $productData['PRODUCTS_PRICE_ARRAY'][0]['PRICE_ALLOWED'] = $productData['PRICE_ALLOWED'];

        //echo '<pre>'.print_r($productData,true).'</pre>';
        $productData = $this->productModules->buildDataArray($productData,$array,$image);

    Vermutlich kannst du den Rabatt aus aus $productData['PRODUCTS_PRICE_ bzw. $products_price bekommen.

    [OT] Kann mir jemand erklären, warum es in PRODUCTS_PRICE_ARRAY die erste Ebene ([0]) gibt ?

    Viele Grüße, h-h-h
    19 Antworten
    13154 Aufrufe
    06. Mai 2018, 03:29:07 von Shorty
    13 Antworten
    6798 Aufrufe
    29. Januar 2015, 13:55:14 von Bonsai
    5 Antworten
    4987 Aufrufe
    03. September 2010, 12:54:38 von h-h-h
               
    anything