Skip to content

Commit

Permalink
Shopping cart added
Browse files Browse the repository at this point in the history
  • Loading branch information
Fahad-Md-Kamal committed Mar 2, 2019
1 parent c8bad3b commit 42dda10
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
4 changes: 4 additions & 0 deletions css/shop-homepage.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ td, th {

tr:nth-child(even) {
background-color: #dddddd;
}

td img{
width: 30px;
}
10 changes: 9 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,23 @@
<?php include_once"templating/side_bar.php" ?>



</div>
<!-- /.col-lg-3 -->

<div class="col-lg-9">
<?php include_once"templating/slider.php" ?>

<?php include_once"templating/slider.php" ?>
<p class="text-danger text-center h1"><?php
if (isset($_SESSION['msg'])) {
echo ($_SESSION['msg']);
unset($_SESSION['msg']);
}
?></p>

<!-- product list -->
<div class="row">

<?php include_once"templating/product_list.php" ?>
</div>
<!-- /.row -->
Expand Down
16 changes: 16 additions & 0 deletions php/removeFromCart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


<?php
session_start();
if(isset($_GET['pid'])){

$key = array_search($_GET['pid'], $_SESSION['cart']);

unset($_SESSION['cart'][$key]);
}

// print_r ($_SESSION['cart']);

header('location:../cart.php');

?>
10 changes: 6 additions & 4 deletions signup.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
<div class="form-group">
<input type="submit" class="form-control btn btn-success mt-4" value="SUBMIT">
</div>
<p class="h4 text-center"><?php if (isset($_SESSION['msg'])) {
echo($_SESSION['msg']);
unset($_SESSION['msg']);
} ?></p>
<p class="h4 text-center">
<?php if (isset($_SESSION['msg'])) {
echo($_SESSION['msg']);
unset($_SESSION['msg']);
} ?>
</p>
</form>


Expand Down
3 changes: 0 additions & 3 deletions templating/head.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php

require_once "php/DB/db_setup.php";


session_start();

?>

<!DOCTYPE html>
Expand Down

0 comments on commit 42dda10

Please sign in to comment.