Open nikmauro opened 9 years ago
Hello i have implement this class with no success. Here my code, no errors, no warnings, only blank screen.
require_once('vendor/autoload.php'); use Moltin\Cart\Cart; use Moltin\Cart\Storage\Session; use Moltin\Cart\Identifier\Cookie; function shopping_items() { $cart = shopping_getCart(); $cartItems = $cart->contents(); $d = ''; if (count($cartItems) > 0) { foreach ($cartItems as $item) { $d .= "<li>{$item->name} {$item->quantity}x{$item->price}</li>"; } } return "<ul>$d</ul>"; } function shopping_getCart() { return new Cart(new Session, new Cookie); } function shopping_add_item() { $cart = shopping_getCart(); $cart->insert(array( 'id' => 'foo', 'name' => 'bar', 'price' => 100, 'quantity' => 1 )); } shopping_add_item(); echo shopping_items();
Have you enabled your error reporting?
@outrunthewolf yes i have enabled the errors. i have check and log files.
error_reporting(E_ALL); ini_set("display_errors", 1);
Hello i have implement this class with no success. Here my code, no errors, no warnings, only blank screen.