tpl';
// Define the template file for the categories cell
public $mCategoriesCell = 'blank.tpl';
// Define the template file for the cart summary cell
public $mCartSummaryCell = 'blank.tpl';
// Define the template file for the login or logged cell
public $mLoginOrLoggedCell = 'customer_login.tpl';
// Page title
public $mPageTitle;
// PayPal continue shopping link
public $mPayPalContinueShoppingLink;
16. Modify the init() method of the StoreFront class by adding the new interface elements at the end of
the method:
// Load shopping cart or cart summary template
if (isset ($_GET['CartAction']))
$this->mContentsCell = 'cart_details.tpl';
else
$this->mCartSummaryCell = 'cart_summary.tpl';
if (Customer::IsAuthenticated())
$this->mLoginOrLoggedCell = 'customer_logged.tpl';
if (isset ($_GET['RegisterCustomer']) ||
isset ($_GET['AccountDetails']))
$this->mContentsCell = 'customer_details.tpl';
elseif (isset ($_GET['AddressDetails']))
$this->mContentsCell = 'customer_address.tpl';
CHAPTER 16 ?– MANAGING CUSTOMER DETAILS 528
elseif (isset ($_GET['CreditCardDetails']))
$this->mContentsCell = 'customer_credit_card.tpl';
// Load the page title
$this->mPageTitle = $this->_GetPageTitle();
}
17. Modify the same init() method of the StoreFront class again:
public function init()
{
$_SESSION['link_to_store_front'] =
Link::Build(str_replace(VIRTUAL_LOCATION, '', getenv('REQUEST_URI')));
// Build the "continue shopping" link
if (!isset ($_GET['CartAction']) && !isset($_GET['Logout']) &&
!isset($_GET['RegisterCustomer']) &&
!isset($_GET['AddressDetails']) &&
!isset($_GET['CreditCardDetails']) &&
!isset($_GET['AccountDetails']))
$_SESSION['link_to_last_page_loaded'] = $_SESSION['link_to_store_front'];
// Build the "cancel" link for customer details pages
if (!isset($_GET['Logout']) &&
!isset($_GET['RegisterCustomer']) &&
!isset($_GET['AddressDetails']) &&
!isset($_GET['CreditCardDetails']) &&
!isset($_GET['AccountDetails']))
$_SESSION['customer_cancel_link'] = $_SESSION['link_to_store_front'];
// Load department details if visiting a department
if (isset ($_GET['DepartmentId']))
18.
Pages:
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640