You are here

function uc_quote_order in Ubercart 5

Same name and namespace in other branches
  1. 6.2 shipping/uc_quote/uc_quote.module \uc_quote_order()

Implementation of hook_order().

File

shipping/uc_quote/uc_quote.module, line 509
The controller module for fulfillment modules that process physical goods.

Code

function uc_quote_order($op, &$arg1, $arg2) {
  switch ($op) {
    case 'submit':
      unset($_SESSION['quote']);
      break;
    case 'save':
      db_query("DELETE FROM {uc_order_quotes} WHERE oid = %d", $arg1->order_id);
      db_query("INSERT INTO {uc_order_quotes} (oid, method, accessorials, rate, quote_form) VALUES (%d, '%s', '%s', %f, '%s')", $arg1->order_id, $arg1->quote['method'], $arg1->quote['accessorials'], $arg1->quote['rate'], $arg1->quote['quote_form']);
      break;
    case 'load':
      $quote = db_fetch_array(db_query("SELECT method, accessorials, rate, quote_form FROM {uc_order_quotes} WHERE oid = %d", $arg1->order_id));
      $arg1->quote = $quote;
      $arg1->quote['accessorials'] = strval($quote['accessorials']);
      break;
    case 'delete':
      db_query("DELETE FROM {uc_order_quotes} WHERE oid = %d", $arg1->order_id);
      break;
  }
}