ajax && Tools::getValue('impactprice', 0)) { if (Validate::isLoadedObject($this->product)) { $qty = Tools::getValue('qty', 1); $productPrice = $this->product->getPrice(true, null, 6 , null, false, true, $qty); } else { return; } $detectOptGroup = 'optgroup-'; $postValues = Tools::getAllValues(); $this->optValues = array(); $impact = 0; if (count($postValues) > 0) { foreach($postValues as $p => $v) { if (!empty($v)) { if (substr($p, 0, strlen($detectOptGroup)) === $detectOptGroup) { $ids = explode('-', substr($p, strlen($detectOptGroup))); $id_configurator_opt_group = $ids[0]; $id_configurator_opt = $v; if (isset($id[1])) { $id_configurator_opt = $ids[1]; } $this->optValues[] = array( 'id_configurator_opt_group' => substr($p, strlen($detectOptGroup)), 'id_configurator_opt' => $id_configurator_opt ); } } } $impact = $this->product->getConfiguratorImpactPrice($this->optValues); } $this->impactPrice = $productPrice + $impact; } } /* * module: antadisconfigurator * date: 2017-06-27 12:10:07 * version: 0.1 */ public function postProcess() { if ($this->ajax && Tools::getValue('impactprice', 0)) { $return = array( 'priceDisplay' => Tools::displayPrice($this->impactPrice), 'price' => $this->impactPrice, ); die(Tools::jsonEncode($return)); } } }