encoder();
/** client/html/common/address/billing/disable-new
* Disables the billing address form for a new address
*
* Normally, customers are allowed to enter a different billing address in the
* checkout process that is only stored along with the current order. Registered
* customers also have the possibility to change their current billing address
* but this updates the existing one in their profile.
*
* You can disable the address form for the new billing address by this setting
* if it shouldn't be allowed to enter a different billing address.
*
* @param boolean True to disable the "new billing address" form, false to allow a new address
* @since 2014.03
* @category Developer
* @category User
* @see client/html/common/address/delivery/disable-new
*/
$disablenew = $this->config( 'client/html/common/address/billing/disable-new', false );
try {
$addrArray = $this->standardBasket->getAddress( MShop_Order_Item_Base_Address_Abstract::TYPE_PAYMENT )->toArray();
} catch( Exception $e ) {
$addrArray = array();
}
$billingDefault = ( isset( $this->addressCustomerItem ) ? $this->addressCustomerItem->getId() : 'null' );
$billingOption = $this->param( 'ca_billingoption', ( isset( $addrArray['order.base.address.addressid'] ) && $addrArray['order.base.address.addressid'] != '' ? $addrArray['order.base.address.addressid'] : $billingDefault ) );
$billingSalutations = $this->get( 'billingSalutations', array() );
$billingCountries = $this->get( 'addressCountries', array() );
$billingStates = $this->get( 'addressStates', array() );
$billingLanguages = $this->get( 'addressLanguages', array() );
$paymentCssAll = array();
foreach( $this->get( 'billingMandatory', array() ) as $name ) {
$paymentCssAll[$name][] = 'mandatory';
}
foreach( $this->get( 'billingOptional', array() ) as $name ) {
$paymentCssAll[$name][] = 'optional';
}
foreach( $this->get( 'billingHidden', array() ) as $name ) {
$paymentCssAll[$name][] = 'hidden';
}
?>
html( $this->translate( 'client/html', 'Billing address' ), $enc::TRUST ); ?>
addressPaymentItem ) ) : ?>
get( 'billingError', array() ) as $name => $msg ) {
$paymentCss[$name][] = 'error';
}
}
$addrValues = $addr->toArray();
if( !isset( $addrValues['order.base.address.languageid'] ) || $addrValues['order.base.address.languageid'] == '' ) {
$addrValues['order.base.address.languageid'] = $this->get( 'billingLanguage', 'en' );
}
$values = array(
'address' => $addrValues,
'salutations' => $billingSalutations,
'languages' => $billingLanguages,
'countries' => $billingCountries,
'states' => $billingStates,
'type' => 'billing',
'css' => $paymentCss,
'id' => $id,
);
/** client/html/common/partials/address
* Relative path to the address partial template file
*
* Partials are templates which are reused in other templates and generate
* reoccuring blocks filled with data from the assigned values. The address
* partial creates an HTML block with input fields for address forms.
*
* The partial template files are usually stored in the layouts/partials/ folder
* of the core or the extensions. The configured path to the partial file must
* be relative to the layouts/ folder, e.g. "common/partials/address-default.html".
*
* @param string Relative path to the template file
* @since 2015.04
* @category Developer
* @category User
*/
?>
partial( 'client/html/common/partials/address', 'common/partials/address-default.html', $values ); ?>
get( 'billingError', array() ) as $name => $msg ) {
$paymentCss[$name][] = 'error';
}
}
$addrValues = array_merge( $addrArray, $this->param( 'ca_billing', array() ) );
if( !isset( $addrValues['order.base.address.languageid'] ) || $addrValues['order.base.address.languageid'] == '' ) {
$addrValues['order.base.address.languageid'] = $this->get( 'billingLanguage', 'en' );
}
$values = array(
'address' => $addrValues,
'salutations' => $billingSalutations,
'languages' => $billingLanguages,
'countries' => $billingCountries,
'states' => $billingStates,
'type' => 'billing',
'css' => $paymentCss,
);
?>
partial( 'client/html/common/partials/address', 'common/partials/address-default.html', $values ); ?>
get( 'billingBody' ); ?>