..
if(isset ($_POST['place_order']))
{
// Create the order and get the order ID
$order_id = ShoppingCart::CreateOrder();
// This will contain the PayPal link
$redirect =
PAYPAL_URL . '&item_name=TShirtShop Order ' .
urlencode('#') . $order_id .
'&item_number=' . $order_id .
'&amount=' . $this->mTotalAmount .
'¤cy_code=' . PAYPAL_CURRENCY_CODE .
'&return=' . PAYPAL_RETURN_URL .
'&cancel_return=' . PAYPAL_CANCEL_RETURN_URL;
// Redirection to the payment page
header('Location: ' . $redirect);
exit();
}
// We allow placing orders only if we have complete customer details
if (empty ($this->mCustomerData['credit_card']))
{
$this->mOrderButtonVisible = 'disabled="disabled"';
$this->mNoCreditCard = 'yes';
}
CHAPTER 16 ?– MANAGING CUSTOMER DETAILS 533
else
{
$this->mPlainCreditCard = Customer::DecryptCreditCard(
$this->mCustomerData['credit_card']);
$this->mCreditCardNote = 'Credit card to use: ' .
$this->mPlainCreditCard['card_type'] .
'
Card number: ' .
$this->mPlainCreditCard['card_number_x'];
}
if (empty ($this->mCustomerData['address_1']))
{
$this->mOrderButtonVisible = 'disabled="disabled"';
$this->mNoShippingAddress = 'yes';
}
else
{
$shipping_regions = Customer::GetShippingRegions();
foreach ($shipping_regions as $item)
if ($item['shipping_region_id'] ==
$this->mCustomerData['shipping_region_id'])
$this->mShippingRegion = $item['shipping_region'];
}
}
}
?>
3.
Pages:
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644