You are here

function _uc_quote_extract_default_option in Ubercart 8.4

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

Gets the default (selected) quote option from the built form element.

Parameters

array $quote_form: The quotes form-element.

Return value

string|false The default quote option, or FALSE if none exists.

1 call to _uc_quote_extract_default_option()
QuotePane::prepare in shipping/uc_quote/src/Plugin/Ubercart/CheckoutPane/QuotePane.php
Prepares a pane for display.

File

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

Code

function _uc_quote_extract_default_option($quote_form) {
  if (isset($quote_form['quote_option']['#value'])) {
    return $quote_form['quote_option']['#value'];
  }
  elseif (isset($quote_form['quote_option']['#default_value'])) {
    return $quote_form['quote_option']['#default_value'];
  }
  else {
    return FALSE;
  }
}