问题
Basically, I want to remove Step 2: Billing Details from the Checkout Page of OpenCart 2.0. My site will only be accepting bank deposits, cash on delivery, and pickup from store as methods of payment so I will not be needing Step 2. How do I go about this?
I've seen a lot of how-tos but not for OpenCart 2.0. The code seems to have changed quite a bit from the previous releases and I'm at a lost.
Thank you for the help!
回答1:
I know this is quite old but i just got stuck with the same problem and found a solution without using any extension.
To completely remove the billing address on checkout on the 2.0.3.1:
Comment or remove the else HTML on the else of this:
if (!$logged && $account != 'guest')
(32);Find the javascript code:
$(document).delegate('#button-payment-address', 'click', function() {
(338) and find inside the delegate method the code:if ($shipping_required)
(373), copy the javascript code(393), it should be an ajax call and delete the whole delegate javascript code that we just foundFind the
if (!$logged)
(124) code and replace the else javascript code with the ajax call you just copied.
回答2:
Have you tried
Opening your checkout.tpl
catalog\view\theme\default\template\checkout\checkout.tpl
Find
$('#payment-address .checkout-content').html(html);
$('#payment-address .checkout-content').slideDown('slow');
replace with
$('#payment-address .checkout-content').html(html);
$('#payment-address #button-payment-address').click();
and change
<div id="payment-address">
to
<div id="payment-address" style="display:none">
回答3:
Since you do not need any billing method and If step 2 is skipped, then step 3 and step 4 can be skipped by default.
go to catalog\controller\checkout\checkout.php and comment the following line to disable step 2 and skip to step 5.
$this->data['text_checkout_payment_address'] = $this->language->get('text_checkout_payment_address');
$this->data['text_checkout_shipping_address'] = $this->language->get('text_checkout_shipping_address');
$this->data['text_checkout_shipping_method'] = $this->language->get('text_checkout_shipping_method');
来源:https://stackoverflow.com/questions/28937936/opencart-2-0-how-to-remove-billing-details-from-chekout-page