Reputation:
I am looking to remove shipping Address or delivery address option from registration, guest in opencart 2.0 and above version but shiping method should be there because i want billing address to be the shipping address without extra field
I tried to implement by these two tutorials in my opencart checkout.tpl file but i am not able to find the code below one
$('#shipping-address .checkout-content').slideDown('slow');
can anybody guide is this right one or for OC above 2.0 is there any othere way to do so
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/
Upvotes: 2
Views: 6056
Reputation: 41
Go to each product and changes it's "required shipping" from YES TO NO. You will find that 2 steps from your checkout is gone.
Upvotes: 4
Reputation: 61
You can use
<script language="Javascript" type="text/javascript">
$(document).ready(function(){
$('#button-payment').trigger('click');
});
</script>
On payment_method.tpl if you have only one payment method.
Its works for opencart 2.0
Upvotes: 0
Reputation: 738
Go to \catalog\view\theme\Your template\template\checkout\checkout.tpl
find the below code and comment it or you can remove it
<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>
You will find the below code in two place replace it
<?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 }
replace with this
<?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 }
Upvotes: 3
Reputation: 231
there are lot of method due to less time i m posting this, i wll improve nxt time
Go to \catalog\view\theme\default\template\checkout\checkout.tpl line 373 approx
<?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 }
Replace with
<?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 }
Upvotes: 2