Looks like this solves the problem:
//eCart Rule
function WAEC_eCart_DegustationWeine10() {
$totalDiscount = 0;
if (true && (($this->ConditionalTotal("Quantity", "GutscheinCodeArtikel", "1") > 0) && ((isset($_SESSION['GutscheinCode'])?$_SESSION['GutscheinCode']:"") == "123456"))) {
$totalDiscount += ($this->ConditionalTotal("TotalPrice", "GutscheinCodeArtikel", "1") * 0.1);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule