Jump to content

Niksou

New Members
  • Posts

    9
  • Joined

  • Last visited

Niksou's Achievements

Member

Member (2/5)

0

Reputation

  1. < <h3>Order Details</h3> <div class="table-responsive"> <table class="table table-bordered"> <tr> <th width="40%">Item Name</th> <th width="10%">Quantity</th> <th width="20%">Price</th> <th width="15%">Total</th> </tr> <?php $total=0; $itemCount=0; $first=false; for($i=0;$i<6;$i++) { $title = ($_POST['hidden_name'.$i]); $price = ($_POST['hidden_price' . $i]); $quantity = ($_POST['quantity' . $i]); ?> <?php if($quantity>0){ $shortStr= substr($price,1,-1); $flatVal=(float)$shortStr; $flatVal=$flatVal*$quantity; $totalItem=$flatVal*$quantity; $total+=$flatVal; ?> <tr> <td><?php echo $title; ?></td> <td><?php echo $quantity; ?></td> <td> <?php echo $price; ?></td> <td> <?php echo $totalItem;?></td> <td> </tr> <?php } if($i==5){ echo"Order total : $total"; } } ?> <br> <br> <br> >
  2. hello , Im working on a fictional web-site as a final project for my course. Im having a little trouble with placing php includes in my page and also printing the total sum of my order. also im not sure how or where to place the order now button in order.php'\. here is my git , most of the necessery code if found in order.php https://github.com/niksou/ProjectWeb
  3. also in the header part I have this function :written in js function updateSum(price) { $('#sum').innerText = parseInt($('#sum').innerText) + price } that supposed to update the sum here in header part : Total:<span id="sum"></span>$ but for some reason nothing changes
  4. this is not supposed to be secured web-site , only small project that i have. will be gratfull if you show me how to.
  5. hello , sorry for my inexperience in forums, any way here is my git will all the code , https://github.com/niksou/Web-site display cart 0 means that i add the item (id=0) to cart using js, the post data i need to send is product name price and quantity to to cart page which will be a seperate page that displays all added to cart items withtheir amount and their total price. im not sure where or how to place the form that will add the items to my cart using post method. in general , just send the items from my cart to the cart.php page
  6. Update: done with the echo in loop..now only the form thingy and that's it!!
  7. Trying this to print the items but no help
  8. Ok sounds good my friend so here is an example for one item from my store ' all the other items are alike, also here is my array the I want to use in order to echo the items in my store , I just noticed that i said table but i meant form, what I need to do is make a form in a sepperate php file that will have only quantity of each item and later on will send it to my shopping cart with post request. sorry for my bad english , I can explain myself better if needed. in the last picture is my website i need to change the add to cart button to quantity and in the bottom of the page add button purchase that will send me to my cart with the items selected.
  9. Hello, I'm a cs student (2nd year) this year has been a disaster for us the students(studying over zoom and shit), I have a tiny tiny project that a have to finish in the next 24 hours, we made a small sample website using html and js, and now we need to switch it to php language and make the site responsive and later on add SQL. I would very much appreciate if someone can help me for couple of minutes over zoom and help me complete it. All I have left is echo the products from an array with a loop and make a php table that will put my items to my cart. It's my first time here..hope there is some good people here
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.