Shopping Cart Tutorial-Bootstrap PHP Mysqli Jquery-Ajax Part 7

Php

Video is ready, Click Here to View ×


Shopping Cart Tutorial-Bootstrap PHP Mysqli Jquery-Ajax Part 7
This project is based on Bootstrap PHP Mysqli Jquery-Ajax
Thanx for Watching dont forget to like and Subscribe
Facebook Page http://www.facebook.com/rktuts

How did you reached this Shopping Cart Tutorial by searching…
bootstarp ecommerce website tutorial,
bootstrap php jquery ajax tutorial,
ecommerce websites,
Shopping cart php jquery ajax,
e commerce,
e…

40 thoughts on “Shopping Cart Tutorial-Bootstrap PHP Mysqli Jquery-Ajax Part 7

  1. SIr I am getting this error can you tell me how to solve this ????

    jquery.js:2 Uncaught Error: Syntax error, unrecognized expression: $get_category
    at Function.oe.error (jquery.js:2)
    at oe.tokenize (jquery.js:2)
    at oe.select (jquery.js:2)
    at Function.oe [as find] (jquery.js:2)
    at w.fn.init.find (jquery.js:2)
    at new w.fn.init (jquery.js:2)
    at w (jquery.js:2)
    at Object.success (main.js:9)
    at u (jquery.js:2)
    at Object.fireWith [as resolveWith] (jquery.js:2)

  2. Dear Rizwan Khan,
    In part 7 (Shopping Cart Tutorial-Bootstrap PHP MySQL Jquery-Ajax Part 7) I saw some people have problem to see in left-side-bar Categories and Brands. I think most of them wrote a good code. The only things that they should do is to clean the web-broser-cash. Then they can see the items in left-side-bar.
    You made almost good tutorial about PHP.

    Some tips for your future online tutorials:
    – try to give more information when you write the code. Clearly give a reason why you write some code.
    – make some tutorial for use of PHP in combination with PDO.
    – make some tutorial for use of PHP with some online free responsive themes.
    – try to make a webshop with use of Laravel or symphony library. (this is very popular in Europe).
    – make a webshop with use of a good IDE like NetBeans or Eclipse (every developer use normally one of this).

    Good luck,

  3. Hello I have problem to show Categories on index page. I have checked many time code is according to this video but still not showing.
    Here is my action.php code
    ==========================

    <?php
    include "db.php";
    if(isset($_POST["category"])){
    $category_query = "SELECT * FROM categories";
    $run_query = mysqli_query($conn,$category_query);
    echo "
    <div class='nav nav-pills nav-stacked'>
    <li class='active'><a href='#'><h4>Categories</h4></a></li>
    ";
    if(mysqli_num_rows($run_query) > 0) {
    while($row = mysqli_fetch_array($run_query)){
    $cid = $row["cat_id"];
    $cat_name = $row["cat_title"];
    echo "
    <li><a href='#'>$cat_name</a></li>
    ";
    }
    echo "</div>";
    }
    }

    ?>

    =============
    Here is my main.js file code
    =========================

    $(document).ready(function(){
    cat();
    function cat(){
    $.ajax({
    url : "action.php",
    method : "POST",
    data : {category:1},
    success : function(data){
    $("#get_category") .html(data);
    }
    })
    }
    })

    ========================
    Here is my index.php file.
    =======================
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>KK Collection</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="main.js"></script>
    </head>
    <body>
    <div class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
    <div class="navbar-header">
    <a href="#" class="navbar-brand">KK Collection</a>
    </div>
    <ul class="nav navbar-nav">
    <li><a href="index.php"><span class="glyphicon glyphicon-home"></span> Home</a></li>
    <li><a href="#"><span class="glyphicon glyphicon-modal-window"></span> Products</a></li>
    <li style="width:300px; margin-left:10px; margin-top:10px; "><input type="text" class="form-control" id="search"></li>
    <li style="margin-left:10px; margin-top:10px;"><input type="submit" class="btn btn-primary" id="search_btn"></li>
    </ul>
    <ul class="nav navbar-nav navbar-right">
    <li><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-shopping-cart"></span> Cart <span class="badge">0</span></a>
    <div class="dropdown-menu" style="width:400px;">
    <div class="panel panel-success">
    <div class="panel-heading">
    <div class="row">
    <div class="col-md-3">Sr #</div>
    <div class="col-md-3">Product Image</div>
    <div class="col-md-3">Product Name</div>
    <div class="col-md-3">Price in Rs.</div>
    </div>
    </div>
    <div class="panel-body"></div>
    <div class="panel-footer"></div>
    </div>
    </div>
    </li>
    <li><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-log-in"></span> SignIn</a>
    <ul class="dropdown-menu">
    <div style="width:300px;">
    <div class="panel panel-primary">
    <div class="panel-heading">LogIn</div>
    <div class="panel-heading">
    <label for="email">Email</label>
    <input type="email" class="form-control" id="email" required>
    <label for="password">Password</label>
    <input type="password" class="form-control" id="password" required>
    <p><br></p>
    <a href="#" style="color:white; list-style-type:none;">Forgotten Password?</a>
    <input type="button" class="btn btn-success" style="float:right;" id="login" value="Login">
    </div>
    <div class="panel-footer" id="e-msg"></div>
    </div>
    </div>
    </ul>
    </li>
    <li><a href="#"><span class="glyphicon glyphicon-user"></span> SignUp</a></li>
    </ul>

    </div>
    </div>
    <p><br></p>
    <p><br></p>
    <p><br></p>
    <div class="container-fluid">
    <div class="row">
    <div class="col-md-1"></div>
    <div class="col-md-2">
    <div id="get_category">
    </div>
    <!– <div class="nav nav-pills nav-stacked">
    <li class="active"><a href="#"><h4>Categories</h4></a></li>
    <li><a href="">home</a></li>
    <li><a href="">home</a></li>
    <li><a href="">home</a></li>
    <li><a href="">home</a></li>

    </div>
    –>
    <div class="nav nav-pills nav-stacked">
    <li class="active"><a href="#"><h4>Brand</h4></a></li>
    <li><a href="">Brand 1</a></li>
    <li><a href="">Brand 2</a></li>
    <li><a href="">Brand 3</a></li>
    <li><a href="">Brand 4</a></li>

    </div>
    </div>
    <div class="col-md-8">
    <div class="panel panel-info">
    <div class="panel-heading">Products</div>
    <div class="panel-body">
    <div class="col-md-4">
    <div class="panel panel-info">
    <div class="panel-heading">Dunhill Perfume</div>
    <div class="panel-body">
    <img class="img-responsive" src="product-images/dunhill.jpg" alt="">
    </div>
    <div class="panel-heading">$.500.00
    <button style="float:right;" class="btn btn-danger btn-xs">AddToCart</button>
    </div>
    </div>
    </div>
    </div>
    <div class="panel-footer">&copy; 2017</div>
    </div>
    </div>
    <div class="col-md-1"></div>
    </div>
    </div>
    </body>
    </html>

    ===========================

    Please check and solve my problem. Thanks in advance.

  4. hello sir , when i m doing the same for brands and categories table then no data is fetched from the database and there is no error, so i don't know how to solve this, please help. reply soon

  5. I know how to fix that most common error: put the scripts in index.php in this order and your categories and brands will appear! 😀
    <script type="text/javascript" src="js/jquery2.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="main.js"></script>

  6. hi thanks for the tutorial . i have only 1 problem . i check my database and table info and it s all ok . but when i end to write my action.php and go to refresh my website , i can t see the category database in my site
    ( your tutorial . time : 14:10)

    i hope in your answer .
    thanks

  7. I can't understand, Why we need ajax request to show categories and brands. Can't we just directly fetch and include data directly to the page from database without AJAX??????

  8. I have a question: can we echo the list of category in json and manipulate and render the list using jquery rather than php? or better to say can we use echo to send a json file from php and catch it in success function of ajax?

  9. Hello, friends. I´m having the same problem of some friends here, that my categories and brands disapear, and I don´t know what is happening. The code is the same of de video. Could somebody help me, please? Thanks people. Good Tutorial!!

Leave a Reply

Your email address will not be published. Required fields are marked *