Skip to content

Commit

Permalink
Merge pull request #427 from bugfolder/257_mutable_orders
Browse files Browse the repository at this point in the history
Issue #257: Prevent user mutability of orders post-checkout.
  • Loading branch information
bugfolder authored Feb 7, 2023
2 parents b015d96 + 40dd946 commit d73b633
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions uc_cart/uc_cart.pages.inc
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,13 @@ function theme_uc_cart_checkout_form($variables) {
function uc_cart_checkout_form_validate($form, &$form_state) {
$order = $form_state['storage']['order'];

// Exit out if the order is no longer in_checkout
$order_reloaded = uc_order_load($order->order_id, TRUE);
if($order_reloaded->order_status != 'in_checkout') {
$form_state['checkout_valid'] = FALSE;
return '';
}

// Update the order "modified" time to prevent timeout on ajax requests.
$order->modified = REQUEST_TIME;

Expand Down

0 comments on commit d73b633

Please sign in to comment.