function getvoucherinfo() { if (!$this->vouchercode) { return; } $res = 0; $v = new voucher(); $v->findvoucher($this->vouchercode); if (!$v->id) { echo JText::sprintf("SC_VOUCHER_INVALID", $v->name); printf("-<pre>%s</pre>-", print_r($v, 1)); return; } if ($v->qtylimited and $v->avqty > 0) { $res++; } if ($v->datelimited and (mktime() <= $v->validto and mktime() > $v->validfrom)) { $res++; } if (!$v->qtylimited and !$v->datelimited) { $res++; } if ($res > 0) { $korting = $this->redeemvoucher($v); echo "OK|" . $korting['subtotal'] . "|" . $korting['tax'] . "|" . $korting['carttotal']; } else { echo JText::sprintf("SC_VOUCHER_INVALID", $v->name); printf("-<pre>%s %s</pre>-", print_r($v, 1), $res); } // $this->redirect="index.php?option=com_caddy&action=showcart&Itemid=$itemid"; }