Welcome Guest, Not a member yet? Register   Sign In
$this->cart->total() - Can this be manipulated?
#2

[eluser]bubbafoley[/eluser]
The cart class is very incomplete.

I would extend the Cart class to make the desired changes.

Something like this should work:
application/libraries/MY_Cart.php
Code:
<?php

class MY_Cart extends CI_Cart {

    function __construct()
    {
        parent::__construct();
    }

    function update_total($new_total)
    {
        $this->_cart_contents['cart_total'] = $new_total;
    }

}

then in your controller you can do this:

Code:
$this->cart->update_total(199.95);


Messages In This Thread
$this->cart->total() - Can this be manipulated? - by El Forum - 03-11-2011, 04:30 PM
$this->cart->total() - Can this be manipulated? - by El Forum - 03-11-2011, 04:46 PM
$this->cart->total() - Can this be manipulated? - by El Forum - 03-16-2011, 04:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB