Created
May 25, 2017 11:17
-
-
Save rintoug/0787ed6d7f98ca5efb177a8601ce4034 to your computer and use it in GitHub Desktop.
Simple PHP Shopping Cart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<div class="container" style="width:600px;"> | |
<?php foreach($products as $product):?> | |
<div class="col-md-4"> | |
<div class="thumbnail"> <img src="<?php print $product['image']?>" alt="Lights"> | |
<div class="caption"> | |
<p style="text-align:center;"><?php print $product['name']?></p> | |
<p style="text-align:center;color:#04B745;"><b>$<?php print $product['price']?></b></p> | |
<form method="post" action="shopping-cart.php?action=addcart"> | |
<p style="text-align:center;color:#04B745;"> | |
<button type="submit" class="btn btn-warning">Add To Cart</button> | |
<input type="hidden" name="sku" value="<?php print $product['sku']?>"> | |
</p> | |
</form> | |
</div> | |
</div> | |
</div> | |
<?php endforeach;?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment