No sure If this is an issue or not. I have been testing this out in light of the EU tax changes and think I may have hit a problem. Once you have set your billing address there is no way that you can change it if your order is below the threshold and you have used deny to prevent order below the threshold.
The code returns you to the Shopping cart each time then if you go back to the check out even if you click the change address button on the shipping address you are returned to the shopping cart.
Like I said I am not sure that this is really an issue as most people would not change their billing address once they had started, just cause an issue when testing.
You can get around this by changing line 86 from zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); to zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS));
This works fine for testing but probably not suitable for live, as it encourages changing the address.
I was also trying to make it work for the shopping basket instead of just at checkout to give the customer warning that their order did not meet the minimum order based on the delivery country used in the shipping estimator.
code I used was
/**
* NOTIFY_HEADER_END_SHOPPING_CART
*
* Here we check for "Deny" status.
*
*/
public function updateNotifyHeaderEndShoppingCart(&$class, $eventID)
{
global $messageStack, $current_page_base;
global $order;
$taxCountryId = $_REQUEST['zone_country_id'];
$taxZoneId = 0;
$data = $this->process($order, $taxCountryId, $taxZoneId);
// if not set to Deny, we abort with a return
if (!is_array($data) || $data['status'] !== 'DENY') {
return;
}
$error_message = sprintf(TEXT_MINIMUM_ORDER_THRESHOLD_NOT_MET, $data['threshold'], $data['currency']) . '<br>';
$_SESSION['valid_to_checkout'] = false;
if (!in_array($current_page_base, ['shopping_cart', 'checkout_shipping', 'checkout_one'])) {
$messageStack->add_session('header', $error_message, 'caution');
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
// else set message to current page instead of to session for redirect
$messageStack->add('header', $error_message, 'caution');
}
Mark Brittain
http:\innerlightcrystals.co.uk\sales\