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: ANLEITUNG: Attribute in Warenkorb-Box

    web0null

    • Experte
    • Beiträge: 1.998
    ANLEITUNG: Attribute in Warenkorb-Box
    am: 26. September 2014, 18:13:08
    Da ich das hier schon länger habe, und gerade eine Anleitung dazu geschrieben habe,
    möchte ich euch die kleine Erweiterung zu Verfügung stellen.

    Damit werden in der Warenkorb-Box die Attribute angezeigt (Artikelmerkmale + Optionswert), siehe Bild.

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

    Es sind nur 3 Dateien anzupassen.

    Viel Spaß,
    Gruß

    [EDIT Tomcraft 29.09.2014: Modul mit neuer Anleitung aktualisiert.]

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

    Tomcraft

    • modified Team
    • Gravatar
    • Beiträge: 46.369
    • Geschlecht:
    Re: ANLEITUNG: Attribute in Warenkorb-Box
    Antwort #1 am: 27. September 2014, 13:58:18
    Danke für's Teilen! :thx:

    Grüße

    Torsten

    Webi

    • Frisch an Board
    • Beiträge: 94
    Re: ANLEITUNG: Attribute in Warenkorb-Box
    Antwort #2 am: 27. September 2014, 21:54:14
    Hallo,
    gibt es auch eine verständliche Anleitung ????

    die html Datei wurde mit Firefox 32.0.3 per Doppelklick geöffnet.

    Webi

    • Frisch an Board
    • Beiträge: 94
    Re: ANLEITUNG: Attribute in Warenkorb-Box
    Antwort #3 am: 29. September 2014, 00:02:38
    Hallo,
    gibt es auch eine verständliche Anleitung ????

    awids

    • Experte
    • Beiträge: 3.803
    • Geschlecht:
    Re: ANLEITUNG: Attribute in Warenkorb-Box
    Antwort #4 am: 29. September 2014, 00:23:05
    Die ist verständlich, als Browser-Seite aber sehr unübersichtlich.

    Vielleicht ist das ja besser fürs Verständnis:
    Code: PHP  [Auswählen]
    ##############################################################################################
    WICHTIG: !!! Sicherung anlegen !!!
    ##############################################################################################

    ##############################################################################################
    1.Datei: \templates\xtc5\source\boxes\shopping_cart.php
    ##############################################################################################
    -----------------------------------------------
    SUCHE:
    for ($i = 0, $n = $sizeof_products; $i < $n; $i++) {
      $qty += $products[$i]['quantity'];
      $products_in_cart[] = array ('QTY' => $products[$i]['quantity'],
                                   'LINK' => xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($products[$i]['id'], $products[$i]['name'])),
                                   'NAME' => $products[$i]['name']);
    }
    -----------------------------------------------
    ERSETZE:
    // [++] web0null - attributeCartBox
    // original Code
    /* for ($i = 0, $n = $sizeof_products; $i < $n; $i++) {
      $qty += $products[$i]['quantity'];
      $products_in_cart[] = array ('QTY'  => $products[$i]['quantity'],
                                   'LINK' => xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($products[$i]['id'], $products[$i]['name'])),
                                   'NAME' => $products[$i]['name']);
    }*/

    // new Code
    for ($i = 0, $n = $sizeof_products; $i < $n; $i++) {
      $qty += $products[$i]['quantity'];
      $products_in_cart[$i] = array (
        'QTY'  => $products[$i]['quantity'],
        'LINK' => xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($products[$i]['id'], $products[$i]['name'])),
        'NAME' => $products[$i]['name']
      );
      if (isset ($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
        reset($products[$i]['attributes']);
        while (list($option, $value) = each($products[$i]['attributes'])) {
          $attributes = $main->getAttributes($products[$i]['id'], $option, $value);
          if ($attributes['options_values_price'] > 0) {
            $flagCurr  = ($products[$i]['tax_class_id'] == 0); //FIX several currencies on product attributes
            $attrPrice = $xtPrice->xtcFormat($attributes['options_values_price'], true, $products[$i]['tax_class_id'], $flagCurr);
          }
          $products_in_cart[$i]['ATTRIBUTES'][] = array (
            'OPTIONS_NAME'   => $attributes['products_options_name'],
            'OPTIONS_VALUE'  => $attributes['products_options_values_name'],
            'OPTIONS_PREFIX' => $attributes['price_prefix'],
            'OPTIONS_PRICE'  => $attrPrice,
          );
        }
      }
    }
    // [--] web0null - attributeCartBox
    -----------------------------------------------


    ##############################################################################################
    2.Datei: \templates\xtc5\boxes\box_cart.html
    ##############################################################################################
    -----------------------------------------------
    SUCHE:
    {foreach name=aussen item=products_data from=$products}
            <p>{$products_data.QTY}&nbsp;x&nbsp;<a href="{$products_data.LINK}">{$products_data.NAME|truncate:20:"...":true}</a></p>
    {/foreach}
    -----------------------------------------------
    ERSETZE:
    <!-- [++] web0null - attributeCartBox -->
    <!-- original Code -->
    <!-- {foreach name=aussen item=products_data from=$products}
            <p>{$products_data.QTY}&nbsp;x&nbsp;<a href="{$products_data.LINK}">{$products_data.NAME|truncate:20:"...":true}</a></p>
    {/foreach} -->
    <!-- new Code -->
    <table>
      {foreach name=aussen item=products_data from=$products}
        <tr>
          <td style="vertical-align: top;">{$products_data.QTY}&nbsp;x</td>
          <td>
            <strong><a href="{$products_data.LINK}">{$products_data.NAME|truncate:20:"...":true}</a></strong>
            {if $products_data.ATTRIBUTES!=''}
              <table class="attributeCartBox">
                {foreach name=aussen item=attributes_data from=$products_data.ATTRIBUTES}
                  <tr>
                    <td>{$attributes_data.OPTIONS_NAME}:</td>
                    <td>
                    {$attributes_data.OPTIONS_VALUE}
                    <!-- Preis anzeige -->
                    <!-- {if $attributes_data.OPTIONS_PRICE}&nbsp;({$attributes_data.OPTIONS_PREFIX} {$attributes_data.OPTIONS_PRICE}){/if} -->
                    </td>
                  </tr>
                            {/foreach}
                    </table>
                    {/if}
                    </td>
            </tr>
            {/foreach}
    </table>
    <!-- [--] web0null - attributeCartBox -->

    -----------------------------------------------


    ##############################################################################################
    3.Datei: \templates\xtc5\stylesheet.css
    ##############################################################################################
    -----------------------------------------------
    GANZ UNTEN EINFÜGEN:
    /* [++] web0null - attributeCartBox */
    .attributeCartBox {
      line-height: 5px;
      font-size: 9px;
    }
    /* [--] web0null - attributeCartBox */

    -----------------------------------------------


    Getestet mit 1.0.6
     

    Balrem

    • Neu im Forum
    • Beiträge: 7
    • Geschlecht:
    Re: ANLEITUNG: Attribute in Warenkorb-Box
    Antwort #5 am: 29. September 2014, 07:20:13
    Echt top Code ; ) Kann ich gleich auch bei mir nutzen : )

    web0null

    • Experte
    • Beiträge: 1.998
    Re: ANLEITUNG: Attribute in Warenkorb-Box
    Antwort #6 am: 29. September 2014, 14:04:35
    Die "Anleitung" hatte nur die "falsche" Endung, bzw. war sie nicht als "Browser-Seite" gedacht.
    In dem Paket ist es umbenannt.

    [EDIT Tomcraft 29.09.2014: Modul in Beitrag 1 aktualisiert.]

    Gulliver72

    • Mitglied
    • Beiträge: 191
    • Geschlecht:
    Re: ANLEITUNG: Attribute in Warenkorb-Box
    Antwort #7 am: 09. März 2015, 17:59:44
    Vielen Dank für die Anleitung. Eingebaut ins Bootstrap Template und funzt.
    1 Antworten
    5663 Aufrufe
    22. Juli 2012, 16:54:27 von 0815
    1 Antworten
    2237 Aufrufe
    04. April 2009, 01:48:03 von Anonym
    0 Antworten
    2052 Aufrufe
    07. Juni 2012, 09:32:11 von fish
    9 Antworten
    2826 Aufrufe
    16. Februar 2019, 22:28:06 von Tante Uschi
               
    anything