sync
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
function product_card($product)
|
||||
{
|
||||
$card = '
|
||||
<a class="card column center full_width padding" href="product.php?id=' . $product['id'] . '">
|
||||
<div class="img_container">
|
||||
<img src="img/' . $product['image'] . '">
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<h4>' . $product['name'] . '</h4>
|
||||
<h5>' . $product['price'] . '</h5>
|
||||
</div>
|
||||
</a>
|
||||
';
|
||||
|
||||
return $card;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
function catalog_grid($products)
|
||||
{
|
||||
$grid = '
|
||||
<div class="grid center">
|
||||
';
|
||||
|
||||
foreach ($products as $p)
|
||||
$grid .= product_card($p);
|
||||
|
||||
$grid .= '
|
||||
</div>
|
||||
';
|
||||
|
||||
return $grid;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
function product_page($product)
|
||||
{
|
||||
$page = '
|
||||
<div class="product_page_card column center full_width padding">
|
||||
<div class="img_container">
|
||||
<img src="img/' . $product['image'] . '">
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="row space_between">
|
||||
<h3>' . $product['name'] . '</h3>
|
||||
<h3>' . $product['price'] . '</h3>
|
||||
</div>
|
||||
|
||||
<p>' . $product['description'] . '</p>
|
||||
<form class="row" id="add_to_cart">
|
||||
<input type="hidden" name="is_logged_in" value="' . (isset($_SESSION['id']) ? 'true' : 'false') . '">
|
||||
<div class="column margin">
|
||||
<label for="quantity">Quantity:</label>
|
||||
<input type="number" value="1" id="quantity" name="quantity" min="1">
|
||||
</div>
|
||||
|
||||
<input type="submit" value="Add to Cart" class="margin">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal">
|
||||
<div class="modal_content">
|
||||
' . login_form() . '
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
return $page;
|
||||
}
|
||||
Reference in New Issue
Block a user