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:
<?phpif (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:
<?phpif (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:
# 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:
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:
$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:
$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:
{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