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.
Skip Shipping
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
- burt
- Core Team
- Posts: 4560
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 413 times
Re: Skip Shipping
I haven't tested this, but it looks about right;
/includes/hooks/shop/checkout_shipping/skipShipping.php
/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'));
}
}
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
-
Dan Cole
- Senior Contributor
- Posts: 499
- Joined: Fri Oct 25, 2019 2:14 pm
- Phoenix Version: 1.0.8.21
- Has thanked: 67 times
- Been thanked: 61 times
Re: Skip Shipping
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!!!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')); } }
Dan
-
14Steve14
- Senior Contributor
- Posts: 923
- Joined: Fri Oct 25, 2019 7:01 pm
- Phoenix Version: v1.0.9.1
- Has thanked: 17 times
- Been thanked: 103 times
Re: Skip Shipping
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.
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.