unodepiera/simplecart

Simplecart for Laravel 4
379 6
Install
composer require unodepiera/simplecart
PHP:>=5.3.0
Last Updated:Feb 13, 2014
Links: GitHub  ·  Packagist
Maintainer: unodepiera
//add options to row
$item["options"] = array("color" => "blue", "avaliable" => "si");

//add row to cart
Simplecart::insert($item);
<h2>Update a product</h2>
```php
	$update = array(
    	'id' => 5,
        'rowid'	=> "e4da3b7fbbce2345d7772b0674a318d5",
        'qty' => 25,
        'price' => $price,
        'name' => "shirt",
        'medida' => "xl"
    );

    Simplecart::update($update);
//add options to row
$item["options"] = array("color" => "orange", "avaliable" => "yes");

//add row to cart
Simplecart::insert($item);

});

<h3>Then create the next view and visit the route show</h3>
```php
Route::get("show", function()
{
	$cart = Simplecart::get_content();
	$totalcart = Simplecart::total_cart();
	$totalitems = Simplecart::total_articles();
	return View::make("cart", array("cart" => $cart, "total_cart" => $totalcart, "total_items" => $totalitems));
});