forked from josemato/hack-commerce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproducts.php
More file actions
30 lines (23 loc) · 950 Bytes
/
Copy pathproducts.php
File metadata and controls
30 lines (23 loc) · 950 Bytes
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
<?php
// View: products list
require_once 'core/autoload.php';
require_once 'core/models/product_model.php';
$products = ProductModel::getProducts();
?>
<?php ob_start(); ?>
<div class="products">
<?php foreach($products as $product): ?>
<article class="product">
<h2 class="entry-title ellipsis"><a href="product-detail.php?id=<?php echo $product->id; ?>" title="<?php echo $product->title; ?>"><?php echo $product->title; ?></a></h2>
<a href="product-detail.php?id=<?php echo $product->id; ?>">
<img src="uploads/cover/<?php echo $product->image; ?>" alt="<?php echo $product->title; ?>" width="200">
</a>
<p class="entry-actions">
<a href="add2cart.php?id=<?php echo $product->id; ?>"><i class="fa fa-shopping-cart fa-lg"></i> Add to cart</a>
</p>
</article>
<?php endforeach; ?>
</div> <!-- ./products -->
<?php $module = ob_get_contents(); ?>
<?php ob_end_clean(); ?>
<?php require_once 'template.php'; ?>