Post by AdieB » Fri Dec 03, 2021 7:39 pm

If I wanted to create a URL directly to guest checkout page, what would it be? Any ideas? ???
http://localhost/index.php?route=checkout/checkout
v2.3.0.2

New member

Posts

Joined
Mon May 19, 2014 9:01 pm

Post by grgr » Fri Dec 03, 2021 8:31 pm

Well, sort of. But there is no URL that will force guest checkout. Will need a bit more work than that. And something in the cart as well....

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by AdieB » Fri Dec 03, 2021 8:41 pm

Yip, I use something like this to add to the cart, but I want a button to route directly to guest (Express) checkout.
My OC only has one product.

function myFunction() {
//ADDS PRODUCT TO CART
$.get( "index.php?route=checkout/cart/addToCart&product_id=30", function( data ) {
$( "#myForm" ).addClass( "product-added" );
});

New member

Posts

Joined
Mon May 19, 2014 9:01 pm

Post by grgr » Sun Dec 05, 2021 10:21 pm

You could just add a jquery click to the login template, something like:

Code: Select all

<script">
$(document).ready(function(){
  $('#button-account').trigger('click');
});
</script>
And have the Guest as the default selection.
If you want some customers to be able to select a different option you could use a URL parameter and use an if statement.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by AdieB » Sun Dec 05, 2021 11:32 pm

The URL parameter is what I am trying to determine if I understand your reply correctly. ???

New member

Posts

Joined
Mon May 19, 2014 9:01 pm

Post by grgr » Mon Dec 06, 2021 11:45 am

So you would use a link something like:

Code: Select all

http://localhost/index.php?route=checkout/checkout&guest=1
I would use that in the controller as it is easier to do that then get the parameter with JS.

Then force it to guest. People can still get to it after by clicking on the heading, but you could always hide it also.

Code: Select all

<script>
$(document).ready(function(){
var value = 'guest';
$("input[name=account][value=" + value + "]").attr('checked', 'checked');
$('#button-account').trigger('click');
});
</script>

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK
Who is online

Users browsing this forum: No registered users and 63 guests