Originally Posted by
mc12345678
... So, are you trying to replicate the functionality, or trying to be sure that appropriate options are displayed/made available?
What I'm trying to do is point out a discrepancy in settings for the in-core 3-page checkout ... as I attempt to keep the 1-page checkout "in line". My belief is that the statement
Code:
if ((!isset($_SESSION['shipping']) || (!isset($_SESSION['shipping']['id']) || $_SESSION['shipping']['id'] == '') && zen_count_shipping_modules() >= 1)) $_SESSION['shipping'] = $shipping_modules->cheapest();
has misplaced parentheses, causing the cheapest to be returned when there are no shipping modules to be set. Perhaps instead:
Code:
if ((!isset($_SESSION['shipping']) || !isset($_SESSION['shipping']['id']) || $_SESSION['shipping']['id'] == '') && zen_count_shipping_modules() >= 1) {
$_SESSION['shipping'] = $shipping_modules->cheapest();
}
or, using De Morgan's Laws:
Code:
if (!(isset($_SESSION['shipping']) && isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] != '') && zen_count_shipping_modules() >= 1) {
$_SESSION['shipping'] = $shipping_modules->cheapest();
}
Bookmarks