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: Auswahl Versandart und jQuery UI Accordion

    Tomcraft

    • modified Team
    • Gravatar
    • Beiträge: 46.367
    • Geschlecht:
    Hier die Erweiterung von "ANLEITUNG: Auswahl Bezahlart und jQuery UI Accordion" für die Versandarten.

    "/templates/xtc5/css/general.css.php"

    das hier einfügen:

    Code: PHP  [Auswählen]
    <?php
    if (strstr($PHP_SELF, FILENAME_CHECKOUT_SHIPPING)) {
    ?>
    <link rel="stylesheet" href="<?php echo 'templates/'.CURRENT_TEMPLATE; ?>/css/jquery-ui.css" type="text/css" media="screen" />
    <?php
    }
    ?>

    "/templates/xtc5/javascript/general.js.php"

    das hier einfügen:

    Code: PHP  [Auswählen]
    <?php
    if (strstr($PHP_SELF, FILENAME_CHECKOUT_SHIPPING)) {
    ?>
    <script src="<?php echo 'templates/'.CURRENT_TEMPLATE; ?>/javascript/jquery-ui.js" type="text/javascript"></script>
    <script type="text/javascript">
      var setChecked = function(oThis) {
        setTimeout(function(){
          $(oThis).attr("checked","checked");
        },10);
      };

      $(function() {
        $("#accordion_checkout").accordion({
          header: 'ul',
          collapsible: false ,
          autoHeight: false ,
          active: false ,
          change: function(event, ui) {
            setChecked ($("input",ui.newHeader)); }
        });
        $("#accordion_checkout ul input").css("margin-left","40px");
        $("#accordion_checkout ul input").eq(parseInt(shipping_selected)).attr("checked","checked");
        $("#accordion_checkout").accordion( "option", "active", parseInt(shipping_selected) );
      });
    </script>
    <?php } ?>

    "/checkout_shipping.php"

    suche das hier:

    Code: PHP  [Auswählen]
                                            # set the radio button to be checked if it is the method chosen
                                            $quotes[$i]['methods'][$j]['radio_buttons'] = $radio_buttons;
                                            $checked = ((isset($_SESSION['shipping']) && $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'] == $_SESSION['shipping']['id']) ? true : false);
                                            if (($checked == true) || ($n == 1 && $n2 == 1)) {
                                                    $quotes[$i]['methods'][$j]['checked'] = 1;
                                            }

    danach das hier einfügen:

    Code: PHP  [Auswählen]
              if ($quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'] == $_SESSION['shipping']['id']) {
                echo '<script type="text/javascript">var shipping_selected="' . $radio_buttons . '"</script>';
              }

    suche das hier:

    Code: PHP  [Auswählen]
                $quotes[$i]['methods'][$j]['radio_field'] = xtc_draw_radio_field('shipping', $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'], $checked, 'id="'.($i+1).'"');

    ersetze es mit dem hier:

    Code: PHP  [Auswählen]
                $quotes[$i]['methods'][$j]['radio_field'] = xtc_draw_radio_field('shipping', $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'], $checked, 'id="'.($i+1).'" onclick="setChecked(this);"');

    "/templates/xtc5/module/checkout_shipping_block.html"

    Inhalt mit dem hier ersetzen:

    Code: PHP  [Auswählen]
    {if $FREE_SHIPPING}
    <table class="shippingblock" border="0" width="100%" cellspacing="0" cellpadding="6">
            <tr>
                    <td class="header"><strong>{$FREE_SHIPPING_TITLE}</strong></td>
            </tr>
            <tr>
                    <td class="freeshipping" width="100%">{$FREE_SHIPPING_DESCRIPTION}</td>
            </tr>
    </table>
    {else}
    <div id="accordion_checkout">
      {foreach name=aussen item=module_data from=$module_content}
        {foreach name=aussen item=method_data from=$module_data.methods}
          <ul style="height:25px; padding-top:9px;">
            <li>
            <div style="float:left; width:15%">{$method_data.radio_field}</div>
            <div style="float:left; width:63%;"><b>{$module_data.module}</b></div>
            <div style="float:left; text-align:right; width:20%;">{$method_data.price}</div>
            <div style="float:left; width:2%;"> </div>
            <div style="clear:left;"></div>
            </li>
          </ul>
          <div style="clear:left;">
          {if $module_data.error}
            <div>{$module_data.error}</div>
          {else}
            <table width="100%">
              <tr>
                <td class="description">{$method_data.title}</td>
              </tr>
            </table>
          {/if}
          </div>
        {/foreach}
            {/foreach}
    </div>
    {/if}

    CSS Anweisungen sind hier direkt über "inline-styles" gemacht. Diese können natürlich auch über die "stylesheet.css" gemacht werden.

    Hier noch ein Screenshot wie es aussieht:

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

    Viel Spass damit.

    Grüße

    Torsten

    Linkback: https://www.modified-shop.org/forum/index.php?topic=33803.0
    Marktplatz - Eine große Auswahl an neuen und hilfreichen Modulen sowie modernen Templates für die modified eCommerce Shopsoftware

    ARS

    • Fördermitglied
    • Beiträge: 345
    • Geschlecht:
    Re: ANLEITUNG: Auswahl Versandart und jQuery UI Accordion
    Antwort #1 am: 20. Oktober 2015, 22:34:46
    Danke Torsten,

    funktioniert prima  :-B

    Gruss

    RSAdmin
    113 Antworten
    55743 Aufrufe
    20. Oktober 2015, 22:34:25 von Tomcraft
    18 Antworten
    1490 Aufrufe
    28. März 2023, 10:03:26 von jumpM
    1 Antworten
    3130 Aufrufe
    26. April 2011, 16:54:17 von luckybaron