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"]; } }
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(); } }
public function setOperatingCurrency($currency) { $this->params["ONCHANGE"] = $this->createJSOnchange($this->id, $this->getPrice()); parent::setOperatingCurrency($currency); }
public function getViewControl() { $this->createOptions(); return parent::getViewControl(); }