Example #1
0
 public function __construct($id, array $structure, $value = null, array $additionalParams = array())
 {
     $structure["PARAMS"]["ONCHANGE"] = 'BX.onCustomEvent("onDeliveryExtraServiceValueChange", [{"id" : "' . $id . '", "value": this.value, "price": this.value*parseFloat("' . $structure["PARAMS"]["PRICE"] . '")}]);';
     parent::__construct($id, $structure, $value);
     $this->params["TYPE"] = "STRING";
     if (isset($structure["PARAMS"]["PRICE"])) {
         $this->params["PRICE"] = $structure["PARAMS"]["PRICE"];
     }
 }
Example #2
0
 public function __construct($id, array $structure, $value = null, array $additionalParams = array())
 {
     $structure["PARAMS"]["ONCHANGE"] = 'BX.onCustomEvent("onDeliveryExtraServiceValueChange", [{"id" : "' . $id . '", "value": this.value, "price": ' . $this->getJSPrice($structure) . '}]);';
     parent::__construct($id, $structure, $value);
     $this->params["TYPE"] = "ENUM";
     $this->params["OPTIONS"] = array();
     if (isset($structure["PARAMS"]["PRICES"]) && is_array($structure["PARAMS"]["PRICES"])) {
         $this->params["PRICES"] = $structure["PARAMS"]["PRICES"];
         foreach ($this->params["PRICES"] as $key => $price) {
             if (strlen($price["TITLE"]) <= 0) {
                 continue;
             }
             $this->params["OPTIONS"][$key] = $price["TITLE"] . " (" . $price["PRICE"] . ")";
         }
     } else {
         $this->params["OPTIONS"] = array();
     }
 }
Example #3
0
 public function setOperatingCurrency($currency)
 {
     $this->params["ONCHANGE"] = $this->createJSOnchange($this->id, $this->getPrice());
     parent::setOperatingCurrency($currency);
 }
Example #4
0
 public function getViewControl()
 {
     $this->createOptions();
     return parent::getViewControl();
 }