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: Attribut Erweiterung neben dem Preis

    Pokalschmied

    • Neu im Forum
    • Beiträge: 38
    Attribut Erweiterung neben dem Preis
    am: 14. November 2011, 17:03:41
    Moin moin,
    ich bin auf der Suche gewesen, dem den Preis Attributen noch ein Textfeld für unterschiedliche Texte zu haben. In meinem Fall ist ein den Text: alter Preis: xxx Euro gewesen.
    Dieser wird beim Bestellvorgang nicht weiter verarbeitet, sondern nur in der Produktübersicht, neben den Attributen angezeigt.

    Ich bin kein Coder, ich kann nur bisschen PHP und HTML basteln, aber es reicht scheinbar nicht ganz. ;)

    Nun habe ich aber noch ein kleines Problem, mit der Textformatierung. Da hoffe ich, dass mir einer von Euch weiter helfen kann. Die Lösung ist sicherlich einfach, aber ich finde es nicht.

    Hier nun das Fertige Ergebnis in der Produktübersicht:

    [ Für Gäste sind keine Dateianhänge sichtbar ]

    Und hier ist nun mein Problem im Adminpanel:

    Die "size"35"> kommen aus der "new_attributes_inclues.php" und sind für den Eingabefeldgröße.
    Das ist auch das Problem was ich habe, wie bekomme ich das weg, dass es richtig dargestellt wird?

    [ Für Gäste sind keine Dateianhänge sichtbar ]

    Den Code habe ich aus dem Quelltext für die Artikel Nr. abgeleitet.

    Hier der Code der /templates/meinStyle/module/product_options/product_options_selection.html

    Zeile 6 am ende

    Code: PHP  [Auswählen]
        <td class="main" width="99%">
     
        {foreach key=key_data name=key_data item=item_data from=$options_data.DATA}
        <input type="radio" name="id[{$options_data.ID}]" value="{$item_data.ID}" {if $smarty.foreach.key_data.first}checked="checked" {/if} />
       
       {$item_data.TEXT} {if $item_data.PRICE!=''}( {$item_data.PREFIX}{$item_data.PRICE}){/if}  {$item_data.PREIS}
        <br />

    Hier der Code, aus der: /admin/products_attributes.php

    Zeile 6 am ende

    Code: PHP  [Auswählen]
    ['value_id'] . "')");
            xtc_redirect(xtc_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
            break;
          case 'add_product_attributes':
            xtc_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $_POST['products_id'] . "', '" . $_POST['options_id'] . "', '" . $_POST['values_id'] . "', '" . $_POST['value_price'] . "', '" . $_POST['price_prefix'] . "', '" . $_POST['attributes_preis'] . "')");
            $products_attributes_id = xtc_db_insert_id();

    und:

    Zeile 3 mittig

    Code: PHP  [Auswählen]
          break;
          case 'update_product_attribute':
            xtc_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . $_POST['products_id'] . "', options_id = '" . $_POST['options_id'] . "', options_values_id = '" . $_POST['values_id'] . "', options_values_price = '" . $_POST['value_price'] . "', price_prefix = '" . $_POST['price_prefix'] . "', attributes_preis = '" . $_POST['attributes_preis'] . "' where products_attributes_id = '" . $_POST['attribute_id'] . "'");
            if ((DOWNLOAD_ENABLED == 'true') && $_POST['products_attributes_filename'] != '') {
              xtc_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "

    Hier der Code aus der: /admin/includes/modules/new_attributes_change.php

    Zeile 5 und Zeile 10 mittig

    Code: PHP  [Auswählen]
        $value_prefix = $_POST[$cv_id . '_prefix'];
        $value_sortorder = $_POST[$cv_id . '_sortorder'];
        $value_weight_prefix = $_POST[$cv_id . '_weight_prefix'];
        $value_model =  $_POST[$cv_id . '_model'];
            $value_preis =  $_POST[$cv_id . '_preis'];
        $value_stock =  $_POST[$cv_id . '_stock'];
        $value_weight =  $_POST[$cv_id . '_weight'];


          xtc_db_query("INSERT INTO ".TABLE_PRODUCTS_ATTRIBUTES." (products_id, options_id, options_values_id, options_values_price, price_prefix ,attributes_model, attributes_preis, attributes_stock, options_values_weight, weight_prefix,sortorder) VALUES ('" . $_POST['current_product_id'] . "', '" . $optionsID . "', '" . $_POST['optionValues'][$i] . "', '" . $value_price . "', '" . $value_prefix . "', '" . $value_model . "', '" . $value_preis . "', '" . $value_stock . "', '" . $value_weight . "', '" . $value_weight_prefix . "','".$value_sortorder."')") or die(mysql_error());

    Und hier aus der: Hier der Code aus der: /admin/includes/modules/new_attributes_funktions.php

    Zeile 2 fast am anfang

    Code: PHP  [Auswählen]
        //BOF PRICE WEIGHT PREFIX
            global $attribute_value_price,$sortorder, $attribute_value_weight, $attribute_value_weight_prefix, $attribute_value_prefix, $attribute_value_model, $attribute_value_preis, $attribute_value_stock, $posCheck, $negCheck, $isCheck, $posCheck_weight, $negCheck_weight,$isCheck_weight, $attribute_value_download_count, $attribute_value_download_expire,$attribute_value_download_filename;
        //EOF PRICE WEIGHT PREFIX

    Zeile 7

    Code: PHP  [Auswählen]
            // download function end
            $attribute_value_price = $line['options_values_price'];
            $sortorder = $line['sortorder'];
            $attribute_value_prefix = $line['price_prefix'];
            $attribute_value_weight_prefix = $line['weight_prefix'];
            $attribute_value_model = $line['attributes_model'];
                    $attribute_value_preis = $line['attributes_preis'];
            $attribute_value_stock = $line['attributes_stock'];
            $attribute_value_weight = $line['options_values_weight'];
           
                    //BOF PRICE WEIGHT PREFIX

    Zeile 11

    Code: PHP  [Auswählen]
                    //EOF PRICE WEIGHT PREFIX              
          }
          return true;
        } else {
          $attribute_value_price = '';
          $sortorder = '';
          $attribute_value_weight = '';
          $attribute_value_prefix = '';
          $attribute_value_weight_prefix = '';
          $attribute_value_model = '';
              $attribute_value_preis = '';
          $attribute_value_stock = '';
          $posCheck = '';
          $negCheck = '';
          $posCheck_weight = '';
          $negCheck_weight = '';
              //BOF PRICE WEIGHT PREFIX    

    Und hier aus der: Hier der Code aus der: /admin/includes/modules/new_attributes_includes.php

    Zeile 8

    Code: PHP  [Auswählen]
                // Print the Current Value Name
                echo "<TR class=\"" . $rowClass . "\">";
                echo "<TD class=\"main\">";
                echo "<input type=\"checkbox\" name=\"optionValues[]\" value=\"" . $current_value_id . "\"" . $CHECKED . ">&nbsp;&nbsp;" . $current_value_name . "&nbsp;&nbsp;";
                echo "</TD>";
                echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_sortorder\" value=\"" . $sortorder . "\" size=\"4\"></TD>";
                echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_model\" value=\"" . $attribute_value_model . "\" size=\"15\"></TD>";
                            echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_preis\" value=\"" . $attribute_value_preis . "\"size=\"35\"></TD>";
                echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_stock\" value=\"" . $attribute_value_stock . "\" size=\"4\"></TD>";
                echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_weight\" value=\"" . $attribute_value_weight . "\" size=\"10\"></TD>";
                //EOF PRICE WEIGHT PREFIX
                            echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_weight_prefix\"><OPTION value=\"+\"" . $posCheck_weight . ">+<OPTION value=\"-\"" . $negCheck_weight . ">-<OPTION value=\"=\"" . $isCheck_weight . ">=</SELECT></TD>";

    Und zu guter letzt aus der: /includes/modules/product_attributes.php

    Zeile 12 und 29 mittig

    Code: PHP  [Auswählen]
            $row = 0;
            $col = 0;
            $products_options_data = array ();
            while ($products_options_name = xtc_db_fetch_array($products_options_name_query,true)) {
                    $selected = 0;
                    $products_options_array = array ();

                    $products_options_data[$row] = array ('NAME' => $products_options_name['products_options_name'], 'ID' => $products_options_name['products_options_id'], 'DATA' => '');
                    $products_options_query = xtDBquery("select pov.products_options_values_id,
                                                                     pov.products_options_values_name,
                                                                     pa.attributes_model,
                                                                                                                     pa.attributes_preis,
                                                                     pa.options_values_price,
                                                                     pa.price_prefix,
                                                                                                                     pa.options_values_weight,
                                                                     pa.attributes_stock,
                                                                     pa.attributes_model
                                                                     from "
    .TABLE_PRODUCTS_ATTRIBUTES." pa,
                                                                     "
    .TABLE_PRODUCTS_OPTIONS_VALUES." pov
                                                                     where pa.products_id = '"
    .$product->data['products_id']."'
                                                                     and pa.options_id = '"
    .$products_options_name['products_options_id']."'
                                                                     and pa.options_values_id = pov.products_options_values_id
                                                                     and pov.language_id = '"
    .(int) $_SESSION['languages_id']."'
                                                                     order by pa.sortorder"
    );
                    $col = 0;
                    while ($products_options = xtc_db_fetch_array($products_options_query,true)) {
                            $price = '';
                            if ($_SESSION['customers_status']['customers_status_show_price'] == '0') {
                                    $products_options_data[$row]['DATA'][$col] = array ('ID' => $products_options['products_options_values_id'], 'TEXT' => $products_options['products_options_values_name'], 'MODEL' => $products_options['attributes_model'], 'PREIS' => $products_options['attributes_preis'], 'PRICE' => '', 'FULL_PRICE' => '', 'PREFIX' => $products_options['price_prefix']);
                            } else {

    und Zeile 6

    Code: PHP  [Auswählen]
                                    //end xtc_mod_price_prefix
                                           
                                    $products_options_data[$row]['DATA'][$col] = array ('ID' => $products_options['products_options_values_id'],
                                                                                                                                            'TEXT' => $products_options['products_options_values_name'],
                                                                                                                                            'MODEL' => $products_options['attributes_model'],
                                                                                                                                            'PREIS' => $products_options['attributes_preis'],
                                                                                                                                            'PRICE' => $attr_info . $xtPrice->xtcFormat($price, true),
                                                                                                                                            'FULL_PRICE' => $xtPrice->xtcFormat($full, true),
                                                                                                                                            //BOF ATTR VPE
                                                                                                                                            'ATTR_VPE' => $attr_vpe,
                                                                                                                                            //EOF ATTR VPE
                                                                                                                                            'PREFIX' => $products_options['price_prefix']);
                                    //EOF PRICE PREFIX

    Ich hoffe das ganze ist nicht zu verwirrend und mir kann einer helfen.

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

    karl

    • Schreiberling
    • Beiträge: 439
    Re: Attribut Erweiterung neben dem Preis
    Antwort #1 am: 14. Dezember 2011, 15:35:30
    Hallo Pokalschmied, am Code ist soweit nichts zu sehen.

    Mache mal eine Kopie aus dem Quelltext der Seite, also so wie diese dargestellt wird. Und 1x posten.

    Idris

    • Neu im Forum
    • Beiträge: 1
    Re: Attribut Erweiterung neben dem Preis
    Antwort #2 am: 04. August 2013, 01:24:54
    Hallo Pokalschmied,

    füge doch bitte in /admin/includes/modules/new_attributes_include.php Zeile 8 zwischen den Anführungszeichen und dem size ein Leerzeichen ein. Es sollte dann so aussehen:

    Code: PHP  [Auswählen]
    echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_preis\" value=\"" . $attribute_value_preis . "\" size=\"35\"></TD>";

    Ist zumindest ein Versuch wert.

    Uuups, sehe gerade nach dem Absenden, dass der Eröffnungsbeitrag bereits zwei Jahre alt ist, peinlich... :D

    Gruß
    Idris
    2 Antworten
    2558 Aufrufe
    15. Januar 2012, 23:44:10 von Corny1804
    22 Antworten
    8271 Aufrufe
    16. November 2012, 13:02:09 von NicoDeluxe
    16 Antworten
    9495 Aufrufe
    27. Mai 2011, 19:38:29 von ShopUser
    5 Antworten
    4902 Aufrufe
    12. September 2010, 11:37:25 von Sandro
               
    anything