Post by JJJaved » Tue Aug 11, 2009 2:28 am

Could you please show me how to, if it is possible (OC 3.0) to make one default shipping method and one default payment method and by-pass two pages for the check-out process and reach checkout confirmation page?
Any answer or help please.

Thanking you for your time and effort.
???

New member

Posts

Joined
Tue Jul 07, 2009 12:57 am
Location - Cardiff - UK

User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JJJaved » Tue Aug 11, 2009 3:52 am

Thanks Q.
Is it possible after the account creation by pressing the checkout button to go straight to checkout confirmation page, by-passing the two default pages, avoiding two clicks in checkout process?
Thanks

New member

Posts

Joined
Tue Jul 07, 2009 12:57 am
Location - Cardiff - UK

Post by Qphoria » Tue Aug 11, 2009 4:18 am

I tried this in ChromiumCart and I thought I had it working, but using shipping modules with multiple options (like UPS) caused problems with it. So for now, no.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JJJaved » Tue Aug 11, 2009 4:53 am

Do you think it would work if there are no multiple options, but just simple flat shipping rates for different zones and only one option to pay by credit card?

Thanks

New member

Posts

Joined
Tue Jul 07, 2009 12:57 am
Location - Cardiff - UK

Post by Qphoria » Tue Aug 11, 2009 4:55 am

Yes it will work for flatrate and payment. But what about comments? If you skip over payment and shipping, you will not allow the user to add comments to the order. If that is ok i will post it.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JJJaved » Tue Aug 11, 2009 5:08 am

There are no user comments.
Many thanks for help and posting.

New member

Posts

Joined
Tue Jul 07, 2009 12:57 am
Location - Cardiff - UK

Post by Qphoria » Tue Aug 11, 2009 5:42 am

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');
}

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Wed Sep 16, 2009 3:51 am

Updated the shipping code above. Now it won't break when using a multi-rate shipping. It will display the options as needed. It will only autoset & skip if there is a single rate option.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JJJaved » Wed Sep 16, 2009 6:05 am

Thanks,Q

I shall be using it and let you know.

New member

Posts

Joined
Tue Jul 07, 2009 12:57 am
Location - Cardiff - UK

Post by JJJaved » Mon Feb 01, 2010 1:42 am

Hi Q
1.4.0 - Registering the account function is not working properly, may be bugs.
As a registered returning customer, it is working fine and taking to the checkout confirmation page, but “Shipping Method” and “Payment Method” change options should not show-up here. Back button is not working. Confirmation button is working.

As a guest checkout, it is not working at all.

Waiting for it to be fixed to use with 1.4.1. Thanks a lot for your kind help.
;D

New member

Posts

Joined
Tue Jul 07, 2009 12:57 am
Location - Cardiff - UK

Post by Qphoria » Mon Feb 01, 2010 11:32 am

fixed for 1.4.1? Why wouldn't i just fix it for 1.4.0?

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Johnathan » Mon Feb 01, 2010 12:32 pm

Thanks for this, it's quite handy. I'm trying to figure out a way to skip the Confirm page as well (and go straight to Paypal), but I can only do it out with some javascript trickery. Basically, I put the whole of confirm.tpl in a div with style="display: none" (so it wouldn't half-display as it was redirecting) and then put this at the bottom:

Code: Select all

<script type="text/javascript">
	$('#checkout').submit();
</script>
Does anyone know a better way to do this?

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by JJJaved » Wed Feb 03, 2010 5:05 pm

Requesting Q to fix it please
;D

New member

Posts

Joined
Tue Jul 07, 2009 12:57 am
Location - Cardiff - UK

Post by Qphoria » Wed Feb 03, 2010 8:57 pm

I just tested it in 1.4.0. It's exactly the same code as above. Works fine.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by migz » Wed Feb 03, 2010 10:52 pm

There's a bug. If you add to cart>click checkout, you go straight to payment method page(because there are 3 payment modules). If you click again the checkout, it doesn't skip shipping method. Can you guys check?

Active Member

Posts

Joined
Mon Feb 01, 2010 2:13 am

Post by Qphoria » Wed Feb 03, 2010 11:17 pm

I'm not seeing an issue.
If I have 1 shipping and 1 payment, I click checkout and it goes straight to confirm. GOOD
If I have 1 shipping and 2 payment, I click checkout and it goes straight to payment page. GOOD
If I have 2 shipping and 1 payment, I click checkout and it goes to shipping. Click next and goes to confirm. GOOD
If I have 2 shipping and 2 payment, I click checkout and its normal flow. GOOD

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by migz » Wed Feb 03, 2010 11:30 pm

Hmm. I have 1 shipping 3 payment, I click checkout and it goes straight to payment. If I click again checkout(current page), it goes to shipping page.

Active Member

Posts

Joined
Mon Feb 01, 2010 2:13 am

Post by Qphoria » Wed Feb 03, 2010 11:59 pm

oh..i see.. its the stupid session check thing. I really dislike that design.
I made a patched version that fixes one part of the file. The other part is a "Feature" that i dislike that we can override.

First get the patched file here:
http://forum.opencart.com/viewtopic.php?f=31&t=10335

Then edit that file and change:

Code: Select all

if (!isset($this->session->data['shipping_methods'])) {
To:

Code: Select all

if (0==0) {

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JJJaved » Mon May 10, 2010 3:50 pm

looking for help to implement it in v1.4.7. ???
thanks

New member

Posts

Joined
Tue Jul 07, 2009 12:57 am
Location - Cardiff - UK
Who is online

Users browsing this forum: No registered users and 3 guests