Page 1 of 1
Skip Shipping
Posted: Mon Feb 26, 2024 12:37 pm
by heatherbell
Wanted to skip checkout_shipping for a site.
Took me ages to find a solution. It maybe right, maybe wrong, but it works.
So in case it saves others some time:
Make a copy of /includes/system/versioned/1.0.7.8/checkout.php
Save in /includes/system/override/ (create that directory if not existing)
Delete the if condition, that is L126 and L130 - job done.
Re: Skip Shipping
Posted: Mon Feb 26, 2024 12:54 pm
by burt
I haven't tested this, but it looks about right;
/includes/hooks/shop/checkout_shipping/skipShipping.php
Code: Select all
class hook_shop_checkout_shipping_skipShipping {
public function listen_injectRedirects() {
$_SESSION['shipping'] = false;
$_SESSION['sendto'] = false;
Href::redirect($GLOBALS['Linker']->build('checkout_payment.php'));
}
}
Re: Skip Shipping
Posted: Mon Feb 26, 2024 1:22 pm
by heatherbell
burt wrote: ↑Mon Feb 26, 2024 12:54 pmit looks about right

Re: Skip Shipping
Posted: Mon Feb 26, 2024 2:03 pm
by Dan Cole
burt wrote: ↑Mon Feb 26, 2024 12:54 pm
I haven't tested this, but it looks about right;
/includes/hooks/shop/checkout_shipping/skipShipping.php
Code: Select all
class hook_shop_checkout_shipping_skipShipping {
public function listen_injectRedirects() {
$_SESSION['shipping'] = false;
$_SESSION['sendto'] = false;
Href::redirect($GLOBALS['Linker']->build('checkout_payment.php'));
}
}
This was very timely....I was just looking to do the same thing on my 1.0.8.20 build. It works a treat...thanks!!!
Dan
Re: Skip Shipping
Posted: Mon Feb 26, 2024 4:57 pm
by 14Steve14
I know this is not about the topic of this post, but is this type of code needed if the order is just for virtual products?
Does core code bypass shipping in only virtual products are in the basket, also does core code bypass payment if the order total for virtual products is zero.
If code does not bypass payment if order value is zero, can the code supplied be alerted to reflect a zero cost order.
Sorry for the silly questions but our store does sell downloads, and at time we offer free downloads that people buy on their own with no physical products. I am about to try setting up downloads and thought I would ask first.