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: MODUL: Attribute und Mengeneingabe in product_listing

    Modulfux

    • Experte
    • Beiträge: 3.590
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #15 am: 09. Juni 2012, 01:56:40
    Also in der includes/classes/product.php (Shopsystem modified eCommerce Shopsoftwareod 1.05 SP1b) findest du ab Zeile 75 die Funktion getAttributesCount() und in Zeile 77 steht auch der WHERE-Part, den du suchst.

    Gruß
    Ronny

    d2m

    • B
    • Mitglied
    • Beiträge: 219
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #16 am: 09. Juni 2012, 02:01:40
    Hallo Ronny, vielen Dank! Ich habe in der Datei includes/classes/product.php (Shopsystem modified eCommerce Shopsoftwareod 1.05 SP1b) ab Zeile 75 die Funktion getAttributesCount() die Funktion angepasst wie beschrieben. Als nächstes kommt
    Code: PHP  [Auswählen]
    SUCHEN:
    where patrib.products_id=".$this->pID."

    ERSETZEN:
    where patrib.products_id=".$pID."

    Ich habe jedoch in Zeile 77 eine leere Zeile und der darunter folgende Part ist dieser
    Code: PHP  [Auswählen]
    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'];
            }

    d2m

    • B
    • Mitglied
    • Beiträge: 219
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #17 am: 09. Juni 2012, 10:00:13
    Edit: ich habe mir die Originaldatei nochmal aus der .zip entpackt und geöffnet. Ich habe den Abschnitt gefunden. DANKE für die Angabe der Zeilen!

    Edit: soweit habe ich Part 1 der Anleitung folgen können, habe die Datei gerade mehrmals durchgeschaut aber ich kann den Bereich
    Code: PHP  [Auswählen]
    $productData = array (
    nicht finden oO In welcher Zeile verbirgt sich dieser?

    Ich habe das trotzdem alles mal hochgeladen und weil natürlich ein Part fehlt bekomme ich nun eine Fehlermeldung:

    Code: PHP  [Auswählen]
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /mnt/webg/d2/01/52884201/htdocs/sarah-rattmann/tee/includes/classes/product.php on line 448

    web0null

    • Experte
    • Beiträge: 1.998
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #18 am: 09. Juni 2012, 12:09:41
    Poste mal deine Datei.

    d2m

    • B
    • Mitglied
    • Beiträge: 219
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #19 am: 09. Juni 2012, 12:10:42
    Okay, hier nun der Inhalt meiner includes/classes/product.php

    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';
    // BOF - DokuMan - 2010-03-12 - bugfix, wrong comparison
                    //if ($pID = 0) {
                    if ($pID == 0) {
    // EOF - DokuMan - 2010-03-12 - bugfix, wrong comparison
                            $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($pID = 0) {
        if ($pID == 0){$pID = $this->pID;}

                    $products_attributes_query = xtDBquery("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 = 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 ";
                    }

                    // BOF - vr - 2010-04-21 make sql human readable, update to SQL-92-Standard
                    $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_short_description
                                                    from "
    .TABLE_ORDERS_PRODUCTS." op1
                                                    join "
    .TABLE_ORDERS_PRODUCTS." op2 on op2.orders_id = op1.orders_id
                                                    join "
    .TABLE_ORDERS." o on o.orders_id = op2.orders_id
                                                    join "
    .TABLE_PRODUCTS." p on p.products_id = op2.products_id
                                                    join "
    .TABLE_PRODUCTS_DESCRIPTION." pd on pd.products_id = op2.products_id
                                                    where op1.products_id = '"
    .$this->pID."'
                                                    and op2.products_id != '"
    .$this->pID."'
                                                    and p.products_status = '1'
                                                    and pd.language_id = '"
    .(int) $_SESSION['languages_id']."'
                                                    "
    .$group_check."
                                                    "
    .$fsk_lock."
                                                    group by p.products_id
                                                    order by o.date_purchased desc
                                                    limit "
    .MAX_DISPLAY_ALSO_PURCHASED;
                    // EOF - vr - 2010-04-21 make sql human readable
                    $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,
                                                                                                                                                                                                                                                     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,
                                                                                                                                                                                     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"
    );

            $cross_sell_data = array(); //DokuMan - 2010-03-12 - set undefined array

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

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


                    return $cross_sell_data;
                   
                   
                   
             }
           

            function getGraduated() {
                    global $xtPrice;
                   
                    $discount = $xtPrice->xtcCheckDiscount($this->pID);     // Hetfield - 2010-03-15 - BUGFIX show VPE with discount for graduated prices  
                    $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 ++) {
                            //BOF - web28 - 2010-07-13 - BUGFIX display same quantity only once for graduated prices / FIX max value info for graduated prices
                            /*
                            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);
                            }
                            */

                if ($staffel[$i]['stk'] == 1 || $staffel[$i +1]['stk'] != ''){
                    $quantity = $staffel[$i]['stk'];
                    if ($staffel[$i +1]['stk'] != '' && $staffel[$i +1]['stk'] != $staffel[$i]['stk'] + 1)
                        $quantity .= ' - '. ($staffel[$i +1]['stk'] - 1);
                } else {
                    $quantity = GRADUATED_PRICE_MAX_VALUE.' '.$staffel[$i]['stk'];
                }
                //EOF - web28 - 2010-07-13 - BUGFIX display same quantity only once for graduated prices    /FIX max value info for graduated prices               
                            $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);

                            $buy_now = ''; //DokuMan: Undefined variable: buy_now

                            if ($_SESSION['customers_status']['customers_status_show_price'] != '0') {
            if ($_SESSION['customers_status']['customers_fsk18'] == '1') {
              if (isset($array['products_fsk18']) && $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']);
            }
                            }
                           

          //BOF - DokuMan - 2010-02-26 - Set Undefined index: products_shippingtime
                            //$shipping_status_name = $main->getShippingStatusName($array['products_shippingtime']);
                            //$shipping_status_image = $main->getShippingStatusImage($array['products_shippingtime']);
            if (isset($array['products_shippingtime'])) {
                $shipping_status_name = $main->getShippingStatusName($array['products_shippingtime']);
                $shipping_status_image = $main->getShippingStatusImage($array['products_shippingtime']);
            } else {
                $shipping_status_name = '';
                $shipping_status_image = '';
            }
          //EOF - DokuMan - 2010-02-26 - Set Undefined index: 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' => isset($array['products_description']) ? $array['products_description'] : '', //DokuMan - 2010-02-26 - set Undefined index
           
            //BOF - Tomcraft - 2010-07-15 - Added PRODUCTS_QUANTITY for further use in template
            'PRODUCTS_QUANTITY' => isset($array['products_quantity']) ? $array['products_quantity'] : '',
                            //Tomcraft - 2010-07-15 - Added PRODUCTS_QUANTITY for further use in template
                    'PRODUCTS_ADD_CART_BUTTON' => xtc_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART),
                                              'PRODUCT_ATTRIBUTES' => $attributes,
                              'FORM_ACTION' => xtc_draw_form('cart_quantity',xtc_href_link(FILENAME_PRODUCT_INFO, xtc_get_all_get_params(array ('action')).'action=add_product')),
                              'FORM_END' => '</form>',
                              'ADD_QTY'=> xtc_draw_input_field('products_qty', '1', 'size="3"').' '.xtc_draw_hidden_field('products_id', $array['products_id'])            
                                    //'PRODUCTS_EXPIRES' => $array['expires_date'],
            'PRODUCTS_EXPIRES' => isset($array['expires_date']) ? $array['expires_date'] : 0, //DokuMan - 2010-02-26 - set Undefined index

                                    //'PRODUCTS_CATEGORY_URL'=>$array['cat_url'],
            'PRODUCTS_CATEGORY_URL' => isset($array['cat_url']) ? $array['cat_url'] : '', //DokuMan - 2010-02-26 - set Undefined index
                                   
                                    //'PRODUCTS_SHORT_DESCRIPTION' => $array['products_short_description'],
                                    'PRODUCTS_SHORT_DESCRIPTION' => isset($array['products_short_description']) ? $array['products_short_description'] : '', //DokuMan - 2010-02-26 - set Undefined index

                                    //'PRODUCTS_FSK18' => $array['products_fsk18']);
                                    'PRODUCTS_FSK18' => isset($array['products_fsk18']) ? $array['products_fsk18'] : 0, //DokuMan - 2010-02-26 - set Undefined index
            );

            }
           

            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;
                    }

                    // BOF - vr - 2010-04-09 no distinction between "name is null" and "name == ''"
                    // if ($name == '')) {
                    if (empty($name)) {
                    // EOF - vr - 2010-04-09 no distinction between "name is null" and "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;
                    }
            }
           
    }
    ?>
     

    web0null

    • Experte
    • Beiträge: 1.998
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #20 am: 09. Juni 2012, 13:01:50
    Bei dir heißt es, "return array ("    (da es eine 1.5 ohne sp ist)

    Hier ist die fertig angepasste Datei:

    Edit: Code habe ich wieder entfernt, da weiter unten (Beitrag #23) ein neuer ist.

    d2m

    • B
    • Mitglied
    • Beiträge: 219
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #21 am: 09. Juni 2012, 13:02:43
    Vielen herzlichen Dank, ich werde es gleich ausprobieren.

    d2m

    • B
    • Mitglied
    • Beiträge: 219
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #22 am: 09. Juni 2012, 13:10:29
    Nach der Anleitung bekomme ich dann wenn alles hochgeladen ist den Fehler:

    Code: PHP  [Auswählen]
    1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' and patrib.options_id = popt.products_options_id and popt.language_id = '2'' at line 1

    select count(*) as total from products_options popt, products_attributes patrib where patrib.products_id=7'
    and patrib.options_id = popt.products_options_id and popt.language_id = '2'

    [XT SQL Error]

    web0null

    • Experte
    • Beiträge: 1.998
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #23 am: 09. Juni 2012, 13:21:10
    Probiere das:

    [code=php]
    <?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 Forenregeln 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';
    // BOF - DokuMan - 2010-03-12 - bugfix, wrong comparison
                    //if ($pID = 0) {
                    if ($pID == 0) {
    // EOF - DokuMan - 2010-03-12 - bugfix, wrong comparison
                            $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($pID = 0) {
                if ($pID == 0){$pID = $this->pID;}
                $products_attributes_query = xtDBquery("
                                        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 = 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,
                                                                    &n

    d2m

    • B
    • Mitglied
    • Beiträge: 219
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #24 am: 09. Juni 2012, 13:56:14
    Vielen Dank, ich werde jetzt erst einmal die ganzen Produkte in den Shop einpflegen, dann eine Datenbanksicherung machen und dann werde ich es erneut probieren. Gebe dann Feedback.

    d2m

    • B
    • Mitglied
    • Beiträge: 219
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #25 am: 10. Juni 2012, 20:39:15
    Ich habe es nun ausprobiert, aber es änderte sich gar nichts oO

    EDIT 1: es funktioniert ... vielen Dank. Genau so soll es aussehen! Jedoch wird diese Option (So nenne ich das jetzt mal) nicht auf der Startseite bei "Neue Artikel" gezeigt, welche Einstellung muss ich tätigen, damit dies dort auch gezeigt wird?

    EDIT 2: Jetzt gibt es ein anderes Problem, wenn ich nun wähle beispielsweise Menge 100g und den Preis dazu von 3,40€ (ich lege das in den Warenkorb), rechnet der den Grundpreis von 50g (also der Preis, der direkt beim Artikel eingefügt wurde) + den Betrag von 100g ...  Ist ja quatsch wenn der den Grundpreis bezahlt und dann darauf noch den eigentlichen Warenwert für die gewünschte Menge.

    Unter "Attribute Editieren: " habe ich ganz rechts die Möglichkeit "Präfix Preis" einzustellen mit entweder einem + oder einem -. Ich möchte einfach nur den richtigen Preis dort stehen haben, ohne dass addiert oder dividiert wird (es sei denn im Warenkorb wenn man mehrere Artikel hat natürlich).

    Jetzt habe ich überlegt, unzwar könnte ich ja den Preis direkt im Artikel entfernen und dann in der product_listing_v1.html den Bereich <p class="price">-hier steht der Wert-</p> entfernen. Dann habe ich ja nur noch die Arttribute mit den Mengen und dann kann ich ja unter  "Attribute Editieren: " den "Präfix Preis" auf + stellen. So würde der Shop automatisch nur den Preis zählen der in der Menge ausgewählt wurde ... ABER geht das auch einfacher ?

    web0null

    • Experte
    • Beiträge: 1.998
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #26 am: 10. Juni 2012, 22:56:11
    Zitat
    Jedoch wird diese Option (So nenne ich das jetzt mal) nicht auf der Startseite bei "Neue Artikel" gezeigt
    Siehe Beitrag 12, da habe ich das was unser "Gradler" ergänzt hat, mit in die Anleitung aufgenommen.

    Zu deinem Edit2, durch meine Anpassung ändert sich nichts am Attribut-System das ist teil des Systems.

    Bei den Attributen musst du immer nur den Aufschlag eingeben, ohne Grundpreis.

    d2m

    • B
    • Mitglied
    • Beiträge: 219
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #27 am: 10. Juni 2012, 23:06:37
    Das habe ich mir schon fast gedacht ... bin gerade am entfernen der Grundpreise :(
    Nun steht bei mir "ab 0,00 EUR", dies ergibt sich nun natürlich dadurch das ja wegen der Attribute kein Grundpreis mehr angegeben ist. Dies sieht aber für den Kunde blöd aus finde ich ... ich würde dieses ja einfach ausblenden:
    Zitat
    Jetzt habe ich überlegt, unzwar könnte ich ja den Preis direkt im Artikel entfernen und dann in der product_listing_v1.html den Bereich <p class="price">-hier steht der Wert-</p> entfernen. Dann in der product_info_v1.html den Bereich <p class="productprice"><strong>{$PRODUCTS_PRICE}</strong></p> noch entfernen.

    Aber: ich habe auch Artikel wo keine Attribute benutzt werden, sondern auch einfache Sachen mit einem Grundpreis. Wenn ich nun das ganze aber ausblende, wird natürlich wieder der Grundpreis bei den anderen Artikeln ohne Attribute nicht gezeigt. Hätte da jemand ein Tipp für mich?

    VIelen Dank.

    d2m

    • B
    • Mitglied
    • Beiträge: 219
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #28 am: 12. Juni 2012, 15:42:49
    So wird's auch auf der Startseite angezeigt:

    (3.) root\templates\xtc5\module\new_products_default.html

    SUCHEN:

    Code: PHP  [Auswählen]
    {foreach name=aussen item=module_data from=$module_content}

    ERSETZEN MIT:

    Code: PHP  [Auswählen]
    {foreach name=aussen item=module_data from=$module_content}
    {$module_data.FORM_ACTION}

    SUCHEN:

    Code: PHP  [Auswählen]
    <p>{$module_data.PRODUCTS_BUTTON_BUY_NOW}&nbsp;<a href="{$module_data.PRODUCTS_LINK}"><img src="{$tpl_path}buttons/{$language}/button_product_more.gif" alt="Details" border="0" /></a></p>

    ERSETZEN MIT:

    Code: PHP  [Auswählen]
    <!-- <p>{$module_data.PRODUCTS_BUTTON_BUY_NOW}&nbsp;<a href="{$module_data.PRODUCTS_LINK}"><img src="{$tpl_path}buttons/{$language}/button_product_more.gif" alt="Details" border="0" /></a></p> -->

    SUCHEN:

    Code: PHP  [Auswählen]
    </table>
    <div class="hrproductpreview"></div>
    {/foreach}

    ERSETZEN MIT:

    Code: PHP  [Auswählen]
    <tr>
            <td></td>
            <td>{$module_data.PRODUCT_ATTRIBUTES}</td>
        </tr>
        <tr>
            <td></td>
            <td>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>{$module_data.ADD_QTY}</td>
                        <td>{$module_data.PRODUCTS_ADD_CART_BUTTON}</td>
                        <td><a href="{$module_data.PRODUCTS_LINK}"><img src="{$tpl_path}buttons/{$language}/button_product_more.gif" alt="Details" border="0" /></a></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div class="hrproductpreview"></div>
    {$module_data.FORM_END}
    {/foreach}

    Gilt die selbe Beschreibung auch bei "Oberkategorien"? Also bei jeder Kategorien werden ja dann "Weitere Unterkategorien:" anzeigt, und darunter gibt es auch einen Bereich "Neue Artikel" ..

    Gradler

    • Viel Schreiber
    • Beiträge: 2.083
    • Geschlecht:
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #29 am: 12. Juni 2012, 16:59:22
    Dann bau den Code doch auch in die beiden anderen new_products Dateien ein. Dann wirds überall angezeigt wo neue Artikel angezeigt werden.

    Gerd
    9 Antworten
    3557 Aufrufe
    21. Juni 2017, 14:59:02 von awids
    6 Antworten
    4322 Aufrufe
    22. August 2014, 15:59:00 von web0null
    5 Antworten
    3553 Aufrufe
    26. Februar 2012, 14:16:21 von jannemann
               
    anything