Changeset View
Changeset View
Standalone View
Standalone View
modules/in-commerce/units/orders/orders_event_handler.php
Show First 20 Lines • Show All 541 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
/** @var OrdersItem $object */ | /** @var OrdersItem $object */ | ||||
$object = $event->getObject(); | $object = $event->getObject(); | ||||
if ( $object->HasTangibleItems() ) { | if ( $object->HasTangibleItems() ) { | ||||
if ( $this->Application->GetVar('same_address') ) { | if ( $this->Application->GetVar('same_address') ) { | ||||
// copy shipping address to billing | // copy shipping address to billing | ||||
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | ||||
list($id, $field_values) = each($items_info); | $id = key($items_info); | ||||
$address_fields = Array ( | $address_fields = Array ( | ||||
'To', 'Company', 'Phone', 'Fax', 'Email', | 'To', 'Company', 'Phone', 'Fax', 'Email', | ||||
'Address1', 'Address2', 'City', 'State', | 'Address1', 'Address2', 'City', 'State', | ||||
'Zip', 'Country' | 'Zip', 'Country' | ||||
); | ); | ||||
foreach ($address_fields as $address_field) { | foreach ($address_fields as $address_field) { | ||||
▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Line(s) | |||||
/** | /** | ||||
* Redirect user to Billing checkout step | * Redirect user to Billing checkout step | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
*/ | */ | ||||
function OnProceedToBilling($event) | function OnProceedToBilling($event) | ||||
{ | { | ||||
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | ||||
if ( $items_info ) { | if ( $items_info ) { | ||||
Lint: CodingStandard.WhiteSpace.ControlStructureSpacing.NoLineBeforeOpen: No blank line found before "if" control structure | |||||
list($id, $field_values) = each($items_info); | $id = key($items_info); | ||||
$field_values = $items_info[$id]; | |||||
/** @var kDBItem $object */ | /** @var kDBItem $object */ | ||||
$object = $event->getObject(); | $object = $event->getObject(); | ||||
$payment_type_id = $object->GetDBField('PaymentType'); | $payment_type_id = $object->GetDBField('PaymentType'); | ||||
if ( !$payment_type_id ) { | if ( !$payment_type_id ) { | ||||
$default_type = $this->_getDefaultPaymentType(); | $default_type = $this->_getDefaultPaymentType(); | ||||
▲ Show 20 Lines • Show All 836 Lines • ▼ Show 20 Line(s) | |||||
/** @var OrdersItem $order */ | /** @var OrdersItem $order */ | ||||
$order = $event->getObject(); | $order = $event->getObject(); | ||||
/** @var kCountryStatesHelper $cs_helper */ | /** @var kCountryStatesHelper $cs_helper */ | ||||
$cs_helper = $this->Application->recallObject('CountryStatesHelper'); | $cs_helper = $this->Application->recallObject('CountryStatesHelper'); | ||||
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | ||||
if ($items_info) { | if ($items_info) { | ||||
// updated address available from SUBMIT -> use it | // updated address available from SUBMIT -> use it | ||||
Inline comments must start with a capital letter Lint: CodingStandard.Commenting.InlineComment.NotCapital: Inline comments must start with a capital letter | |||||
Inline comments must end in full-stops, exclamation marks, or question marks Lint: CodingStandard.Commenting.InlineComment.InvalidEndChar: Inline comments must end in full-stops, exclamation marks, or question marks | |||||
list($id, $field_values) = each($items_info); | $field_values = current($items_info); | ||||
} | } | ||||
else { | else { | ||||
// no updated address -> use current address | // no updated address -> use current address | ||||
$field_values = Array ( | $field_values = Array ( | ||||
'ShippingCountry' => $order->GetDBField('ShippingCountry'), | 'ShippingCountry' => $order->GetDBField('ShippingCountry'), | ||||
'BillingCountry' => $order->GetDBField('BillingCountry'), | 'BillingCountry' => $order->GetDBField('BillingCountry'), | ||||
'PaymentType' => $order->GetDBField('PaymentType'), | 'PaymentType' => $order->GetDBField('PaymentType'), | ||||
); | ); | ||||
▲ Show 20 Lines • Show All 2572 Lines • Show Last 20 Lines |
No blank line found before "if" control structure