forked from CE-PhoenixCart/PhoenixCart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkout_shipping.php
53 lines (37 loc) · 1.75 KB
/
checkout_shipping.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/*
$Id$
CE Phoenix, E-Commerce made Easy
https://phoenixcart.org
Copyright (c) 2021 Phoenix Cart
Released under the GNU General Public License
*/
require 'includes/application_top.php';
require 'includes/system/segments/checkout/pipeline.php';
$total_weight = $_SESSION['cart']->show_weight();
$total_count = $_SESSION['cart']->count_contents();
// load all enabled shipping modules
$shipping_modules = new shipping();
$free_shipping = ot_shipping::is_eligible_free_shipping($order->delivery['country_id'], $order->info['total']);
$module_count = $shipping_modules->count();
// process the selected shipping method
if (tep_validate_form_action_is('process')) {
$shipping_modules->process_selection();
}
// get all available shipping quotes
$quotes = $shipping_modules->quote();
shipping::ensure_enabled();
// if no shipping method has been selected, automatically select the cheapest method.
// if the module's status was changed when none were available, to save on implementing
// a javascript force-selection method, also automatically select the cheapest shipping
// method if more than one module is now enabled
if ( !isset($_SESSION['shipping']) || (!$_SESSION['shipping'] && ($module_count > 1)) ) {
$_SESSION['shipping'] = $shipping_modules->cheapest();
}
require language::map_to_translation('checkout_shipping.php');
if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') && !$_SESSION['shipping'] ) {
$messageStack->add_session('checkout_address', ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS);
tep_redirect(tep_href_link('checkout_shipping_address.php'));
}
require $oscTemplate->map_to_template(__FILE__, 'page');
require 'includes/application_bottom.php';