我希望从注册中删除送货地址或送货地址选项,opencart 2.0及以上版本的客人,但是应该有送货方式,因为我希望帐单地址是送货地址而无需额外的字段
我尝试在我的opencart checkout.tpl文件中通过这两个教程实现,但我无法在下面找到代码
$('#shipping-address .checkout-content').slideDown('slow');
任何人都可以指导这是正确的,或者对于高于2.0的OC是否有任何其他方法可以做到这一点
http://ravishwebdesigner.blogspot.in/2013/07/how-to-remove-checkout-step-2-step-3.html
http://rricketts.com/how-to-remove-disable-step-4-shipping-method-from-opencart/
答案 0 :(得分:4)
转到每个产品并将其从“是”更改为“必需的运输”。你会发现结账的两个步骤消失了。
答案 1 :(得分:2)
由于发布此内容的时间较少,有很多方法,我会改善nxt时间
转到 \ catalog \ view \ theme \ default \ template \ checkout \ checkout.tpl第373行
<?php if ($shipping_required) { ?>
$.ajax({
url: 'index.php?route=checkout/shipping_address',
dataType: 'html',
success: function(html) {
$('#collapse-shipping-address .panel-body').html(html);
$('#collapse-shipping-address').parent().find('.panel-heading .panel-title').html('<a href="#collapse-shipping-address" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"><?php echo $text_checkout_shipping_address; ?> <i class="fa fa-caret-down"></i></a>');
$('a[href=\'#collapse-shipping-address\']').trigger('click');
$('#collapse-shipping-method').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_shipping_method; ?>');
$('#collapse-payment-method').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_payment_method; ?>');
$('#collapse-checkout-confirm').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_confirm; ?>');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
<?php }
替换为
<?php if ($shipping_required) { ?>
$.ajax({
url: 'index.php?route=checkout/shipping_method',
dataType: 'html',
success: function(html) {
$('#collapse-shipping-method .panel-body').html(html);
$('#collapse-shipping-method').parent().find('.panel-heading .panel-title').html('<a href="#collapse-shipping-method" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"><?php echo $text_checkout_shipping_method; ?> <i class="fa fa-caret-down"></i></a>');
$('a[href=\'#collapse-shipping-method\']').trigger('click');
$('#collapse-shipping-method').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_shipping_method; ?>');
$('#collapse-payment-method').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_payment_method; ?>');
$('#collapse-checkout-confirm').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_confirm; ?>');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
<?php }
答案 2 :(得分:2)
转到\ catalog \ view \ theme \您的模板\ template \ checkout \ checkout.tpl
找到以下代码并对其进行评论,或者您可以将其删除
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><?php echo $text_checkout_shipping_address; ?></h4>
</div>
<div class="panel-collapse collapse" id="collapse-shipping-address">
<div class="panel-body"></div>
</div>
</div>
您将在以下两个地方找到以下代码替换它
<?php if ($shipping_required) { ?>
$.ajax({
url: 'index.php?route=checkout/shipping_address',
dataType: 'html',
success: function(html) {
$('#collapse-shipping-address .panel-body').html(html);
$('#collapse-shipping-address').parent().find('.panel-heading .panel-title').html('<a href="#collapse-shipping-address" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"><?php echo $text_checkout_shipping_address; ?> <i class="fa fa-caret-down"></i></a>');
$('a[href=\'#collapse-shipping-address\']').trigger('click');
$('#collapse-shipping-method').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_shipping_method; ?>');
$('#collapse-payment-method').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_payment_method; ?>');
$('#collapse-checkout-confirm').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_confirm; ?>');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
<?php }
替换为
<?php if ($shipping_required) { ?>
$.ajax({
url: 'index.php?route=checkout/shipping_method',
dataType: 'html',
success: function(html) {
$('#collapse-shipping-method .panel-body').html(html);
$('#collapse-shipping-method').parent().find('.panel-heading .panel-title').html('<a href="#collapse-shipping-method" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"><?php echo $text_checkout_shipping_method; ?> <i class="fa fa-caret-down"></i></a>');
$('a[href=\'#collapse-shipping-method\']').trigger('click');
$('#collapse-shipping-method').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_shipping_method; ?>');
$('#collapse-payment-method').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_payment_method; ?>');
$('#collapse-checkout-confirm').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_confirm; ?>');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
<?php }
答案 3 :(得分:0)
您可以使用
<script language="Javascript" type="text/javascript">
$(document).ready(function(){
$('#button-payment').trigger('click');
});
</script>
如果您只有一种付款方式,请在payment_method.tpl上。
它适用于opencart 2.0