вот полный пример где таблицы с выбором оплаты зависит от таблицы метода доставки, а нужно наоборот. и таблицу методов доставки тогда я вообще скрою через css.
<div class="quickcheckoutright">
<div id="shipping-method">
<div class="quickcheckout-heading"><i class="fa fa-truck"></i> Способы доставки</div>
<div class="quickcheckout-content">
<p>Выберите удобный способ доставки для данного заказа</p>
<table class="table " style="margin-bottom: 0">
<tbody>
<tr>
<td>
<input type="radio" name="shipping_method" value="free.free" id="free.free" checked="checked">
</td>
<td><label for="free.free">Бесплатная доставка</label></td>
<td style="padding:1px!important">
</td>
<td style="text-align:right;width: 22%;"><label for="free.free">0тг.</label></td>
</tr>
<tr>
<td>
<input type="radio" name="shipping_method" value="flat.flat" id="flat.flat">
</td>
<td><label for="flat.flat">Доставка наложенным платежом, казпочтой </label></td>
<td style="padding:1px!important">
</td>
<td style="text-align:right;width: 22%;"><label for="flat.flat">1000тг.</label></td>
</tr>
</tbody></table>
<input type="text" name="delivery_date" value="" class="hide">
<select name="delivery_time" class="hide"><option value=""></option></select>
<script type="text/javascript"><!--
$('#shipping-method input[name=\'shipping_method\'], #shipping-method select[name=\'shipping_method\']').on('change', function() {
if ($('#payment-address input[name=\'shipping_address\']:checked').val()) {
var post_data = $('#payment-address input[type=\'text\'], #payment-address input[type=\'checkbox\']:checked, #payment-address input[type=\'radio\']:checked, #payment-address input[type=\'hidden\'], #payment-address select, #shipping-method input[type=\'text\'], #shipping-method input[type=\'checkbox\']:checked, #shipping-method input[type=\'radio\']:checked, #shipping-method input[type=\'hidden\'], #shipping-method select, #shipping-method textarea');
} else {
var post_data = $('#shipping-address input[type=\'text\'], #shipping-address input[type=\'checkbox\']:checked, #shipping-address input[type=\'radio\']:checked, #shipping-address input[type=\'hidden\'], #shipping-address select, #shipping-method input[type=\'text\'], #shipping-method input[type=\'checkbox\']:checked, #shipping-method input[type=\'radio\']:checked, #shipping-method input[type=\'hidden\'], #shipping-method select, #shipping-method textarea');
}
$.ajax({
url: 'index.php?route=extension/quickcheckout/shipping_method/set',
type: 'post',
data: post_data,
dataType: 'html',
cache: false,
success: function(html) {
loadCart();
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
$(document).ready(function() {
$('#shipping-method input[name=\'shipping_method\']:checked, #shipping-method select[name=\'shipping_method\']').trigger('change');
});
//--></script></div>
</div>
<div id="payment-method">
<div class="quickcheckout-heading"><i class="fa fa-credit-card"></i>Способы оплаты
<p class="quickcheckout_payment_heading_delivery" style="float: right; margin: 0 0 0px; padding-right: 100px;">Доставка</p></div>
<div class="quickcheckout-content">
<p>Выберите способ оплаты для данного заказа</p>
<table class="table" style="margin-bottom:0">
<tbody><tr>
<td>
<input type="radio" name="payment_method" value="bank_transfer" class="bank_transfer" checked="checked">
</td><td class="zame"><label for="bank_transfer">Предоплата на карту Казком.</label> <p style="float: right; margin: 0 0 0px;">Бесплатная</p></td>
<td></td>
</tr>
<tr>
<td>
<input type="radio" name="payment_method" value="bank_transfer" class="bank_transfer" checked="checked">
</td><td class="zame"><label for="bank_transfer">Предоплата на баланс телефона.</label> <p style="float: right; margin: 0 0 0px;">Бесплатная</p></td>
<td></td>
</tr>
<tr>
<td>
<input type="radio" name="payment_method" value="bank_transfer" class="bank_transfer" checked="checked">
</td><td class="zame"><label for="bank_transfer">Предоплата на Киви кошелёк.</label> <p style="float: right; margin: 0 0 0px;">Бесплатная</p></td>
<td></td>
</tr>
<tr>
<td>
<input type="radio" name="payment_method" value="cod" class="cod">
</td><td class="zame"><label for="cod">Оплата наложенным платежом при получении на почте.</label> <p style="float: right; margin: 0 0 0px;">1000 тг.</p></td>
<td></td>
</tr>
</tbody>
</table>
<textarea name="survey" class="hide"></textarea>
<textarea name="comment" class="hide"></textarea>
<script type="text/javascript"><!--
$('#payment-method input[name=\'payment_method\'], #payment-method select[name=\'payment_method\']').on('change', function() {
$.ajax({
url: 'index.php?route=extension/quickcheckout/payment_method/set',
type: 'post',
data: $('#payment-address input[type=\'text\'], #payment-address input[type=\'checkbox\']:checked, #payment-address input[type=\'radio\']:checked, #payment-address input[type=\'hidden\'], #payment-address select, #payment-method input[type=\'text\'], #payment-method input[type=\'checkbox\']:checked, #payment-method input[type=\'radio\']:checked, #payment-method input[type=\'hidden\'], #payment-method select, #payment-method textarea'),
dataType: 'html',
cache: false,
success: function(html) {
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
//--></script></div>
</div>
</div>
Id заменил на класс получилось вот так