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

    Arnie

    • Neu im Forum
    • Beiträge: 40
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #105 am: 02. Juli 2013, 03:38:27
    Hi web0null
    Ich habe die veraenderung eingebaut, aber die probleme sind immer noch vorhanden:

    Mengeneingabe wird nicht uebernommen und Artikel mit attributen wird zur Detailseite weiter geleitet.

    Die einzige Veraenderung in dem Neuen Anhang (Attribute_in_Listing_v.1.04.1) die ich finden konnte is in der Anteitung fuer Codeaenderung der product.php:

    Code: PHP  [Auswählen]
    SUCHEN:
    function buildDataArray(&$array,$image='thumbnail') {
        global $xtPrice,$main;

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

    Habe ich etwas uebersehen???

    web0null

    • Experte
    • Beiträge: 1.998
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #106 am: 02. Juli 2013, 03:50:10
    Nein das war auch alles was ich geändert habe, geh die Anleitung nochmal ganz genau durch, irgendwo hast du unter Umständen einen Fehler gemacht.
    Deinen angaben nach ist es ja das Standard verhalten ohne dem Modul.

    Ich habe es aber selbst noch nicht mit 1.06 getestet, vielleicht kann ja jemand der es mit 1.06 getestet hat mal was dazu schreiben.

    Arnie

    • Neu im Forum
    • Beiträge: 40
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #107 am: 02. Juli 2013, 03:56:04
    Hi web0null
    Damit Mengeneingabe in der product_listing funktioniert, mussen da nicht veraenderungen in der cart_action.php durchgefuehrt werden? In diesem thema wird ueber diese Datei gesprochen ( Konfigurator.....) aber in der Anleitung fuer dieses Module finde ich nicht ueber die cart_action.php???

    web0null

    • Experte
    • Beiträge: 1.998
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #108 am: 02. Juli 2013, 03:59:11
    Nein, denn das Modul macht genau das gleiche wie eben die Detail Seite.
    Schau mal nach ob die Buttons bei dir Submit-Buttons sind oder Link-Button.
    ...ein Link wäre besser um zu helfen.

    Arnie

    • Neu im Forum
    • Beiträge: 40
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #109 am: 02. Juli 2013, 04:14:58
    Submit oder Link button??? Weiss jetzt nicht wirklich was du wissen moechtest.

    Hier ist der code in dem lisitng template:

    Code: PHP  [Auswählen]
                    <div>{$module_data.PRODUCT_ATTRIBUTES}</div>
               
                <div>{if $module_data.ADD_QTY}{$module_data.ADD_QTY}{/if}{$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>
                    </div>

    und der action part ist inerhalb der {foreach}
    Code: PHP  [Auswählen]
    {foreach name=aussen item=module_data from=$module_content}
    {$module_data.FORM_ACTION}
    .........
    {$module_data.FORM_END}
    {/foreach}
     

    Und hier meine product.php
    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: product.php 2696 2012-03-04 10:44:41Z web28 $

       modified eCommerce Shopsoftware
       http://www.modified-shop.org

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(Coding Standards); www.oscommerce.com
       (c) 2006 XT-Commerce (product.php 1316 2005-10-21)

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


    class product {

      /**
      *
      * Constructor
       *
       * @param integer $pID
       * @return product
       */

      function product($pID = 0) {
        $this->pID = (int)$pID; // DokuMan - 2010-08-28 - typecasting
       
        //set default select, using in function getAlsoPurchased, getCrossSells, getReverseCrossSells
        $this->default_select ='p.products_fsk18,
                                p.products_id,
                                p.products_price,
                                p.products_tax_class_id,
                                p.products_image,
                                p.products_quantity,
                                p.products_vpe,
                                p.products_vpe_status,
                                p.products_vpe_value,
                                p.products_model,
                                pd.products_name,
                                pd.products_short_description'
    ;

        // 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." AS p
                            JOIN "
    .TABLE_PRODUCTS_DESCRIPTION." AS pd ON 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
       *
       * @return integer
       */

      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
       *
       * @return integer
       */

      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 = "
    .(int)$_SESSION['languages_id']."
                                       AND rd.reviews_text !=''
                                  "
    );
        $reviews = xtc_db_fetch_array($reviews_query, true);
        return $reviews['total'];
      }

      /**
       * getReviewsAverage
       *
       * @return array
       */

      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 = '"
    .(int)$_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']),'','','itemprop="rating"'),
                                     'TEXT' => nl2br($reviews['reviews_text']));
            if ($row == PRODUCT_REVIEWS_VIEW)
              break;
          }
        }
        return $data_reviews;
      }

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

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

      /**
       * get also purchased products related to current
       *
       * @return array
       */

      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 ".$this->default_select."
                           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 trim(pd.products_name) != ''
                            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;

        $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
       *
       * @return array
       */

      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 ".$this->default_select.",
                                   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 = "
    .(int)$_SESSION['languages_id']."
                               AND trim(pd.products_name) != ''
                               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
       *
       * @return array
       */

      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 ".$this->default_select.",
                                         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 = "
    .(int)$_SESSION['languages_id']."
                                     AND trim(pd.products_name) != ''
                                     AND p.products_status = 1
                                ORDER BY xp.sort_order asc"
    );

        $cross_sell_data = array();
        while ($xsell = xtc_db_fetch_array($cross_query, true)) {
          $cross_sell_data[] = $this->buildDataArray($xsell);
        }
        return $cross_sell_data;
      }
     

     
     

      /**
       * getGraduated
       *
       * @return array
       */

      function getGraduated() {
        global $xtPrice;




    // Shippin status / product group by Arnie ermitteln (ANFANG)
    $sql = "SELECT *
    FROM products p
    INNER JOIN shipping_status pv ON p.products_shippingtime = pv.shipping_status_id
    WHERE products_id = "
    . $this->pID . "
    AND language_id = '"
    .$_SESSION['languages_id']."'";
    $query=xtDBquery($sql);
    $query=xtc_db_fetch_array($query, true);
    $TextVPE=$query["shipping_status_name"];
    // VPE ermitteln (ENDE)

    /*
    // VPE ermitteln (ANFANG)
    $sql = "SELECT *
    FROM products p
    INNER JOIN products_vpe pv ON p.products_vpe = pv.products_vpe_id
    WHERE products_id = " . $this->pID . "
    AND language_id = '".$_SESSION['languages_id']."'";
    $query=xtDBquery($sql);
    $query=xtc_db_fetch_array($query, true);
    $TextVPE=$query["products_vpe_name"];
    // VPE ermitteln (ENDE)
    */



        $discount = $xtPrice->xtcCheckDiscount($this->pID);
        $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 || (array_key_exists($i +1, $staffel) && $staffel[$i +1]['stk'] != '')){ //DokuMan - 2010-10-13 - added array_key_exists()
            $quantity = $staffel[$i]['stk'];
            if (array_key_exists($i + 1, $staffel) && $staffel[$i +1]['stk'] != '' && $staffel[$i +1]['stk'] != $staffel[$i]['stk'] + 1) //DokuMan - 2010-10-13 - added array_key_exists()
              $quantity .= ' - '. ($staffel[$i +1]['stk'] - 1);
          } else {
            $quantity = GRADUATED_PRICE_MAX_VALUE.' '.$staffel[$i]['stk'];
          }
         $vpe = '';
         if (isset($this->data) && $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']);
          }
     /* dies ersetzen fuer staffelpreise richtig anzeigen
     
                     $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']));
    */

    // dies einfuegen
    $staffel_data[$i] = array ('UNIT'=>$TextVPE, '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
       *
       * @return boolean
       */

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

      /**
       * getBuyNowButton
       *
       * @param integer $id
       * @param string $name
       * @return string
       * changes for alkimmedia Artikel Filter
       */

      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 ('page', 'products_sorter', 'products_sortdirection', 'perpage_selector', 'display_selector', 'minimumPrice', 'maximumPrice', 'callfrom', 'filters', 'maxPerPage', 'display_type', 'action')), 'NONSSL').'">'.xtc_image_button('button_buy_now.gif', TEXT_BUY.$name.TEXT_NOW).'</a>';
      }

      /**
       * getVPEtext
       *
       * @param unknown_type $product
       * @param unknown_type $price
       * @return unknown
       */

      function getVPEtext($product, $price) {
        global $main;
        return $main->getVPEtext($product, $price); //change to main class
      }

      /**
       * buildDataArray
       *
       * @param array $array
       * @return array
       */


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

        //get tax rate
        $tax_rate = isset($xtPrice->TAX[$array['products_tax_class_id']]) ? $xtPrice->TAX[$array['products_tax_class_id']] : 0; //DokuMan: set Undefined index

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

        //create buy now button
        $buy_now = '';
           
        $add_qty = '';
        if ($_SESSION['customers_status']['customers_status_show_price'] != '0' && defined('SHOW_BUTTON_BUY_NOW') && SHOW_BUTTON_BUY_NOW != 'false') {
          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']);
                     
              $add_qty = xtc_draw_input_field('products_qty', '1', 'size="3"').' '.xtc_draw_hidden_field('products_id', $array['products_id']);
            }
          } else {
            $buy_now = $this->getBuyNowButton($array['products_id'], $array['products_name']);
                    $add_qty = xtc_draw_input_field('products_qty', '1', 'size="3"').' '.xtc_draw_hidden_field('products_id', $array['products_id']);
          }
        }

    // mindesbestellmenge
    $min_qty = 1;
    $min_qty_text = '';
    if($array['products_min_quantity'] != 0) {
            $min_qty = $array['products_min_quantity'];
            $min_qty_text = TEXT_PRODUCTS_MIN_QTY.'&nbsp;'.$min_qty.'&nbsp;'.xtc_get_vpe_name($array['products_min_quantity_value']);
                    }
    // mindesbestellmenge eof


        //get $shipping_status_name, $shipping_status_image
        if (isset($array['products_shippingtime']) && ACTIVATE_SHIPPING_STATUS == 'true') {
          $shipping_status_name = $main->getShippingStatusName($array['products_shippingtime']);
          $shipping_status_image = $main->getShippingStatusImage($array['products_shippingtime']);
        } else {
          $shipping_status_name = '';
          $shipping_status_image = '';
        }
     
     
                    //ANFANG Erweiterung zur Anzeige von Staffelpreisen auch auf der Produkt-Übersichts-Seite (product_listing)
                    $staffelda = $_SESSION['customers_status']['customers_status_graduated_prices'];
                    $products_rabatt= $xtPrice->xtcCheckDiscount($array['products_id']);
                    $staffel_query = xtDBquery("SELECT quantity, personal_offer
                                               FROM "
    .TABLE_PERSONAL_OFFERS_BY.(int) $_SESSION['customers_status']['customers_status_id']."
                                               WHERE products_id = '"
    .$array['products_id']."'
                                               ORDER BY quantity ASC"
    );
                    $land=$_SESSION['currency'];
                    $waehrung_query = xtDBquery("select value FROM ".TABLE_CURRENCIES." where code = '" . $land. "'");
                    while($waehrung = @mysql_fetch_array($waehrung_query, MYSQL_ASSOC))
                    $faktor = $waehrung['value'];
                    $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 = ' ab '.$staffel[$i]['stk'];
                                    if ($staffel[$i +1]['stk'] != '')
                                            $quantity = $staffel[$i]['stk'].'-'. ($staffel[$i +1]['stk'] - 1);
                            }
                            $vpe = '';
                            if ($product_info['products_vpe_status'] == 1 && $product_info['products_vpe_value'] != 0.0 && $staffel[$i]['price'] > 0) {
                                    $vpe = $staffel[$i]['price'] - $staffel[$i]['price'] / 100 * $discount;
                                    $vpe = $vpe * (1 / $product_info['products_vpe_value']);
                                    $vpe = $xtPrice->xtcFormat($vpe, true, $product_info['products_tax_class_id']).TXT_PER.xtc_get_vpe_name($product_info['products_vpe']);
                            }
                            if ($_SESSION['customers_status']['customers_status_show_price_tax'] != 0) {
                                    $staffel_data[$i] = array ('RABATT' => $products_rabatt,'QUANTITY' => $quantity, 'VPE' => $vpe, 'PRICE' => $xtPrice->xtcFormat($staffel[$i]['price'] * $faktor  - $staffel[$i]['price'] * $faktor / 100 * $products_rabatt, + $staffel[$i]['price'] * $faktor / 100 * $tax_rate  , true, $this->data['products_tax_class_id']));
                            }else{
                                    $staffel_data[$i] = array ('QUANTITY' => $quantity, 'VPE' => $vpe, 'PRICE' => $xtPrice->xtcFormat($staffel[$i]['price'] * $faktor + $price  - $staffel[$i]['price'] * $faktor / 100 * $products_rabatt, true, $this->data['products_tax_class_id']));
                            }
                    }
                    //ENDE Erweiterung zur Anzeige von Staffelpreisen auch auf der Produkt-Übersichts-Seite (product_listing)
     
                    // Check for Specials
                    $special_status_query = xtDBquery("SELECT status, products_id
                            FROM "
    . TABLE_SPECIALS . " WHERE products_id = '".$array['products_id']."'");
                            $special_status = xtc_db_fetch_array($special_status_query, true);

      // Get manufacturer name etc. for the product page
      $manufacturers_query = xtc_db_query("SELECT m.manufacturers_id,
                                                 m.manufacturers_name,
                                                 m.manufacturers_image,
                                                 mi.manufacturers_url
                                            FROM "
    . TABLE_MANUFACTURERS . " m
                                       LEFT JOIN "
    . TABLE_MANUFACTURERS_INFO . " mi
                                              ON (m.manufacturers_id = mi.manufacturers_id
                                             AND mi.languages_id = '"
    . (int)$_SESSION['languages_id'] . "'),
                                                 "
    . TABLE_PRODUCTS . " p
                                           WHERE p.products_id = '"
    . $array['products_id'] . "'
                                             AND p.manufacturers_id = m.manufacturers_id"
    );
      $manufacturers = xtc_db_fetch_array($manufacturers_query, true);

                            $min_qty = 1;
                            $min_qty_text = '';
                            if($array['products_min_quantity'] != 0) {
                                    $min_qty = $array['products_min_quantity'];
                                    $min_qty_text = TEXT_PRODUCTS_MIN_QTY.$min_qty.'&nbsp;'.xtc_get_vpe_name($array['products_min_quantity_value']);
                            }
     
     
     
       
        //get products image, imageinfo array
        $products_image = $this->productImage($array['products_image'], $image);    
        $p_img = substr($products_image,strlen(DIR_WS_BASE)); //web28 - 2011-01-24 - FIX DIR_WS_BASE
        $img_attr = '';
        if (file_exists($p_img)) {
          list($width, $height, $type, $img_attr) = getimagesize($p_img);
        }

        //products data array
        // für Attributes in Listing
        if ($this->getAttributesCount($array['products_id']) > 0) {
            $options_template = xtDBquery("SELECT options_template FROM ".TABLE_PRODUCTS." WHERE products_id =".$array['products_id']);
            $options_template = xtc_db_fetch_array($options_template);
            $array['options_template'] = $options_template['options_template'];
            require_once (DIR_FS_INC.'xtc_get_vpe_name.inc.php');
            include (DIR_WS_MODULES.'product_attributes_listing.php');
            $attributes  = $module;
        }
        // für Attributes in Listing
        $productData = array ('PRODUCTS_NAME' => $array['products_name'],
                              'COUNT' => isset($array['ID']) ? $array['ID'] : 0,
                                                      'STAFFELDA'=> $staffelda, //Erweiterung zur Anzeige von Staffelpreisen auch auf der Produkt-Übersichts-Seite (product_listing)
                              'PRODUCTS_ID'=> $array['products_id'],
    // Eingabemenge in productlisting
                                                      'FORM_ACTION' => xtc_href_link(FILENAME_DEFAULT, xtc_get_all_get_params(array('action')) . 'action=add_product'),
                                              'ADD_QTY'     => xtc_draw_input_field('products_qty', $min_qty,'size="1"') . ' ' . xtc_draw_hidden_field('products_id', $array['products_id']),
    //Eingabemenge in productlisting END
                              'PRODUCTS_MODEL'=> isset($array['products_model']) ? $array['products_model'] : '',
                                                      'PRODUCTS_VPE_VALUE'=> isset($array['products_vpe_value']) ? $array['products_vpe_value'] : '',
                              'PRODUCTS_EAN', isset($array['products_ean']) ? $array['products_ean'] : '',
                              'PRODUCTS_MANUFACTURERS_MODEL', isset($array['products_manufacturers_model']) ? $array['products_manufacturers_model'] : '',
                              'PRODUCTS_VPE' => $main->getVPEtext($array, $products_price['plain']),
                              'PRODUCTS_IMAGE' => $products_image,
                              'PRODUCTS_IMAGE_SIZE' => $img_attr,
                              'PRODUCTS_IMAGE_TITLE' => str_replace('"','',$array['products_name']),
                              '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' => isset($array['products_description']) ? $array['products_description'] : '', //DokuMan - 2010-02-26 - set Undefined index
                              'PRODUCTS_QUANTITY' => isset($array['products_quantity']) ? $array['products_quantity'] : '',
                                                      'PRODUCT_ATTRIBUTES' => $attributes,
                              'FORM_ACTION' => xtc_draw_form('cart_quantity',xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array ('action')).'action=add_product')),
                              'FORM_END' => '</form>',
                              'ADD_QTY'=> $add_qty,
                              'PRODUCTS_EXPIRES' => isset($array['expires_date']) ? $array['expires_date'] : 0, //DokuMan - 2010-02-26 - set Undefined index
                              'PRODUCTS_CATEGORY_URL' => isset($array['cat_url']) ? $array['cat_url'] : '', //DokuMan - 2010-02-26 - set Undefined index
                              'PRODUCTS_SHORT_DESCRIPTION' => isset($array['products_short_description']) ? $array['products_short_description'] : '', //DokuMan - 2010-02-26 - set Undefined index
                              'PRODUCTS_FSK18' => isset($array['products_fsk18']) ? $array['products_fsk18'] : 0, //DokuMan - 2010-02-26 - set Undefined index
                                                      'PRODUCTS_MIN_QTY' => $min_qty_text,  //mindestbestellmenge
                                      'MAN_NAME' => $manufacturers['manufacturers_name'],
                                              'MAN_IMAGE'=> DIR_WS_IMAGES.$manufacturers['manufacturers_image'],
                                                      'STAFFELUNG'=> $staffel_data, // Erweiterung zur Anzeige von Staffelpreisen auch auf der Produkt-Übersichts-Seite (product_listing)
                                                      'SPECIAL_STATUS' => $special_status['status'],
                              'PRODUCTS_BUTTON_DETAILS' => '<a href="'.xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($array['products_id'], $array['products_name'])).'">'.xtc_image_button('button_product_more.gif', $array['products_name'].TEXT_NOW).'</a>' //GTB - 2010-08-27 make Button Details global
                             );

        return $productData;
      }

      /**
       * productImage
       *
       * @param string $name
       * @param string $type
       * @return string
       */

      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 (empty($name)) { // 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 #110 am: 02. Juli 2013, 04:24:01
    Also bitte, es ist genau so wie ich vermutet habe, du hast eben nicht das gemacht was in der Anleitung steht.
    Mach doch einfach das was in der Anleitung steht genau durch, dann wirst du sehen wie alles geht.
    Und merke dir bitte für die Zukunft, wenn du du einfach Code-Zeilen weg lässt wirst du nie Erfolg haben!!

    Arnie

    • Neu im Forum
    • Beiträge: 40
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #111 am: 02. Juli 2013, 05:34:47
    OK OK OK du hast ja recht!!!  :sorry:

    Habe es nochmal von ganz anfang an eingebaut und es funktioniert in Shop version 1.0.6.
    Die includes/classes/product.php sieht ein wenig anders aus also hier die Anleitung fuer die shopversion v1.0.6:

    Suche ca. Zeile 80:
    Code: PHP  [Auswählen]
      /**
       * Query for attributes count
       *
       * @return integer
       */

      function getAttributesCount() {
     

    Ersetze durch:
    Code: PHP  [Auswählen]
     /**
       * Query for attributes count
       *
       * @return integer
       */

    function getAttributesCount($pID = 0) {
        if ($pID == 0){$pID = $this->pID;}
     

    Suche ca. Zeile 400:
    Code: PHP  [Auswählen]
     /**
       * buildDataArray
       *
       * @param array $array
       * @return array
       */

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

    Ersetze durch:
    Code: PHP  [Auswählen]
     /**
       * buildDataArray
       *
       * @param array $array
       * @return array
       */

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

    Suche ca. Zeile 400:
    Code: PHP  [Auswählen]
        //create buy now button
        $buy_now = '';
        if ($_SESSION['customers_status']['customers_status_show_price'] != '0' && defined('SHOW_BUTTON_BUY_NOW') && SHOW_BUTTON_BUY_NOW != 'false') {
          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']);
          }
        }
     

    Ersetzen durch:
    Code: PHP  [Auswählen]
        //create buy now button
        $buy_now = '';
            $add_cart_button = '';
        $add_qty = '';
        if ($_SESSION['customers_status']['customers_status_show_price'] != '0' && defined('SHOW_BUTTON_BUY_NOW') && SHOW_BUTTON_BUY_NOW != 'false') {
          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']);
                      $add_cart_button = xtc_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);
              $add_qty = xtc_draw_input_field('products_qty', '1', 'size="3"').' '.xtc_draw_hidden_field('products_id', $array['products_id']);
            }
          } else {
            $buy_now = $this->getBuyNowButton($array['products_id'], $array['products_name']);
                    $add_cart_button = xtc_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);
            $add_qty = xtc_draw_input_field('products_qty', '1', 'size="3"').' '.xtc_draw_hidden_field('products_id', $array['products_id']);
          }
        }

     

    Suche ca. Zeile 500:
    Code: PHP  [Auswählen]
        //products data array
        $productData = array ('PRODUCTS_NAME' => $array['products_name'],
     
    Ersetze durch:
    Code: PHP  [Auswählen]
        //products data array
    // für Attributes in Listing
        if ($this->getAttributesCount($array['products_id']) > 0) {
            $options_template = xtDBquery("SELECT options_template FROM ".TABLE_PRODUCTS." WHERE products_id =".$array['products_id']);
            $options_template = xtc_db_fetch_array($options_template);
            $array['options_template'] = $options_template['options_template'];
            require_once (DIR_FS_INC.'xtc_get_vpe_name.inc.php');
            include (DIR_WS_MODULES.'product_attributes_listing.php');
            $attributes  = $module;
        }
        // für Attributes in Listing
        $productData = array ('PRODUCTS_NAME' => $array['products_name'],
     

    Suche ein paar Zeilen runter:
    Code: PHP  [Auswählen]
    'PRODUCTS_QUANTITY' => isset($array['products_quantity']) ? $array['products_quantity'] : '',
     

    Danach einfuegen
    Code: PHP  [Auswählen]
    // für Attributes in Listing
                              'PRODUCTS_ADD_CART_BUTTON' => $add_cart_button,
                                              'PRODUCT_ATTRIBUTES' => $attributes,
                              'FORM_ACTION' => xtc_draw_form('cart_quantity',xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array ('action')).'action=add_product')),
                              'FORM_END' => '</form>',
                              'ADD_QTY'=> $add_qty,
                                              // für Attributes in Listing
     

    Vielen Dank web0null fuer dieses Module  :king:

    einfach112

    • Mitglied
    • Beiträge: 246
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #112 am: 20. Juli 2013, 20:22:35
    Hi ! Auch auf die Gefahr das ich mich jetzt hier noch lächerlicher mache......(obwohl ich alles 8 Seiten überflogen habe....)
    Ich bräuchte die Mengeneingabe für Varianten auf meiner Product_info Seite selber.... Bin ich da hier total falsch ? Also wenn ich es richtig verstehe gilt das hier nur für die Product_listings ? .....
    Finde aber leider nichts für die Product_info Seite selber ?

    Bin ich nur zu DUMM zum Suchen oder ist es eventuell so einfach das noch niemand danach gefragt hat ?

    MfG
    Einfach112

    einfach112

    • Mitglied
    • Beiträge: 246
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #113 am: 20. Juli 2013, 20:27:26
    Vieleicht zur Info damit man mich besser versteht.....

    Ich Verkaufe ein Kissen.
    Dieses Kissen gibt es in 3 Farben
    Rot, Gelb, Blau
    Derzeit habe ich nur einen Radiobutton auf meiner Produkt_info .... Ich kann somit nur immer eine Farbe auswählen und die Mengenanzahl. Dann gehts direkt in den Einkaufswagen.... Einfacher währe es natürlich wenn der Kunde direkt die benötigten Farben wählen kann und die dazu jeweiligen Mengen und mit einmal alles an den EKW übergeben wird.

    Darkcallen

    • Neu im Forum
    • Beiträge: 22
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #114 am: 26. Juli 2013, 10:46:58
    Hi,
    erstmal danke web0null für klasse modul.

    Habe das gleiche Problem wie kgd.
    Zitat
    Funtioniert alles super, allerdings möchte ich nicht, wenn ich die Anzahl der zu kaufenden Artikel in den Warenkorb lege in die Produktinfoseite springen. Was kann ich da tun?
    Habe das Modul dank der Anleitung Arnie im 1.06 einbauen können. Klappt auch super bis darauf dass er immer auf die Produktinfoseite springt. Auch die Lösungen aus Beitrag 56 und 60 brachten leider keinen erfolg.
    Momentan steht folgendes in meiner Produkt.php:
    Code: PHP  [Auswählen]
    'FORM_ACTION' => xtc_draw_form('cart_quantity',xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array ('action')).'action=add_product')),
                              'FORM_END' => '</form>',
    Was muss ich ändern damit wenn ein Produkt in den Warenkorb gelegt wurde, er in Produktliste bleibt?

    LG Darkcallen

    karsta.de

    • Experte
    • Beiträge: 3.059
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #115 am: 26. Juli 2013, 13:05:17
    Nun noch das aus Beitrag 61 ausführen: http://www.modified-shop.org/forum/index.php?topic=20443.msg193566#msg193566 dann sollte es korrekt funktionieren.

    Zitat
    Suche in der root\includes\classes\product.php
    Code: PHP
        function buildDataArray(&$array,$image='thumbnail') {
            global $xtPrice,$main;

    Ersetze es mit:
    Code: PHP
        function buildDataArray(&$array,$image='thumbnail') {
            global $xtPrice,$main,$PHP_SELF;

    Also bei mir funktioniert dieses Modul ohne Fehler.

    Darkcallen

    • Neu im Forum
    • Beiträge: 22
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #116 am: 26. Juli 2013, 14:18:04
    Hi,

    danke für die Schnelle Antwort. Das hatte ich schon gemacht, weil es in der Anleitung für 1.06 so steht.
    Könnte das Modul popcart ein Problem sein?
    http://www.modified-shop.org/forum/index.php?topic=2441.0

    Lg Darkcallen

    Martin79

    • Neu im Forum
    • Beiträge: 44
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #117 am: 04. September 2013, 14:53:20
    Hallo, liebe Forenmitglieder.

    Ich habe das Modul soweit eingebaut und es funktioniert auch soweit.

    Da ich das Modul erst in einem Testshop eingebaut habe und 'Suchmaschinenfreundliche URLs benutzen' auf FALSE stehen habe hat auch alles funktioniert.

    Im Liveshop gibt es aber ein Problem. Dort sind die Suchmaschinenfreundliche URLs auf TRUE.
    Wenn ich jetzt in der Produktübersicht auf 'in den Warenkorb' klicke, springt er danach auf die Product_info.

    Woran kann das liegen?

    MfG
    Martin

    Martin79

    • Neu im Forum
    • Beiträge: 44
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #118 am: 05. September 2013, 17:02:36
    Hallo,

    hat keiner einen Rat für mich? Ich weiß echt nicht mehr weiter. Habe alles nochmals nach der Anleitung eingebaut, aber keine Änderung.

    Bitte nochmals um einen Rat. Vielleicht weiß jemand woran es liegt.

    MfG
    Martin

    karsta.de

    • Experte
    • Beiträge: 3.059
    Re: MODUL: Attribute und Mengeneingabe in product_listing
    Antwort #119 am: 06. September 2013, 08:30:42
    Überprüfe mal, ob das hier bei dir korrekt in der product.php steht (Antwort #56):
    http://www.modified-shop.org/forum/index.php?topic=20443.msg193544#msg193544
    Templateshop - Eine große Auswahl an neuen und modernen Templates für die modified eCommerce Shopsoftware
    9 Antworten
    3374 Aufrufe
    21. Juni 2017, 14:59:02 von awids
    6 Antworten
    4266 Aufrufe
    22. August 2014, 15:59:00 von web0null
    5 Antworten
    3489 Aufrufe
    26. Februar 2012, 14:16:21 von jannemann
               
    anything