Question: You have been provided with an HTML file ( Chapter11-project2.html ) that includes all the necessary markup. Save this file as Chapter11-project2.php . Move the
You have been provided with an HTML file (Chapter11-project2.html) that includes all the necessary markup. Save this file as Chapter11-project2.php.
Move the header and the
Examine and then include the provided data.inc.php file. This file contains PHP variables that you will use below.
Use a for loop to output the list in the My Orders area (see Figure 11.18 ).
Create a function called outputOrderRow() that has the following signature:
function outputOrderRow($file, $title, $quantity, $price) { } Implement the body of the outputOrderRow() function. It should echo the passed information as a table row. Use the number_format() function to format the currency values with two decimal places. Calculate the value for the amount column.
Replace the four cart table rows in the original with the following calls:
outputOrderRow($file1, $product1, $quantity1, $price1); outputOrderRow($file2, $product2, $quantity2, $price2);
Calculate the subtotal, shipping, and grand total using PHP. Replace the hard-coded values with your variables that contain the calculations. The shipping value will be $200 unless the subtotal is above $10,000, in which case it will be $100.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
