Prev | Current Page 716 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

const.CUSTOMER_SERVICE_EMAIL}">
{$smarty.const.CUSTOMER_SERVICE_EMAIL}


4. Add the following methods in the Link class from the presentation/link.php file:
// Creates a link to the order done page
public static function ToOrderDone()
{
return self::Build('order-done/');
}
// Creates a link to the order error page
public static function ToOrderError()
CHAPTER 19 ?–  IMPLEMENTING THE ORDER PIPELINE: PART 2 612
{
return self::Build('order-error/');
}
5. Open the .htaccess file from the project root folder, and add the highlighted rewrite rules:
# Rewrite checkout pages
RewriteRule ^checkout/?$ index.php?Checkout [L]
# Rewrite order done pages
RewriteRule ^order-done/?$ index.php?OrderDone [L]
# Rewrite order error pages
RewriteRule ^order-error/?$ index.php?OrderError [L]

# Set the default 500 page for Apache errors
ErrorDocument 500 /tshirtshop/500.php
6. Now, modify the CheckRequest() method from the Link class found in the presentation/link.php
file, adding the highlighted code:
// Redirects to proper URL if not already there
public static function CheckRequest()
{
$proper_url = '';
if (isset ($_GET['Search']) || isset($_GET['SearchResults']) ||
isset ($_GET['CartAction']) || isset ($_GET['AjaxRequest']) ||
isset ($_POST['Login']) || isset ($_GET['Logout']) ||
isset ($_GET['RegisterCustomer']) ||
isset ($_GET['AddressDetails']) ||
isset ($_GET['CreditCardDetails']) ||
isset ($_GET['AccountDetails']) || isset ($_GET['Checkout']) ||
isset ($_GET['OrderDone']) || isset ($_GET['OrderError']))
{
return ;
}
// Obtain proper URL for category pages
elseif (isset ($_GET['DepartmentId']) && isset ($_GET['CategoryId']))
7.


Pages:
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728
pokoje nad morzem tanio pomiary wiatru hotel kredyt samochodowy santander remont warszawa