Templateshop - Eine große Auswahl an neuen und 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: Eigene Beschreibungen für CrossSelling

    webtre

    • Neu im Forum
    • Beiträge: 39
    Eigene Beschreibungen für CrossSelling
    am: 01. September 2010, 09:27:21
    Hallo Gemeinde,

    ich habe mir heute mit Hilfe des Moduls Product Tabs, das ich leider nicht mehr in der Modulecke finde, ein neues Textfeld für Crossselling gebaut. Dieses wird auch wunderbar in der product_info angezeigt, allerdings nicht in den Crossselling oder Also_purchased Links.

    Vermutlich hab ich wohl vergessen eine Variable zu übergeben, aber ich weiß nicht was oder wo.

    Also die Tabellenzelle liegt in der products_description als products_cross_description | text | latin1 | usw.

    Die Bereitstellung im Adminmenü funktioniert auch und auch die Ausgabe auf der products_info Seite.

    Für das CrossSelling sieht der Aufruf folgendermaßen aus:

    \\includes\modules\cross_selling.php

    Code: PHP  [Auswählen]
    $module_smarty = new Smarty;
    $module_smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');

    $data = $product->getCrossSells();

    if (count($data)> 0) {

            $module_smarty->assign('language', $_SESSION['language']);
            $module_smarty->assign('module_content', $data);
            // set cache ID

            $module_smarty->caching = 0;
            $module = $module_smarty->fetch(CURRENT_TEMPLATE.'/module/cross_selling.html');
            $info_smarty->assign('MODULE_cross_selling', $module);
            $info_smarty->assign('PRODUCTS_CROSS_DESCRIPTION', stripslashes($product->data['products_cross_description']));
    }

    // reverse cross selling
    if (ACTIVATE_REVERSE_CROSS_SELLING=='true') {
    $module_smarty = new Smarty;

    $data = $product->getReverseCrossSells();      

    if (count($data)> 0) {

            $module_smarty->assign('language', $_SESSION['language']);
            $module_smarty->assign('module_content', $data);
            // set cache ID

            $module_smarty->caching = 0;
            $module = $module_smarty->fetch(CURRENT_TEMPLATE.'/module/reverse_cross_selling.html');
            $info_smarty->assign('MODULE_reverse_cross_selling', $module);
            $info_smarty->assign('PRODUCTS_CROSS_DESCRIPTION', stripslashes($product->data['products_cross_description']));
    }

    }

    ?>
    Der Aufruf im Template lautet folgendermaßen:

    \\template\module\cross_selling.html

    Code: PHP  [Auswählen]
    {config_load file="$language/lang_$language.conf" section="cross_selling"}
    <h3>{#heading_text#}</h3>
    <hr class="hrlightgrey" />

    {foreach name=aussen item=module_data from=$module_content}
            {foreach item=products_data from=$module_data.PRODUCTS}

    <div class="crossselling">      {if $products_data.PRODUCTS_IMAGE!=''}
            <a href="{$products_data.PRODUCTS_LINK}"><img src="{$products_data.PRODUCTS_IMAGE}" alt="{$products_data.PRODUCTS_NAME}" class="crosssellingImage" /></a>
            {/if}
                            <h2><a href="{$products_data.PRODUCTS_LINK}">{$products_data.PRODUCTS_CROSS_DESCRIPTION}</a></h2>
                            <span class="price">{$products_data.PRODUCTS_PRICE}</span>
    </div>
            {/foreach}
    {/foreach}
    Dieser Aufruf ist bei allen drei Modulen (CrossSelling, ReverseCrossSelling und AlsoPurchased) der gleiche.

    Kann mir jemand bei meinem Problem helfen?

    THX webTre



    Linkback: https://www.modified-shop.org/forum/index.php?topic=7748.0

    GTB

    • modified Team
    • Gravatar
    • Beiträge: 6.306
    • Geschlecht:
    Eigene Beschreibungen für CrossSelling
    Antwort #1 am: 01. September 2010, 09:50:25
    dazu musst du das neue Feld auch in der function getCrossSells() und function getAlsoPurchased() bekannt machen.

    zu finden in /includes/classes/product.php

    webtre

    • Neu im Forum
    • Beiträge: 39
    Eigene Beschreibungen für CrossSelling
    Antwort #2 am: 01. September 2010, 10:01:40
    Danke, das hatte ich vergessen zu erwähnen. In dieser Datei habe ich das Feld ebenfalls bekannt gegeben. Einmal bei getAlsoPurchased:

    Code: PHP  [Auswählen]
    function getAlsoPurchased() {
                    global $xtPrice;

                    $module_content = array ();

                    $fsk_lock = "";
                    if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
                            $fsk_lock = ' and p.products_fsk18!=1';
                    }
                    $group_check = "";
                    if (GROUP_CHECK == 'true') {
                            $group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
                    }

                    $orders_query = "select
                                                                                                                                                      p.products_fsk18,
                                                                                                                                                      p.products_id,
                                                                                                                                                      p.products_price,
                                                                                                                                                      p.products_tax_class_id,
                                                                                                                                                      p.products_image,
                                                                                                                                                      pd.products_name,
                                                                                                                                                      p.products_vpe,
                                                                                                                                                              p.products_vpe_status,
                                                                                                                                                              p.products_vpe_value,
                                                                                                                                                                                      pd.products_mini_description,
                                                                                              pd.products_midi_description,
                                                                                              pd.products_maxi_description,
                                                                                                                                                                                      pd.products_cross_description,
                                                                                                                                                      pd.products_short_description FROM "
    .TABLE_ORDERS_PRODUCTS." opa, ".TABLE_ORDERS_PRODUCTS." opb, ".TABLE_ORDERS." o, ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd
                                                                                                                                                      where opa.products_id = '"
    .$this->pID."'
                                                                                                                                                      and opa.orders_id = opb.orders_id
                                                                                                                                                      and opb.products_id != '"
    .$this->pID."'
                                                                                                                                                      and opb.products_id = p.products_id
                                                                                                                                                      and opb.orders_id = o.orders_id
                                                                                                                                                      and p.products_status = '1'
                                                                                                                                                      and pd.language_id = '"
    .(int) $_SESSION['languages_id']."'
                                                                                                                                                      and opb.products_id = pd.products_id
                                                                                                                                                      "
    .$group_check."
                                                                                                                                                      "
    .$fsk_lock."
                                                                                                                                                      group by p.products_id order by o.date_purchased desc limit "
    .MAX_DISPLAY_ALSO_PURCHASED;
                    $orders_query = xtDBquery($orders_query);
                    while ($orders = xtc_db_fetch_array($orders_query, true)) {

                            $module_content[] = $this->buildDataArray($orders);

                    }

                    return $module_content;

            }
    Und bei getCrossSelling:

    Code: PHP  [Auswählen]
    function getCrossSells() {
                    global $xtPrice;

                    $cs_groups = "SELECT products_xsell_grp_name_id FROM ".TABLE_PRODUCTS_XSELL." WHERE products_id = '".$this->pID."' GROUP BY products_xsell_grp_name_id";
                    $cs_groups = xtDBquery($cs_groups);
                    $cross_sell_data = array ();
                    if (xtc_db_num_rows($cs_groups, true)>0) {
                    while ($cross_sells = xtc_db_fetch_array($cs_groups, true)) {

                            $fsk_lock = '';
                            if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
                                    $fsk_lock = ' and p.products_fsk18!=1';
                            }
                            $group_check = "";
                            if (GROUP_CHECK == 'true') {
                                    $group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
                            }

                                    $cross_query = "select p.products_fsk18,
                                                                                                                                                                                                                                                     p.products_tax_class_id,
                                                                                                                                                                                                                                                     p.products_id,
                                                                                                                                                                                                                                                     p.products_image,
                                                                                                                                                                                                                                                     pd.products_name,
                                                                                                                                                                                                                                                                                                    pd.products_short_description,
                                                                                                                                                    pd.products_mini_description,
                                                                                                                                                    pd.products_midi_description,
                                                                                                                                                    pd.products_maxi_description,
                                                                                                                                                                                                                                                                                                                                    pd.products_cross_description,
                                                                                                                                                                                                                                                     p.products_fsk18,p.products_price,p.products_vpe,
                                                                                                                                                                                                                                                                                    p.products_vpe_status,
                                                                                                                                                                                                                                                                                    p.products_vpe_value,
                                                                                                                                                                                                                                                     xp.sort_order from "
    .TABLE_PRODUCTS_XSELL." xp, ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd
                                                                                                                                                                                                                                                where xp.products_id = '"
    .$this->pID."' and xp.xsell_id = p.products_id ".$fsk_lock.$group_check."
                                                                                                                                                                                                                                                and p.products_id = pd.products_id and xp.products_xsell_grp_name_id='"
    .$cross_sells['products_xsell_grp_name_id']."'
                                                                                                                                                                                                                                                and pd.language_id = '"
    .$_SESSION['languages_id']."'
                                                                                                                                                                                                                                                and p.products_status = '1'
                                                                                                                                                                                                                                                order by xp.sort_order asc"
    ;

                            $cross_query = xtDBquery($cross_query);
                            if (xtc_db_num_rows($cross_query, true)> 0)
                                    $cross_sell_data[$cross_sells['products_xsell_grp_name_id']] = array ('GROUP' => xtc_get_cross_sell_name($cross_sells['products_xsell_grp_name_id']), 'PRODUCTS' => array ());

                            while ($xsell = xtc_db_fetch_array($cross_query, true)) {

                                    $cross_sell_data[$cross_sells['products_xsell_grp_name_id']]['PRODUCTS'][] = $this->buildDataArray($xsell);
                            }

                    }
                    return $cross_sell_data;
                    }
            }
    Sowie ReverseCrossSelling:

    Code: PHP  [Auswählen]
             function getReverseCrossSells() {
                                    global $xtPrice;

                            $fsk_lock = '';
                            if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
                                    $fsk_lock = ' and p.products_fsk18!=1';
                            }
                            $group_check = "";
                            if (GROUP_CHECK == 'true') {
                                    $group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
                            }

                            $cross_query = xtDBquery("select p.products_fsk18,
                                                                                                                                                                                     p.products_tax_class_id,
                                                                                                                                                                                     p.products_id,
                                                                                                                                                                                     p.products_image,
                                                                                                                                                                                     pd.products_name,
                                                                                                                                                                                                                                    pd.products_short_description,
                                                                                                                    pd.products_mini_description,
                                                                                                                    pd.products_midi_description,
                                                                                                                    pd.products_maxi_description,
                                                                                                                                                                                                                                    pd.products_cross_description,
                                                                                                                                                                                     p.products_fsk18,p.products_price,p.products_vpe,
                                                                                                                                                                                                            p.products_vpe_status,
                                                                                                                                                                                                            p.products_vpe_value,
                                                                                                                                                                                     xp.sort_order from "
    .TABLE_PRODUCTS_XSELL." xp, ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd
                                                                                                                                                                                where xp.xsell_id = '"
    .$this->pID."' and xp.products_id = p.products_id ".$fsk_lock.$group_check."
                                                                                                                                                                                and p.products_id = pd.products_id
                                                                                                                                                                                and pd.language_id = '"
    .$_SESSION['languages_id']."'
                                                                                                                                                                                and p.products_status = '1'
                                                                                                                                                                                order by xp.sort_order asc"
    );

                            while ($xsell = xtc_db_fetch_array($cross_query, true)) {

                                    $cross_sell_data[] = $this->buildDataArray($xsell);
                            }

                    return $cross_sell_data;

             }

            function getGraduated() {
                    global $xtPrice;

                    $staffel_query = xtDBquery("SELECT
                                                                         quantity,
                                                                         personal_offer
                                                                         FROM
                                                                         "
    .TABLE_PERSONAL_OFFERS_BY.(int) $_SESSION['customers_status']['customers_status_id']."
                                                                         WHERE
                                                                         products_id = '"
    .$this->pID."'
                                                                         ORDER BY quantity ASC"
    );

                    $staffel = array ();
                    while ($staffel_values = xtc_db_fetch_array($staffel_query, true)) {
                            $staffel[] = array ('stk' => $staffel_values['quantity'], 'price' => $staffel_values['personal_offer']);
                    }
                    $staffel_data = array ();
                    for ($i = 0, $n = sizeof($staffel); $i <$n; $i ++) {
                            if ($staffel[$i]['stk'] == 1) {
                                    $quantity = $staffel[$i]['stk'];
                                    if ($staffel[$i +1]['stk'] != '')
                                            $quantity = $staffel[$i]['stk'].'-'. ($staffel[$i +1]['stk'] - 1);
                            } else {
                                    $quantity = '> '.$staffel[$i]['stk'];
                                    if ($staffel[$i +1]['stk'] != '')
                                            $quantity = $staffel[$i]['stk'].'-'. ($staffel[$i +1]['stk'] - 1);
                            }
                            $vpe = '';
                            // BOF - Hetfield - 2009-08-24 - BUGFIX show VPE for graduated prices
                            if ($this->data['products_vpe_status'] == 1 && $this->data['products_vpe_value'] != 0.0 && $staffel[$i]['price']> 0) {
                                    $vpe = $staffel[$i]['price'] - $staffel[$i]['price'] / 100 * $discount;
                                    $vpe = $vpe * (1 / $this->data['products_vpe_value']);
                                    $vpe = BASICPRICE_VPE_TEXT.$xtPrice->xtcFormat($vpe, true, $this->data['products_tax_class_id']).TXT_PER.xtc_get_vpe_name($this->data['products_vpe']);
                            }
                            // EOF - Hetfield - 2009-08-24 - BUGFIX show VPE for graduated prices
                            $staffel_data[$i] = array ('QUANTITY' => $quantity, 'VPE' => $vpe, 'PRICE' => $xtPrice->xtcFormat($staffel[$i]['price'] - $staffel[$i]['price'] / 100 * $discount, true, $this->data['products_tax_class_id']));
                    }

                    return $staffel_data;

            }
    Leider bin ich nur ein FrondEnd-Coder und kein PHP-Programmierer, sodass ich mich immer an anderen Dateien und Modulen entlang hangel, wenn ich was einbauen will. Vielen Dank für eure Hilfe,

    webTre

    GTB

    • modified Team
    • Gravatar
    • Beiträge: 6.306
    • Geschlecht:
    Eigene Beschreibungen für CrossSelling
    Antwort #3 am: 01. September 2010, 10:13:20
    wie sieht deine function buildDataArray() aus ?

    webtre

    • Neu im Forum
    • Beiträge: 39
    Eigene Beschreibungen für CrossSelling
    Antwort #4 am: 01. September 2010, 10:48:59
    Öhm, wo soll die denn stehen?

    GTB

    • modified Team
    • Gravatar
    • Beiträge: 6.306
    • Geschlecht:
    Eigene Beschreibungen für CrossSelling
    Antwort #5 am: 01. September 2010, 11:06:26
    /includes/classes/product.php

    webtre

    • Neu im Forum
    • Beiträge: 39
    Eigene Beschreibungen für CrossSelling
    Antwort #6 am: 01. September 2010, 11:16:17
    Diese Funktion habe ich nirgends im gesamten Verzeichnis.
    Der Shop läuft noch auf der 1.03 Version, kann das damit zusammen hängen?

    GTB

    • modified Team
    • Gravatar
    • Beiträge: 6.306
    • Geschlecht:
    Eigene Beschreibungen für CrossSelling
    Antwort #7 am: 01. September 2010, 11:18:30
    poste mal bitte die gesamte /includes/classes/product.php

    webtre

    • Neu im Forum
    • Beiträge: 39
    Eigene Beschreibungen für CrossSelling
    Antwort #8 am: 01. September 2010, 11:25:18
    Wenn ich das richtig verstehe, dann baut der Shop ja das Array direkt in der product.php.
    Dort sind aber alle selects angelegt.

    z.B.

    Code: PHP  [Auswählen]
    function getAlsoPurchased() {
    .
    .
    $module_content = array ();
    .
    .
    $oders_query = "select ...
    .
    .
    pd.products_cross_description,
    .
    .
    }
    Oder muss ich dem Aufruf noch Parameter zuweisen, wie bei der short_description?
    siehe:

    Code: PHP  [Auswählen]
    pd.products_short_description FROM ".TABLE_ORDERS_PRODUCTS." opa, ...
    Wobei der Produktname und der Preis einwandfrei angezeigt werden.

    webtre

    • Neu im Forum
    • Beiträge: 39
    Eigene Beschreibungen für CrossSelling
    Antwort #9 am: 01. September 2010, 11:26:16
    poste mal bitte die gesamte /includes/classes/product.php

    Hier ist sie:

    Code: PHP  [Auswählen]
    <?php

    /* -----------------------------------------------------------------------------------------
       $Id: product.php 1316 2005-10-21 15:30:58Z mz $

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Copyright (c) 2005 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(Coding Standards); www.oscommerce.com

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/


    class product {

            /**
             *
             * Constructor
             *
             */

            function product($pID = 0) {
                    $this->pID = $pID;
    // BOF - Tomcraft - 2009-10-30 - noimage.gif is displayed, when no image is defined
                    //$this->useStandardImage=false;
                    $this->useStandardImage=true;
    // EOF - Tomcraft - 2009-10-30 - noimage.gif is displayed, when no image is defined
                    $this->standardImage='noimage.gif';
                    if ($pID = 0) {
                            $this->isProduct = false;
                            return;
                    }
                    // query for Product
                    $group_check = "";
                    if (GROUP_CHECK == 'true') {
                            $group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
                    }

                    $fsk_lock = "";
                    if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
                            $fsk_lock = ' and p.products_fsk18!=1';
                    }

                    $product_query = "select * FROM ".TABLE_PRODUCTS." p,
                                                                                                                          "
    .TABLE_PRODUCTS_DESCRIPTION." pd
                                                                                                                          where p.products_status = '1'
                                                                                                                          and p.products_id = '"
    .$this->pID."'
                                                                                                                          and pd.products_id = p.products_id
                                                                                                                          "
    .$group_check.$fsk_lock."
                                                                                                                          and pd.language_id = '"
    .(int) $_SESSION['languages_id']."'";

                    $product_query = xtDBquery($product_query);

                    if (!xtc_db_num_rows($product_query, true)) {
                            $this->isProduct = false;
                    } else {
                            $this->isProduct = true;
                            $this->data = xtc_db_fetch_array($product_query, true);
                    }

            }

            /**
             *
             *  Query for attributes count
             *
             */


            function getAttributesCount() {

                    $products_attributes_query = xtDBquery("select count(*) as total from ".TABLE_PRODUCTS_OPTIONS." popt, ".TABLE_PRODUCTS_ATTRIBUTES." patrib where patrib.products_id='".$this->pID."' and patrib.options_id = popt.products_options_id and popt.language_id = '".(int) $_SESSION['languages_id']."'");
                    $products_attributes = xtc_db_fetch_array($products_attributes_query, true);
                    return $products_attributes['total'];

            }

            /**
             *
             * Query for reviews count
             *
             */


            function getReviewsCount() {
                    $reviews_query = xtDBquery("select count(*) as total from ".TABLE_REVIEWS." r, ".TABLE_REVIEWS_DESCRIPTION." rd where r.products_id = '".$this->pID."' and r.reviews_id = rd.reviews_id and rd.languages_id = '".$_SESSION['languages_id']."' and rd.reviews_text !=''");
                    $reviews = xtc_db_fetch_array($reviews_query, true);
                    return $reviews['total'];
            }

            /**
             *
             * select reviews
             *
             */


            function getReviews() {

                    $data_reviews = array ();
                    $reviews_query = xtDBquery("select
                                                                                                             r.reviews_rating,
                                                                                                             r.reviews_id,
                                                                                                             r.customers_name,
                                                                                                             r.date_added,
                                                                                                             r.last_modified,
                                                                                                             r.reviews_read,
                                                                                                             rd.reviews_text
                                                                                                             from "
    .TABLE_REVIEWS." r,
                                                                                                             "
    .TABLE_REVIEWS_DESCRIPTION." rd
                                                                                                             where r.products_id = '"
    .$this->pID."'
                                                                                                             and  r.reviews_id=rd.reviews_id
                                                                                                             and rd.languages_id = '"
    .$_SESSION['languages_id']."'
                                                                                                             order by reviews_id DESC"
    );
                    if (xtc_db_num_rows($reviews_query, true)) {
                            $row = 0;
                            $data_reviews = array ();
                            while ($reviews = xtc_db_fetch_array($reviews_query, true)) {
                                    $row ++;
                                    $data_reviews[] = array ('AUTHOR' => $reviews['customers_name'], 'DATE' => xtc_date_short($reviews['date_added']), 'RATING' => xtc_image('templates/'.CURRENT_TEMPLATE.'/img/stars_'.$reviews['reviews_rating'].'.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'TEXT' => $reviews['reviews_text']);
                                    if ($row == PRODUCT_REVIEWS_VIEW)
                                            break;
                            }
                    }
                    return $data_reviews;

            }

            /**
             *
             * return model if set, else return name
             *
             */


            function getBreadcrumbModel() {

                    if ($this->data['products_model'] != "")
                            return $this->data['products_model'];
                    return $this->data['products_name'];

            }

            /**
             *
             * get also purchased products related to current
             *
             */


            function getAlsoPurchased() {
                    global $xtPrice;

                    $module_content = array ();

                    $fsk_lock = "";
                    if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
                            $fsk_lock = ' and p.products_fsk18!=1';
                    }
                    $group_check = "";
                    if (GROUP_CHECK == 'true') {
                            $group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
                    }

                    $orders_query = "select   p.products_fsk18,
                                                                      p.products_id,
                                                                      p.products_price,
                                                                      p.products_tax_class_id,
                                                                      p.products_image,
                                                                      pd.products_name,
                                                                      p.products_vpe,
                                                                      p.products_vpe_status,
                                                                      p.products_vpe_value,
                                                                      pd.products_mini_description,
                                                                      pd.products_midi_description,
                                                                      pd.products_maxi_description,
                                                                      pd.products_cross_description,
                                                                      pd.products_short_description FROM "
    .TABLE_ORDERS_PRODUCTS." opa, ".TABLE_ORDERS_PRODUCTS." opb, ".TABLE_ORDERS." o, ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd
                                                                      where opa.products_id = '"
    .$this->pID."'
                                                                      and opa.orders_id = opb.orders_id
                                                                      and opb.products_id != '"
    .$this->pID."'
                                                                      and opb.products_id = p.products_id
                                                                      and opb.orders_id = o.orders_id
                                                                      and p.products_status = '1'
                                                                      and pd.language_id = '"
    .(int) $_SESSION['languages_id']."'
                                                                      and opb.products_id = pd.products_id
                                                                      "
    .$group_check."
                                                                      "
    .$fsk_lock."
                                                                      group by p.products_id order by o.date_purchased desc limit "
    .MAX_DISPLAY_ALSO_PURCHASED;
                    $orders_query = xtDBquery($orders_query);
                    while ($orders = xtc_db_fetch_array($orders_query, true)) {

                            $module_content[] = $this->buildDataArray($orders);

                    }

                    return $module_content;

            }

            /**
             *
             *
             *  Get Cross sells
             *
             *
             */

            function getCrossSells() {
                    global $xtPrice;

                    $cs_groups = "SELECT products_xsell_grp_name_id FROM ".TABLE_PRODUCTS_XSELL." WHERE products_id = '".$this->pID."' GROUP BY products_xsell_grp_name_id";
                    $cs_groups = xtDBquery($cs_groups);
                    $cross_sell_data = array ();
                    if (xtc_db_num_rows($cs_groups, true)>0) {
                    while ($cross_sells = xtc_db_fetch_array($cs_groups, true)) {

                            $fsk_lock = '';
                            if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
                                    $fsk_lock = ' and p.products_fsk18!=1';
                            }
                            $group_check = "";
                            if (GROUP_CHECK == 'true') {
                                    $group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
                            }

                                    $cross_query = "select  p.products_fsk18,
                                                                                    p.products_tax_class_id,
                                                                                    p.products_id,
                                                                                    p.products_image,
                                                                                    pd.products_name,
                                                                                    pd.products_short_description,
                                            pd.products_mini_description,
                                            pd.products_midi_description,
                                            pd.products_maxi_description,
                                                                                    pd.products_cross_description,
                                                                                    p.products_fsk18,p.products_price,p.products_vpe,
                                                                    p.products_vpe_status,
                                                                    p.products_vpe_value,

                                                                                    xp.sort_order from "
    .TABLE_PRODUCTS_XSELL." xp, ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd
                                                                                                                                                                                                                    where xp.products_id = '"
    .$this->pID."' and xp.xsell_id = p.products_id ".$fsk_lock.$group_check."
                                                                                                                                                                                                                    and p.products_id = pd.products_id and xp.products_xsell_grp_name_id='"
    .$cross_sells['products_xsell_grp_name_id']."'
                                                                                                                                                                                                                    and pd.language_id = '"
    .$_SESSION['languages_id']."'
                                                                                                                                                                                                                    and p.products_status = '1'
                                                                                                                                                                                                                    order by xp.sort_order asc"
    ;

                            $cross_query = xtDBquery($cross_query);
                            if (xtc_db_num_rows($cross_query, true)> 0)
                                    $cross_sell_data[$cross_sells['products_xsell_grp_name_id']] = array ('GROUP' => xtc_get_cross_sell_name($cross_sells['products_xsell_grp_name_id']), 'PRODUCTS' => array ());

                            while ($xsell = xtc_db_fetch_array($cross_query, true)) {

                                    $cross_sell_data[$cross_sells['products_xsell_grp_name_id']]['PRODUCTS'][] = $this->buildDataArray($xsell);
                            }

                    }
                    return $cross_sell_data;
                    }
            }

            /**
             *
             * get reverse cross sells
             *
             */


             function getReverseCrossSells() {
                                    global $xtPrice;

                            $fsk_lock = '';
                            if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
                                    $fsk_lock = ' and p.products_fsk18!=1';
                            }
                            $group_check = "";
                            if (GROUP_CHECK == 'true') {
                                    $group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
                            }

                            $cross_query = xtDBquery("select        p.products_fsk18,
                                                                                                    p.products_tax_class_id,
                                                                                                    p.products_id,
                                                                                                    p.products_image,
                                                                                                    pd.products_name,
                                                                                                    pd.products_short_description,
                                                    pd.products_mini_description,
                                                    pd.products_midi_description,
                                                    pd.products_maxi_description,
                                                                                                    pd.products_cross_description,
                                                                                                    p.products_fsk18,p.products_price,p.products_vpe,
                                                                            p.products_vpe_status,
                                                                            p.products_vpe_value,  

                                                                                                    xp.sort_order from "
    .TABLE_PRODUCTS_XSELL." xp, ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd
                                                                                                                                                                                where xp.xsell_id = '"
    .$this->pID."' and xp.products_id = p.products_id ".$fsk_lock.$group_check."
                                                                                                                                                                                and p.products_id = pd.products_id
                                                                                                                                                                                and pd.language_id = '"
    .$_SESSION['languages_id']."'
                                                                                                                                                                                and p.products_status = '1'
                                                                                                                                                                                order by xp.sort_order asc"
    );

                            while ($xsell = xtc_db_fetch_array($cross_query, true)) {

                                    $cross_sell_data[] = $this->buildDataArray($xsell);
                            }

                    return $cross_sell_data;

             }

            function getGraduated() {
                    global $xtPrice;

                    $staffel_query = xtDBquery("SELECT
                                                                         quantity,
                                                                         personal_offer
                                                                         FROM
                                                                         "
    .TABLE_PERSONAL_OFFERS_BY.(int) $_SESSION['customers_status']['customers_status_id']."
                                                                         WHERE
                                                                         products_id = '"
    .$this->pID."'
                                                                         ORDER BY quantity ASC"
    );

                    $staffel = array ();
                    while ($staffel_values = xtc_db_fetch_array($staffel_query, true)) {
                            $staffel[] = array ('stk' => $staffel_values['quantity'], 'price' => $staffel_values['personal_offer']);
                    }
                    $staffel_data = array ();
                    for ($i = 0, $n = sizeof($staffel); $i <$n; $i ++) {
                            if ($staffel[$i]['stk'] == 1) {
                                    $quantity = $staffel[$i]['stk'];
                                    if ($staffel[$i +1]['stk'] != '')
                                            $quantity = $staffel[$i]['stk'].'-'. ($staffel[$i +1]['stk'] - 1);
                            } else {
                                    $quantity = '> '.$staffel[$i]['stk'];
                                    if ($staffel[$i +1]['stk'] != '')
                                            $quantity = $staffel[$i]['stk'].'-'. ($staffel[$i +1]['stk'] - 1);
                            }
                            $vpe = '';
                            // BOF - Hetfield - 2009-08-24 - BUGFIX show VPE for graduated prices
                            if ($this->data['products_vpe_status'] == 1 && $this->data['products_vpe_value'] != 0.0 && $staffel[$i]['price']> 0) {
                                    $vpe = $staffel[$i]['price'] - $staffel[$i]['price'] / 100 * $discount;
                                    $vpe = $vpe * (1 / $this->data['products_vpe_value']);
                                    $vpe = BASICPRICE_VPE_TEXT.$xtPrice->xtcFormat($vpe, true, $this->data['products_tax_class_id']).TXT_PER.xtc_get_vpe_name($this->data['products_vpe']);
                            }
                            // EOF - Hetfield - 2009-08-24 - BUGFIX show VPE for graduated prices
                            $staffel_data[$i] = array ('QUANTITY' => $quantity, 'VPE' => $vpe, 'PRICE' => $xtPrice->xtcFormat($staffel[$i]['price'] - $staffel[$i]['price'] / 100 * $discount, true, $this->data['products_tax_class_id']));
                    }

                    return $staffel_data;

            }
            /**
             *
             * valid flag
             *
             */


            function isProduct() {
                    return $this->isProduct;
            }

            // beta
            function getBuyNowButton($id, $name) {
                    global $PHP_SELF;
                    return '<a href="'.xtc_href_link(basename($PHP_SELF), 'action=buy_now&BUYproducts_id='.$id.'&'.xtc_get_all_get_params(array ('action')), 'NONSSL').'">'.xtc_image_button('button_buy_now.gif', TEXT_BUY.$name.TEXT_NOW).'</a>';

            }

            function getVPEtext($product, $price) {
                    global $xtPrice;

                    require_once (DIR_FS_INC.'xtc_get_vpe_name.inc.php');

                    if (!is_array($product))
                            $product = $this->data;

                    if ($product['products_vpe_status'] == 1 && $product['products_vpe_value'] != 0.0 && $price> 0) {
                            return $xtPrice->xtcFormat($price * (1 / $product['products_vpe_value']), true).TXT_PER.xtc_get_vpe_name($product['products_vpe']);
                    }

                    return;

            }

            function buildDataArray(&$array,$image='thumbnail') {
                    global $xtPrice,$main;

                            $tax_rate = $xtPrice->TAX[$array['products_tax_class_id']];

                            $products_price = $xtPrice->xtcGetPrice($array['products_id'], $format = true, 1, $array['products_tax_class_id'], $array['products_price'], 1);

                            if ($_SESSION['customers_status']['customers_status_show_price'] != '0') {
                            if ($_SESSION['customers_status']['customers_fsk18'] == '1') {
                                    if ($array['products_fsk18'] == '0')
                                            $buy_now = $this->getBuyNowButton($array['products_id'], $array['products_name']);

                            } else {
                                    $buy_now = $this->getBuyNowButton($array['products_id'], $array['products_name']);
                            }
                            }

                            $shipping_status_name = $main->getShippingStatusName($array['products_shippingtime']);
                            $shipping_status_image = $main->getShippingStatusImage($array['products_shippingtime']);

                    return array ('PRODUCTS_NAME' => $array['products_name'],
                                    'COUNT'=>$array['ID'],
                                    'PRODUCTS_ID'=>$array['products_id'],
                                    'PRODUCTS_MODEL'=>$array['products_model'],
                                    'PRODUCTS_VPE' => $this->getVPEtext($array, $products_price['plain']),
                                    'PRODUCTS_IMAGE' => $this->productImage($array['products_image'], $image),

                                    'PRODUCTS_LINK' => xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($array['products_id'], $array['products_name'])),
                                    'PRODUCTS_PRICE' => $products_price['formated'],
                                    '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_DESCRIPTION' => $array['products_description'],
                    'PRODUCTS_DESCRIPTION_MINI' => $array['products_mini_description'],
                    'PRODUCTS_DESCRIPTION_MIDI' => $array['products_midi_description'],
                    'PRODUCTS_DESCRIPTION_MAXI' => $array['products_maxi_description'],
                                    'PRODUCTS_DESCRIPTION_CROSS' => $array['products_cross_description'],

                                    // BOF - Christian - 2009-06-26 - strip tags... ignore HTML Formating

                                    //'PRODUCTS_DESCRIPTION' => strip_tags($array['products_description']),

                                    // EOF - Christian - 2009-06-26 - strip tags... ignore HTML Formating

                                    'PRODUCTS_EXPIRES' => $array['expires_date'],
                                    'PRODUCTS_CATEGORY_URL'=>$array['cat_url'],

                                    // BOF - Christian - 2009-06-26 - strip tags... ignore HTML Formating

                                    //'PRODUCTS_SHORT_DESCRIPTION' => strip_tags($array['products_short_description']),

                                    // EOF - Christian - 2009-06-26 - strip tags... ignore HTML Formating

                                    'PRODUCTS_SHORT_DESCRIPTION' => $array['products_short_description'],
                                    'PRODUCTS_FSK18' => $array['products_fsk18']);         

            }

            function productImage($name, $type) {

                switch ($type) {
                            case 'info' :
                                    $path = DIR_WS_INFO_IMAGES;
                                    break;
                            case 'thumbnail' :
                                    $path = DIR_WS_THUMBNAIL_IMAGES;
                                    break;
                            case 'popup' :
                                    $path = DIR_WS_POPUP_IMAGES;
                                    break;
                    }

                    if ($name == '') {
    // BOF - Tomcraft - 2009-11-12 - noimage.gif is displayed, when no image is defined
                            //if ($this->useStandardImage == 'true' && $this->standardImage != '') // comment in when "noimage.gif" should be displayed when there is no image defined in the database
                            //      return $path.$this->standardImage; // comment in when "noimage.gif" should be displayed when there is no image defined in the database
                            return $name; // comment out when "noimage.gif" should be displayed when there is no image defined in the database
    // EOF - Tomcraft - 2009-11-12 - noimage.gif is displayed, when no image is defined
                    } else {
                            // check if image exists
                            if (!file_exists($path.$name)) {
                                    if ($this->useStandardImage == 'true' && $this->standardImage != '')
                                            $name = $this->standardImage;
                            }
                            return $path.$name;
                    }
            }

    }
    ?>
     
    Jetzt hab ich auch die DataArray gefunden, in Zeile 381 ich Depp!

    Und auch der Fehler ist jetzt offensichlich... S*** wenn man einfach nur kopiert und nicht weiter darüber nachdenkt.

    Danke GTB, Du hast mir sehr weiter geholfen...

    GTB

    • modified Team
    • Gravatar
    • Beiträge: 6.306
    • Geschlecht:
    Eigene Beschreibungen für CrossSelling
    Antwort #10 am: 01. September 2010, 11:38:00
    hmmm, schein alles korrekt zu sein.

    OK, entferne mal aus deiner /includes/modules/cross_selling.php diese Zeilen:

    Code: PHP  [Auswählen]
        $info_smarty->assign('PRODUCTS_CROSS_DESCRIPTION', stripslashes($product->data['products_cross_description']));
     
    diese ist nicht notwendig !!!

    und dann rufe im Template die Variable SO auf:  {$products_data.PRODUCTS_DESCRIPTION_CROSS}

    webtre

    • Neu im Forum
    • Beiträge: 39
    Eigene Beschreibungen für CrossSelling
    Antwort #11 am: 01. September 2010, 11:44:04
    hmmm, schein alles korrekt zu sein.

    OK, entferne mal aus deiner /includes/modules/cross_selling.php diese Zeilen:

    Code: PHP  [Auswählen]
        $info_smarty->assign('PRODUCTS_CROSS_DESCRIPTION', stripslashes($product->data['products_cross_description']));
     
    diese ist nicht notwendig !!!

    und dann rufe im Template die Variable SO auf:  {$products_data.PRODUCTS_DESCRIPTION_CROSS}

    Ja, genau das ist mir auch gerade aufgefallen. Vielen Dank für deine Hilfe. Ich werd das Ganze jetzt nochmal in als Reinkopie anlegen und dann in die Modulecke packen, wenn dies gewünscht ist.

    BigTHX, webTre

    11 Antworten
    4642 Aufrufe
    16. August 2013, 12:39:55 von Sohnemann
    4 Antworten
    3276 Aufrufe
    01. April 2014, 15:02:56 von dannyjung
    0 Antworten
    1650 Aufrufe
    04. Dezember 2012, 19:05:46 von Hannibal
    3 Antworten
    2280 Aufrufe
    23. September 2012, 13:44:29 von Modulfux
               
    anything