Question

Hello as it's written in F3 documentation here : http://fatfreeframework.com/basket#load you can get all the results of the basket like this

$result = $basket->find(); // array of basket items, if any

But when I tried it I get the following error :

`Internal Server Error

Missing argument 1 for Basket::find(), called in /var/www/***/controller.php on line 55 and defined

Any suggestions?

Was it helpful?

Solution

This was fixed some days ago: https://github.com/bcosca/fatfree/commit/c16332c7cc2d24ed2e98e3654e182211e6e09db5

Fetch the nightly build and try again ;)

OTHER TIPS

@ikkez I added this function inside lib/basket.php in order to return the item of the cart by id

function findById($cartID){
    $out=array();
    foreach($_SESSION[$this->key] as $id=>$item){
        if($id==$cartID){
          return $item;
        }

    }
}

Hope it will help somebody..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top