如何在opencart 2.0以上版本中从注册、来宾选项等中删除配送地址选项

如何在opencart 2.0以上版本中从注册、来宾选项等中删除配送地址选项,opencart,Opencart,我希望从opencart 2.0及以上版本的注册中删除shipping Address或delivery Address选项,guest,但应该有shipping方法,因为我希望billing Address是发货地址,而不需要额外字段 我试图在我的opencart checkout.tpl文件中实现这两个教程,但我找不到下面的代码 $('#shipping-address .checkout-content').slideDown('slow'); 有人能告诉我这是对的还是OC高于2.0有其

我希望从opencart 2.0及以上版本的注册中删除shipping Address或delivery Address选项,guest,但应该有shipping方法,因为我希望billing Address是发货地址,而不需要额外字段

我试图在我的opencart checkout.tpl文件中实现这两个教程,但我找不到下面的代码

$('#shipping-address .checkout-content').slideDown('slow');
有人能告诉我这是对的还是OC高于2.0有其他方法吗


由于我发布此信息的时间较短,因此有很多方法,我将改进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 } 

$.ajax({
url:'index.php?route=checkout/shipping_address',
数据类型:“html”,
成功:函数(html){
$('#collapse shipping address.panel body').html(html);
$('#折叠装运地址').parent().find('.panel heading.panel title').html('');
$('a[href=\'\35;折叠配送地址\']')。触发器('click');
$('#collapse shipping method').parent().find('.panel heading.panel title').html('');
$(“#折叠付款方法”).parent().find(“.panel heading.panel title”).html(“”);
$('#折叠签出确认').parent().find('.panel heading.panel title').html('');
},
错误:函数(xhr、ajaxOptions、thrownError){
警报(thrownError+“\r\n”+xhr.statusText+“\r\n”+xhr.responseText);
}
});
$.ajax({
url:'index.php?route=checkout/shipping_method',
数据类型:“html”,
成功:函数(html){
$('#collapse shipping method.panel body').html(html);
$('#collapse shipping method').parent().find('.panel heading.panel title').html('');
$('a[href=\'\35;折叠装运方法\']')。触发器('click');
$('#collapse shipping method').parent().find('.panel heading.panel title').html('');
$(“#折叠付款方法”).parent().find(“.panel heading.panel title”).html(“”);
$('#折叠签出确认').parent().find('.panel heading.panel title').html('');
},
错误:函数(xhr、ajaxOptions、thrownError){
警报(thrownError+“\r\n”+xhr.statusText+“\r\n”+xhr.responseText);
}
});

转到\catalog\view\theme\Your template\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 } 

$.ajax({
url:'index.php?route=checkout/shipping_address',
数据类型:“html”,
成功:函数(html){
$('#collapse shipping address.panel body').html(html);
$('#折叠装运地址').parent().find('.panel heading.panel title').html('');
$('a[href=\'\35;折叠配送地址\']')。触发器('click');
$('#collapse shipping method').parent().find('.panel heading.panel title').html('');
$(“#折叠付款方法”).parent().find(“.panel heading.panel title”).html(“”);
$('#折叠签出确认').parent().find('.panel heading.panel title').html('');
},
错误:函数(xhr、ajaxOptions、thrownError){
警报(thrownError+“\r\n”+xhr.statusText+“\r\n”+xhr.responseText);
}
});
$.ajax({
url:'index.php?route=checkout/shipping_method',
数据类型:“html”,
成功:函数(html){
$('#collapse shipping method.panel body').html(html);
$('#collapse shipping method').parent().find('.panel heading.panel title').html('');
$('a[href=\'\35;折叠装运方法\']')。触发器('click');
$('#collapse shipping method').parent().find('.panel heading.panel title').html('');
$(“#折叠付款方法”).parent().find(“.panel heading.panel title”).html(“”);
$('#折叠签出确认').parent().find('.panel heading.panel title').html('');
},
错误:函数(xhr、ajaxOptions、thrownError){
警报(thrownError+“\r\n”+xhr.statusText+“\r\n”+xhr.responseText);
}
});
你可以用

<script language="Javascript" type="text/javascript">
$(document).ready(function(){
  $('#button-payment').trigger('click');
});
</script>

$(文档).ready(函数(){
$(“#按钮付款”)。触发('click');
});
如果您只有一种付款方式,请选择付款方式


它适用于opencart 2.0

转到每个产品,并将其“所需配送”从“是”更改为“否”。您将发现结帐后的两个步骤都没有了

我希望删除配送地址选项我只希望我的结账页面流程如下1.guset或register>>2.billing address>>3.shipping method>>4.payment method>>5.confirm order其工作正常。我还想从opencart 2.x的结帐页面中删除步骤4,5,即交货方式和付款方式。那么,您能告诉我在下面的文件
\catalog\view\theme\Your template\template\checkout\checkout.tpl
中做了哪些更改吗。我还想删除步骤4,5,即交付M
<?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 }
<script language="Javascript" type="text/javascript">
$(document).ready(function(){
  $('#button-payment').trigger('click');
});
</script>