Part One
Part Two
Part Three
Part Four
Part Five

Tonight’s the night I turn in this project! I’m glad, because I’m definitely feeling a bit worn down. I’ve spent the past hour or so doing minor styling and bugfixes. However, the biggest problem I’ve run into is that the production server, RIT’s NOVA, is being generally terrible. So I’ve decided to host it on my samjhill.com Amazon Web Services cloud server. Hopefully, the professor won’t deduct too many points.

Demo Site

For some reason, after I transferred the database and code to my server, I’ve been having trouble adding products to my cart from the catalog. Turns out that I’ve been parsing the item id’s incorrectly this whole time, and I found a quick and simple fix.
[php]
$data = $_REQUEST[‘data’]; //getting the data from the ajax call
$data = explode(‘,’, $data); //convert it to an array
[/php]

Since the project requirements call for at least 3 items on sale at a time, I have the admin page displaying this message:
[php]
if( sizeOf($saleProducts = getSaleProducts()) < 3){ // too few, show an error
echo "<div class=’alert alert-danger fade in’ role=’alert’>You must put an additional " . (intval(3) – intval($saleProducts)) ." products on sale.<button type=’button’ class=’close’ data-dismiss=’alert’><span aria-hidden=’true’>x</span><span class=’sr-only’>Close</span></button></div>";
}
if( sizeOf($saleProducts = getSaleProducts()) > 5){ //too many, show an error
echo "<div class=’alert alert-danger fade in’ role=’alert’>You have " . (intval($saleProducts) – intval(5)) ." too many products on sale.<button type=’button’ class=’close’ data-dismiss=’alert’><span aria-hidden=’true’>x</span><span class=’sr-only’>Close</span></button></div>";
}
?>
[/php]

All that’s left to do is to password-protect the administration page. Simple enough.

Leave a Reply

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