-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart.php
50 lines (38 loc) · 976 Bytes
/
cart.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
require 'app/Installer.php';
// Add to cart
if (hasAction('add')) {
App\Cart::add(input('item'));
back();
}
// Remove from cart
if (hasAction('remove')) {
App\Cart::remove(input('item'));
back();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Practice test</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Practice test">
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css">
<link rel="stylesheet" href="./assets/app.css">
</head>
<body>
<?php require 'layout/header.php'; ?>
<h3>Cart</h3>
<?php
if (App\Cart::numberOfItems() === 0) {
require 'layout/emptycart.php';
} else {
require 'layout/cart.php';
}
?>
<h5 class="p-t-3">You may like</h5>
<?php require 'layout/products.php'; ?>
</body>
</html>