PHP MySQL Ecommerce Web Design Part 8



Postingan saya kali ini adalah membuat halaman clothing_cart.php beserta file-file pendukungnya

1. Buat file .PHP dengan nama clothing_cart.php di D:\TUTOR WEB\RIANKLIK\
Buka Notepad++, pilih File, klik Open, cari file clothing_cart.php di D:\TUTOR WEB\RIANKLIK\. Isikan sama seperti script warna biru di bawah lalu jangan lupa di-save :


<?php
session_start(); //start session first thing in script
// Connect to the mySQL database
include "phpScripts/connect_to_mysql.php";
?>

<?php
// Error Reporting
error_reporting(E_ALL);
ini_set('display_errors','1');
?>

<?php
// SECTION 1 (if user attempt to add something to the cart from the product page)
if(isset($_POST['pid'])){
    $pid=$_POST['pid'];
    $wasFound=false;
    $i=0; // create a varible that will tell us how many items we looped over
    // if the cart session variable is not set or cart array is empty
    if(!isset($_SESSION["cart_array"])||count($_SESSION["cart_array"])<1){
        // RUN IF THE CART IS EMPTY OR NOT SET
        $_SESSION["cart_array"]=array(0=>array("item_id"=>$pid,"quantity"=>1));
    }else{
        //RUN IF THE CART HAS AT LEAST ONE ITEM IN IT
        foreach($_SESSION["cart_array"]as $each_item){
            $i++;
            while(list($key, $value)= each($each_item)){
                if($key == "item_id" && $value == $pid){
                    // that item is in cart already so lets adjust its quantity
                    // using array_splice()
                    // dinonaktifkan agar jangan menambahkan item langsung dari product.php
                    // jika di clothing_cart.php sudah ada sehingga qty bisa di kontrol
                   
                    //array_splice($_SESSION["cart_array"], $i-1, 1,
                    //array(array("item_id" =>$pid, "quantity" =>$each_item['quantity'] + 1)));
                    $wasFound=true;
                }    // closing if ...   
            } // closing while ...
        } // closing foreach ...
        if ($wasFound == false){
            array_push($_SESSION["cart_array"], array("item_id" => $pid, "quantity" => 1));               
        } //  closing if ...   
    } // closing
            header("location: clothing_cart.php");
            exit();
} // closing if ...
?>

<?php
// SECTION 2 (if user chooses to empty their shopping cart)
if (isset ($_GET['cmd']) && $_GET['cmd'] == "emptycart"){
    unset ($_SESSION["cart_array"]);
    }
?>

<?php
// SECTION 3 (if user chooses to adjust item quantity)--->
if (isset ($_POST['item_to_adjust']) && $_POST['item_to_adjust'] != ""){
    // Execute some code
    $item_to_adjust=$_POST['item_to_adjust'];
    $quantity=$_POST['quantity'];
    // filter everything but numbers
    $quantity=preg_replace('#[^0-9]#i','',$quantity);
    // adjust qty per item maksimal= 5
    if($quantity >= 5){$quantity=5;}
    if($quantity <1){$quantity=1;}
    $i=0;
    foreach($_SESSION["cart_array"]as $each_item){
        $i++;
        while(list($key, $value)= each($each_item)){
            if($key == "item_id" && $value == $item_to_adjust){
            // that item is in cart already so lets adjust its quantity
            // using array_splice()
                array_splice($_SESSION["cart_array"], $i-1, 1,
                array(array("item_id" =>$item_to_adjust, "quantity" =>$quantity)));
            }    // closing if ...
        } // closing while ...
    } // closing foreach ...
} // closing if
?>

<?php
// SECTION 4 (if user want to remove an item from cart)
if (isset($_POST['index_to_remove']) && $_POST['index_to_remove']!=""){
    // Access the array and run code to remove that array index
    $key_to_remove =$_POST['index_to_remove'];
    if(count($_SESSION["cart_array"])<= 1){
        unset($_SESSION["cart_array"]);
    }else{
        unset($_SESSION["cart_array"]["$key_to_remove"]);
        sort($_SESSION["cart_array"]);
    } // closing if ...
} // closing if ...
?>

<?php
// SECTION 5 (render the cart for the user to view)
$cartOutput = "";
$cartTotal = "";
$totalItem = "";
$totalQuantity = "";
if(!isset($_SESSION["cart_array"]) || count ($_SESSION["cart_array"]) < 1) {
    $cartOutput = "<h3 align='center' style='color:blue'>
    Shopping Cart Anda Kosong</h3>";
} else {
    $i = 0;
    foreach ($_SESSION["cart_array"] as $each_item) {
        $item_id=$each_item['item_id'];
          $sqlStock=mysql_query("SELECT*FROM clothingStock
        WHERE stock_id='$item_id' LIMIT 1");
        while($row=mysql_fetch_array($sqlStock)) {
            $product_nameS=$row["product_name"];
            $colorS=$row["color"];
            $sizeS=$row["size"];
            $stock_amount0=$row["stock_amount"];
        }
        //////////////// RATING & STAR /////////////////////////
        include("clothing_cart_starRating.php");
        //////////////END of RATING & STAR /////////////////////
        $sqlProd=mysql_query("SELECT*FROM clothing
        WHERE product_name='$product_nameS' LIMIT 1");
        $productCount=mysql_num_rows($sqlProd); // count the output amount
        if($productCount>0){
            while($row=mysql_fetch_array($sqlProd)) {
                $id=$row["id"];
                $product_price=$row["product_price"];
                $product_brand=$row["product_brand"];
                $category=$row["category"];
                $subcategory=$row["subcategory"];
                $product_details=$row["product_details"];
                $type=$row["type"];
                $bahan=$row["bahan"];
            } // closing while ...
        } // closing if ...
        // Menampilkan total harga dari satu item
        $total_price=$product_price*$each_item['quantity'];
        // Menampilkan total harga dari beberapa item               
        $cartTotal=$total_price+$cartTotal;   
        // Dynamic table row assembly
        $cartOutput .='<div class="row">';
        ////////////////// view RATING & STAR ///////////////////////////
        include("clothing_cartStar_img.php");
        /////////////// END view RATING & STAR //////////////////////////       
           
        $cartOutput .='<div class="box2">'.$product_details.'</div>';
        $cartOutput .='<div class="box3">       
            Rp&nbsp'.number_format($product_price,0,',','.').'
        </div>';
        $cartOutput .='<div class="box4">       
            <form action="clothing_cart.php" method="post">
            <input name="quantity" type="text"
            value="'. $each_item['quantity'].'" size="1" maxlength="2" />
            <input name="adjustBtn'.$item_id.'" type="submit" value="OK" />
            <input name="item_to_adjust" type="hidden" value="'.$item_id.'" />
            </form>
        </div>';
        $cartOutput .='<div class="box5">
            Rp&nbsp'.number_format ($total_price,0,',','.').'
        </div>';
        $cartOutput .='<div class="box6">
            <form action="clothing_cart.php" method="post">
            <input name="deleteBtn'.$item_id.'" type="submit" value="x" />
            <input name="index_to_remove" type="hidden" value="'.$i.'" />
            </form>
        </div>';
        $cartOutput .='</div>';
               
        $i ++;
    }// closing foreach ...
    $cartTotal=number_format($cartTotal,0,',','.');
    // this for counting total all price in the shopping cart
    $_SESSION["cartTotal"]=$cartTotal;
    // for total number of item(product) selected in the shopping cart
       $item =$i ;
    $totalItem = $totalItem + $item;
    $_SESSION["totalItem"]=$totalItem;
    // untuk total quantity for all item:
    $totalQuantity = 0;
    if(isset($_SESSION['cart_array']) AND is_array(@$_SESSION['cart_array'])){
        foreach($_SESSION['cart_array'] AS $each_item){
            $totalQuantity =$totalQuantity + $each_item['quantity'];
        } // closing foreach ...
    } // closing if ...
    $_SESSION["totalQuantity"]=$totalQuantity;
} // closing if ...
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Clothing Cart</title>
<!---------------------- LINK -------------------------->
    <?php include_once("template_links_head.php"); ?>
<!---------------------- END of LINK --------------------->

<!---------------------- LINK FREE BEAVER SLIDER -------------------------->
    <?php include_once("template_js_beaverSlider_slideshow.php"); ?>
<!--------------- END of LINK FREE BEAVER SLIDER -------------------------->

</head>
<body>
<div id="wrapper">
    <div id="header_wrap">
           <div id="header">
            <?php include_once("template_clothingHeader.php"); ?>
        </div> <!----closing header------>
            <?php include_once("clothing_searchWrap.php"); ?>
    </div> <!----closing header_wrap------>
       
    <div id="contentCart">
        <center><h2>SHOPPING CART</h2></center>
       
        <div class="descrow" style="font-weight:bold">
            <div class="descbox1">Product</div>
            <div class="descbox2">Product Description</div>
            <div class="descbox3">Price</div>
            <div class="descbox4">Qty</div>
            <div class="descbox5">Total Price</div>
            <div class="descbox6">Remove</div>
        </div>
   
        <?php echo $cartOutput;?>
        
        <?php
        if (!empty($_SESSION['cart_array'])){
        ?>
              <div class="subtotalrow" style="font-size:15px; font-family:'Trebuchet MS',
            Arial, Helvetica, sans-serif; font-weight:bold">
                <div class="subtotalbox3">Sub Total Belanja&nbsp;:&nbsp;</div>
                <div class="subtotalbox5">
                    <?php
                        if (!empty($_SESSION['cart_array'])){
                          echo 'Rp&nbsp'.$cartTotal;
                        }else{
                          echo "";
                        }
                    ?>
                </div>
                <div class="subtotalbox6">    </div>
            </div>
                   
        <?php
        }else{
        ?>
              
        <?php
        }
        ?>
        <br />
        <a href="index.php"><input name="Continue" type="button" value="Continue Shopping"
        style="font-size:15px; font-family:'Trebuchet MS', Arial, Helvetica, sans-serif"/></a>
        &nbsp;&nbsp;
        <a href="#" ><input name="clearCart" type="button" value="Clear Cart"
        style="font-size:15px; font-family:'Trebuchet MS', Arial, Helvetica, sans-serif"
        onclick="if (confirm('Yakin ingin menghapus isi keranjang?')) window.location =
        'clear_clothing_cart.php'"/></a>
        &nbsp;&nbsp;
        <?php
        if (!isset($_SESSION['manager'])){
        ?>
            <a href="#" >
            <button onclick="if (confirm('Login dulu baru pesan!'))
            window.location = 'customer_login.php'">
            <span style="color:#F00; font-size:15px; font-family:'Trebuchet MS',
            Arial, Helvetica, sans-serif">Login Dulu!</span>
            </button>
            </a>
        <?php
        }else{
        ?>
               <a href="clothing_billing.php">
            <input name="placeOrder" type="button" value="Pesan" style="font-size:15px;
            font-family:'Trebuchet MS', Arial, Helvetica, sans-serif"/></a>
        <?php
        }
        ?>
    </div> <!----closing contentCart------>  

    <div id="footer">
        <?php include_once("template_footer.php"); ?>
    </div> <!----closing footer------>

</div> <!----closing wraper------>
<?php include_once("template_js_body.php"); ?>
</body>
</html>


2. Buat file .PHP dengan nama clothing_cart_starRating.php di D:\TUTOR WEB\RIANKLIK\
Buka Notepad++, pilih File, klik Open, cari file clothing_cart_starRating.php di D:\TUTOR WEB\RIANKLIK\. Isikan sama seperti script warna biru di bawah lalu jangan lupa di-save :

<?php
$sqltotalSale = mysql_query("SELECT*FROM clothingTotalSales
WHERE stock_id='$item_id' AND product_name='$product_nameS'
AND color='$colorS' AND size='$sizeS'");
while($row=mysql_fetch_array($sqltotalSale)){
    // tambahan untuk hilangkan error saat tabel kosong
    if (!empty($sqltotalSale)){               
        $quantity=$row["quantity"];
    }
    if ($quantity >=0 && $quantity <=10){
           $sqlStar = mysql_query("SELECT * FROM starRating
        where rating='0-10'");
        while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else
    if ($quantity >=11 && $quantity <=20){
        $sqlStar = mysql_query("SELECT * FROM starRating
        where rating='11-20'");
            while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else
    if ($quantity >=21 && $quantity <=30){
        $sqlStar = mysql_query("SELECT * FROM starRating
        where rating='21-30'");
        while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else
    if ($quantity >=31 && $quantity <=40){
        $sqlStar = mysql_query("SELECT * FROM starRating
        where rating='31-40'");
        while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else
    if ($quantity >=41 && $quantity <=50){
        $sqlStar = mysql_query("SELECT * FROM starRating
        where rating='41-50'");
        while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else
    if ($quantity >=51 && $quantity <=60){
        $sqlStar = mysql_query("SELECT * FROM starRating
        where rating='51-60'");
        while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else
    if ($quantity >=61 && $quantity <=70){
        $sqlStar = mysql_query("SELECT * FROM starRating
        where rating='61-70'");
        while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else
    if ($quantity >=71 && $quantity <=80){
        $sqlStar = mysql_query("SELECT * FROM starRating
        where rating='71-80'");
        while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else
    if ($quantity >=81 && $quantity <=90){
        $sqlStar = mysql_query("SELECT * FROM starRating where rating='81-90'");
        while($row=mysql_fetch_array($sqlStar)){
        if (!empty($sqlStar)){       
        $s_id=$row["s_id"];
        }
        }   
   
    }else
    if ($quantity >=91 && $quantity <=100){
        $sqlStar = mysql_query("SELECT * FROM starRating where rating='91-100'");
        while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else
    if ($quantity >=101){
        $sqlStar = mysql_query("SELECT * FROM starRating where rating='>101'");
        while($row=mysql_fetch_array($sqlStar)){
            if (!empty($sqlStar)){       
                $s_id=$row["s_id"];
            }
        }   
    }else{
   
    }// closing if ...   
} // closing while ...

?>

3. Buat file .PHP dengan nama clothing_cartStar_img.php di D:\TUTOR WEB\RIANKLIK\
Buka Notepad++, pilih File, klik Open, cari file clothing_cartStar_img.php di D:\TUTOR WEB\RIANKLIK\. Isikan sama seperti script warna biru di bawah lalu jangan lupa di-save :

<?php   
if (!empty($sqlStar)){
    // memeriksa apa ada product_name di dalam tabel clothingTotalSales
    $sqlCheck1=mysql_query("SELECT sale_id FROM clothingTotalSales
    WHERE product_name='$product_nameS' LIMIT 1");
    $productMatch=mysql_num_rows($sqlCheck1); // Count the output amount
    if($productMatch > 0){
        $cartOutput .=
        '<div class="box1">
            <div style="padding-bottom:10px; font-size:20px">               
                <a href="clothing_prod.php?id='.$id.'">'.$product_nameS.'</a><br/>
            </div>   
            <a href="clothing_stock_images1/'.$item_id.'.jpg" class="swipebox"
            title="<h2>'.$product_nameS.',&nbsp;'.$colorS.'</h2>  ">
            <img class="one-edge-shadow" data-alt-src="clothing_stock_images2/'.$item_id.'.jpg"
            src="clothing_stock_images1/'.$item_id.'.jpg" alt="'.$colorS.'" width="130" height="130"
            style="border-color:#D6D6F3; border-style:solid; border-width:1px" />
            </a>
           
            <div style="padding-top:5px; padding-bottom:5px">
                <img src="star_images/'.$s_id.'.svg" width="100" height="20"/>
            </div>
                   
            <div class="overlaybox1">
                <div style="float: left">
                    <font color="#000000" style="font-size:13px;
                    font-style:italic">
                    '.$product_brand.'&nbsp;'.$category.' &nbsp; '.$type.'
                    &nbsp;'.$subcategory.'        
                    </font>
                    <br />   
                    <font color="#000000" style="font-size:13px;
                    font-style:italic">
                    Color:&nbsp;'.$colorS.'
                    <br />
                    Size:&nbsp;'.$sizeS.'
                    </font>
                    <br/>
                </div>
            </div>
        </div>';
    }else {
        $cartOutput .=
        '<div class="box1">
            <div style="padding-bottom:10px; font-size:20px">               
                <a href="clothing_prod.php?id='.$id.'">'.$product_nameS.'</a><br/>
            </div>   
            <a href="clothing_stock_images1/'.$item_id.'.jpg" class="swipebox"
            title="<h2>'.$product_nameS.',&nbsp;'.$colorS.'</h2>  ">
            <img class="one-edge-shadow" data-alt-src="clothing_stock_images2/'.$item_id.'.jpg"
            src="clothing_stock_images1/'.$item_id.'.jpg" alt="'.$colorS.'" width="130" height="130"
            style="border-color:#D6D6F3; border-style:solid; border-width:1px" />
            </a>
           
            <div class="overlaybox1">
                <div style="float: left">
                    <font color="#000000" style="font-size:13px; font-style:italic">
                    '.$product_brand.'&nbsp;'.$category.' &nbsp; '.$type.'
                    &nbsp;'.$subcategory.'        
                    </font>
                    <br />   
                    <font color="#000000" style="font-size:13px;
                    font-style:italic">
                    Color:&nbsp;'.$colorS.'
                    <br />
                    Size:&nbsp;'.$sizeS.'
                    </font>
                    <br/>
                </div>
            </div>
        </div>';
    }
}else {
    $cartOutput .=
    '<div class="box1">
        <div style="padding-bottom:10px; font-size:20px">               
            <a href="clothing_prod.php?id='.$id.'">'.$product_nameS.'</a><br/>
        </div>   
   
        <a href="clothing_stock_images1/'.$item_id.'.jpg" class="swipebox"
        title="<h2>'.$product_nameS.',&nbsp;'.$colorS.'</h2>  ">
        <img class="one-edge-shadow" data-alt-src="clothing_stock_images2/'.$item_id.'.jpg"
        src="clothing_stock_images1/'.$item_id.'.jpg" alt="'.$colorS.'" width="130" height="130"
        style="border-color:#D6D6F3; border-style:solid; border-width:1px" />
        </a>
               
        <div class="overlaybox1">
            <div style="float: left">
                <font color="#000000" style="font-size:13px; font-style:italic">
                '.$product_brand.'&nbsp;'.$category.' &nbsp; '.$type.'
                &nbsp;'.$subcategory.'        
                </font>
                <br />   
                <font color="#000000" style="font-size:13px; font-style:italic">
                Color:&nbsp;'.$colorS.'
                <br />
                Size:&nbsp;'.$sizeS.'
                </font>
                <br/>
            </div>
        </div>
    </div>';
} // closing if ...
?>


4. Buat file .PHP dengan nama clear_clothing_cart.php di D:\TUTOR WEB\RIANKLIK\
Buka Notepad++, pilih File, klik Open, cari file clear_clothing_cart.php di D:\TUTOR WEB\RIANKLIK\. Isikan sama seperti script warna biru di bawah lalu jangan lupa di-save :

<?php
session_start();
unset ($_SESSION["cart_array"]);
unset ($_SESSION["cartTotal"]);
unset ($_SESSION["totalItem"]);
unset ($_SESSION["totalQuantity"]);
header('location:clothing_cart.php');
// use below instead of header('location:index.php');
// if you want to see logged out message
// print "You have been logged out. <a href='index.php'>Go back</a>";
?>


5. Buka Notepad++, pilih File, klik Open, cari file style.php di dalam folder styleCSS. Isikan sama seperti script warna biru di bawah lalu jangan lupa di-save :

/*------------------------- cart ------------------ */
#contentCart {
    margin-right: auto;
    margin-left: auto;
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    overflow: hidden;
    width: 898px;
    position: relative;
    display: block;
    padding: 30px;
    border: 1px solid #CCC;
    background-color: #FFF;
}
.descrow {
    width: 900px;
    float: left;
    margin-right: auto;
    margin-left: auto;
    position: relative;
    height: 35px;
}
.descbox1 {
    margin: 0px;
    padding: 2px;
    float: left;
    height: 30px;
    width: 235px;
    text-align: center;
    background-color: #ecf0f1;
    border-top-width: 0px;
    border-right-width: 0px;
    border-bottom-width: 0px;
    border-left-width: 0px;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: solid;
    border-left-style: none;
    border-bottom-color: #CCC;
}
.descbox2 {
    margin: 0px;
    float: left;
    height: 30px;
    width: 305px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #CCC;
    text-align: center;
   
    padding: 2px;
    background-color: #ecf0f1;
}
.descbox3 {
    text-align: center;
    margin: 0px;
    padding: 2px;
    float: left;
    height: 30px;
    width: 100px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #CCC;
    background-color: #ecf0f1;
}
.descbox4 {
    text-align: center;
    margin: 0px;
    padding: 2px;
    float: left;
    height: 30px;
    width: 43px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #CCC;
   
    background-color: #ecf0f1;
   
   
}
.descbox5 {
    text-align: center;
    margin: 0px;
    padding: 2px;
    float: left;
    height: 30px;
    width: 120px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #CCC;
    background-color: #ecf0f1;
   
}
.descbox6 {
    text-align: center;
    margin: 0px;
    padding: 2px;
    float: left;
    height: 30px;
    width: 60px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #CCC;
    vertical-align: middle;
    background-color: #ecf0f1;
}
.row {
    width: 887px;
    float: left;
    margin-right: auto;
    margin-left: auto;
    height: 340px;
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: #F00;
}

.box1 {
    margin: 0px;
    padding: 2px;
    float: left;
    height: 315px;
    width: 235px;
    text-align: center;
    position: relative;
}

.overlaybox1 {
    margin: 0px;
    height: 90px;
    width: 225px;
    text-align: left;
    float: right;
    position: relative;
    padding-top: 5px;
    padding-right: 5px;
    padding-bottom: 5px;
    padding-left: 5px;
}

.box2 {
    margin: 0px;
    float: left;
    height: 50px;
    width: 305px;
    text-align: center;
    padding-top: 10px;
    padding-right: 2px;
    padding-bottom: 2px;
    padding-left: 2px;
   
}
.box3 {
    text-align: center;
    margin: 0px;
    float: left;
    height: 50px;
    width: 100px;
    padding-top: 10px;
    padding-right: 2px;
    padding-bottom: 2px;
    padding-left: 2px;
}
.box4 {
    text-align: center;
    margin: 0px;
    float: left;
    height: 50px;
    width: 43px;
    padding-top: 10px;
    padding-right: 2px;
    padding-bottom: 2px;
    padding-left: 2px;
}
.box5 {
    text-align: center;
    margin: 0px;
    float: left;
    height: 50px;
    width: 120px;
    padding-top: 10px;
    padding-right: 2px;
    padding-bottom: 2px;
    padding-left: 2px;
}
.box6 {
    text-align: center;
    margin: 0px;
    float: left;
    height: 50px;
    width: 60px;
    vertical-align: middle;
    padding-top: 10px;
    padding-right: 2px;
    padding-bottom: 2px;
    padding-left: 2px;
}
.subtotalrow {
    width: 900px;
    float: left;
    margin-right: auto;
    margin-left: auto;
    position: relative;
    height: 35px;
}
.subtotalbox3 {
    text-align: right;
    margin: 0px;
    padding: 2px;
    float: left;
    height: 30px;
    width: 699px;
    background-color: #ecf0f1;
}
.subtotalbox5 {
    text-align: center;
    margin: 0px;
    padding: 2px;
    float: left;
    height: 30px;
    width: 120px;
    background-color: #ecf0f1;
}
.subtotalbox6 {
    text-align: center;
    margin: 0px;
    float: left;
    height: 30px;
    width: 60px;
    vertical-align: middle;
    background-color: #ecf0f1;
    padding: 2px;
}


6. Upload semua file ke web server
7. Buka dengan browser 192.168.88.111, pada halaman index.php pilih Pria, klik Pakaian, kemudian pilih RK_00001 pilih color dan size kemudian klik ADD TO CART


Untuk melanjutkan proses belanja, Login terlebih dahulu. Jika sudah Register, klik Login yang ada pada bagian atas (header), Name: jakablack Password: 654321 lalu klik Login


 




Di header kini muncul ikon keranjang belanja, disebelah kanannya adalah jumlah item dan disebelah kanannya lagi adalah total harganya.
Klik ikon keranjang belanja untuk menuju ke halaman clothing_cart.php






Inilah halaman clothing_cart.php jika sudah login. Untuk menambah belanjaan cari lagi di halaman mensClothing.php. Jika sudah cukup klik tombol Pesan

Comments

Popular posts from this blog

Sepuluh Langkah Membuat Warnet