I want to pass function values to another function in the same class, like to store some values in a variable and then call this variable in another function in the same class.
Here is my Code
public function ven_coupon()
{
if ($_POST) {
$number = $_POST['coupon'];
$query = $this->front->ven_coupon($number);
if (count($query) <= 0 ) {
echo "Not Valid";
}
$payment = $this->cart->total();
$dis = $query['discount'];
$name = $query['username'];
$number = $query['number'];
$discount['discount'] = ($payment*$dis)/100;
$discount['data'] = $dis;
$this->load->view('checkout',$discount);
}
}
public function addcart()
{
$ven = $this->ven_coupon();
echo $ven($name);
echo $ven($dis);
echo $ven($number);
}