private static function create_split_discount($amount, $id_customer, $id_currency, $id_carts) { ${"GLOBALS"}["lpfswanqwex"] = "code"; ${"GLOBALS"}["iuztfsobjr"] = "id_customer"; $ezdxpbfeg = "languages"; ${"GLOBALS"}["rnwtmfeg"] = "amount"; $wbglpjrhabt = "id_carts"; $wvwcmnzwlplf = "id_currency"; global $cookie; ${${"GLOBALS"}["lpfswanqwex"]} = "split discount-" . ${${"GLOBALS"}["qnutktejfsm"]}; ${"GLOBALS"}["rommybk"] = "languages"; ${"GLOBALS"}["pjlvntsji"] = "discount"; $zwjuqmhrgn = "timeinfo"; if (CartRule::cartRuleExists(${${"GLOBALS"}["thjhsxt"]})) { ${"GLOBALS"}["mutlcfyzn"] = "cartRuleInfo"; $efjrrcbmmc = "code"; ${"GLOBALS"}["dvulqgqhgy"] = "cartRuleInfo"; ${${"GLOBALS"}["dvulqgqhgy"]} = CartRule::getCartsRuleByCode(${$efjrrcbmmc}, $cookie->id_lang); if (!empty(${${"GLOBALS"}["mutlcfyzn"]})) { ${"GLOBALS"}["dutusymn"] = "id_currency"; $ugjhbkcy = "id_customer"; $vhkwbuk = "discount"; ${"GLOBALS"}["wtngbnwjou"] = "amount"; ${$vhkwbuk} = new CartRule((int) ${${"GLOBALS"}["exnqrgnk"]}[0]["id_cart_rule"]); $discount->reduction_amount = Tools::ps_round(abs(${${"GLOBALS"}["wtngbnwjou"]}), 2); $discount->id_customer = ${$ugjhbkcy}; $discount->reduction_currency = ${${"GLOBALS"}["dutusymn"]}; ${"GLOBALS"}["lftybruvzf"] = "discount"; $discount->save(); return ${${"GLOBALS"}["lftybruvzf"]}; } } ${$zwjuqmhrgn} = AgileHelper::getDbDateTime(1, "DAY"); ${${"GLOBALS"}["rommybk"]} = Language::getLanguages(); ${${"GLOBALS"}["pjlvntsji"]} = new CartRule(); $discount->code = "split discount-" . ${$wbglpjrhabt}; $discount->description = $discount->code; $discount->id_customer = ${${"GLOBALS"}["iuztfsobjr"]}; $discount->id_group = 0; $discount->reduction_currency = ${${"GLOBALS"}["lppjvltcyn"]}; $discount->reduction_amount = Tools::ps_round(abs(${${"GLOBALS"}["rnwtmfeg"]}), 2); $discount->minimum_amount_currency = ${$wvwcmnzwlplf}; $discount->quantity = 1; $discount->quantity_per_user = 1; $discount->date_from = ${${"GLOBALS"}["vwwosyf"]}["timenow"]; $discount->date_to = ${${"GLOBALS"}["vwwosyf"]}["newtime"]; $discount->partial_use = 0; $discount->include_tax = 1; $discount->active = 1; $discount->cart_display = 0; $discount->date_add = ${${"GLOBALS"}["vwwosyf"]}["timenow"]; $discount->date_upd = ${${"GLOBALS"}["vwwosyf"]}["timenow"]; foreach (${$ezdxpbfeg} as ${${"GLOBALS"}["ehrifiqsh"]}) { $edrgrgkvw = "fields"; $hfpvhmutci = "field"; ${${"GLOBALS"}["samttghly"]} = array("name"); $gigicrqhcvtw = "language"; $vuqkbfsbtw = "field"; foreach (${$edrgrgkvw} as ${$vuqkbfsbtw}) { $discount->{${$hfpvhmutci}}[intval(${$gigicrqhcvtw}["id_lang"])] = $discount->code; } } $discount->save(); return ${${"GLOBALS"}["gwtztyfxho"]}; }