Page 2 of 2

Re: Default Shipping & Payment Method

Posted: Wed May 19, 2010 6:31 pm
by JJJaved
BUMP!! ???

Re: Default Shipping & Payment Method

Posted: Wed May 19, 2010 7:32 pm
by allenshea
JJJaved wrote:looking for help to implement it in v1.4.7. ???
thanks

Just replace

Code: Select all

($this->url->https('
into

Code: Select all

((HTTPS_SERVER . 'index.php?route=
You can run it in 1.4.7

Allen

P.S., Hope it already in the core of OC 1.4.8

Re: Default Shipping & Payment Method

Posted: Wed May 19, 2010 7:44 pm
by Qphoria
I've already updated the wiki for 1.4.7 (but it seems to be down)

Re: Default Shipping & Payment Method

Posted: Thu Jun 03, 2010 10:57 am
by Qphoria

Re: Default Shipping & Payment Method

Posted: Fri Feb 28, 2014 8:01 am
by JoomGO
I need to Skip the Payment Method step as we only accept Credit Card, so there is no need to ask. I see the code on page 1 but it didn't work as I have a more up-to-date version of OpenCart.

How would we skip the Payment Method option in checking for version 1.5.5.1 ?

Re: Default Shipping & Payment Method

Posted: Wed May 18, 2016 10:58 pm
by beebee
Qphoria wrote:If there is only one shipping option available, it will auto-select it and automatically move to the next step. Otherwise it will display the shipping options.

EDIT: catalog/controller/checkout/shipping.php
FIND:

Code: Select all

$this->session->data['shipping_methods'] = $quote_data;
AFTER ADD:

Code: Select all

//Q: Bypass shipping if using only one and its single rate
if (count($quote_data) == 1) {
	$values = array_values($quote_data);
	if (count($values[0]['quote']) == 1) {
		$keys = array_keys($values[0]['quote']);
		$method = $values[0]['quote'][$keys[0]];
		$this->session->data['shipping_method'] = $method;
		$this->session->data['comment'] = '';
		$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/payment');
	}
}//
If there is only one payment option available, it will auto-select it and automatically move to the next step. Otherwise it will display the shipping options.

EDIT: catalog/controller/checkout/payment.php
FIND:

Code: Select all

$this->session->data['payment_methods'] = $method_data;
AFTER ADD:

Code: Select all

// If there is only one payment option, set it to session and go to confirm
if (count($method_data) == 1) {
	$keys = array_keys($method_data);
	$values = array_values($method_data);
	$method = $values[0];
	$this->session->data['payment_method'] = $method;
	$this->session->data['comment'] = '';
	$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/confirm');
}
Hello Qphoria,

I'm using ver2.2 and have just one shipping method and wish to bypass "Delivery Method" in checkout.
I tried to look for the above code and couldn't locate:

$this->session->data['shipping_methods'] = $quote_data;

Instead, it shows:

$this->session->data['shipping_methods'] = $method_data;

Should I tweak the code to say "$method_data;" or do you recommend something else?
Thank in advance for your help!