You are here

function product_price_alterer_field_widget in Ubercart Discounts (Alternative) 7.2

Same name and namespace in other branches
  1. 6.2 product_price_alterer_field/product_price_alterer_field.module \product_price_alterer_field_widget()

Implementation of hook_widget().

File

product_price_alterer_field/product_price_alterer_field.module, line 47
Provides discounts based on ubercart products based on product quantity purchased using attached product field.

Code

function product_price_alterer_field_widget(&$form, &$form_state, $field, $items, $delta = 0) {
  $element = array(
    "#type" => $field["widget"]["type"],
    "#default_value" => isset($items[$delta]) ? $items[$delta] : NULL,
  );
  return $element;
}