本文整理汇总了PHP中AddressFormat::generateAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP AddressFormat::generateAddress方法的具体用法?PHP AddressFormat::generateAddress怎么用?PHP AddressFormat::generateAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AddressFormat
的用法示例。
在下文中一共展示了AddressFormat::generateAddress方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContent
/**
* Returns the template's HTML content
* @return string HTML content
*/
public function getContent()
{
$invoice_address = new Address((int) $this->order->id_address_invoice);
$country = new Country((int) $invoice_address->id_country);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
$formatted_delivery_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
}
$customer = new Customer((int) $this->order->id_customer);
$order_details = $this->order_invoice->getProducts();
if (Configuration::get('PS_PDF_IMG_INVOICE')) {
foreach ($order_details as &$order_detail) {
if ($order_detail['image'] != null) {
$name = 'product_mini_' . (int) $order_detail['product_id'] . (isset($order_detail['product_attribute_id']) ? '_' . (int) $order_detail['product_attribute_id'] : '') . '.jpg';
$order_detail['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_ . 'p/' . $order_detail['image']->getExistingImgPath() . '.jpg', $name, 45, 'jpg', false);
if (file_exists(_PS_TMP_IMG_DIR_ . $name)) {
$order_detail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_ . $name);
} else {
$order_detail['image_size'] = false;
}
}
}
}
$data = array('order' => $this->order, 'order_details' => $order_details, 'cart_rules' => $this->order->getCartRules($this->order_invoice->id), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'tax_excluded_display' => Group::getPriceDisplayMethod($customer->id_default_group), 'tax_tab' => $this->getTaxTabContent(), 'customer' => $customer);
if (Tools::getValue('debug')) {
die(json_encode($data));
}
$this->smarty->assign($data);
return $this->smarty->fetch($this->getTemplateByCountry($country->iso_code));
}
示例2: getContent
/**
* Returns the template's HTML content
*
* @return string HTML content
*/
public function getContent()
{
$delivery_address = $invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
$formatted_delivery_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
}
$customer = new Customer((int) $this->order->id_customer);
$this->order->total_paid_tax_excl = $this->order->total_paid_tax_incl = $this->order->total_products = $this->order->total_products_wt = 0;
if ($this->order_slip->amount > 0) {
foreach ($this->order->products as &$product) {
$product['total_price_tax_excl'] = $product['unit_price_tax_excl'] * $product['product_quantity'];
$product['total_price_tax_incl'] = $product['unit_price_tax_incl'] * $product['product_quantity'];
if ($this->order_slip->partial == 1) {
$order_slip_detail = Db::getInstance()->getRow('
SELECT * FROM `' . _DB_PREFIX_ . 'order_slip_detail`
WHERE `id_order_slip` = ' . (int) $this->order_slip->id . '
AND `id_order_detail` = ' . (int) $product['id_order_detail']);
$product['total_price_tax_excl'] = $order_slip_detail['amount_tax_excl'];
$product['total_price_tax_incl'] = $order_slip_detail['amount_tax_incl'];
}
$this->order->total_products += $product['total_price_tax_excl'];
$this->order->total_products_wt += $product['total_price_tax_incl'];
$this->order->total_paid_tax_excl = $this->order->total_products;
$this->order->total_paid_tax_incl = $this->order->total_products_wt;
}
} else {
$this->order->products = null;
}
unset($product);
// remove reference
if ($this->order_slip->shipping_cost == 0) {
$this->order->total_shipping_tax_incl = $this->order->total_shipping_tax_excl = 0;
}
$tax = new Tax();
$tax->rate = $this->order->carrier_tax_rate;
$tax_calculator = new TaxCalculator(array($tax));
$tax_excluded_display = Group::getPriceDisplayMethod((int) $customer->id_default_group);
$this->order->total_shipping_tax_incl = $this->order_slip->total_shipping_tax_incl;
$this->order->total_shipping_tax_excl = $this->order_slip->total_shipping_tax_excl;
$this->order_slip->shipping_cost_amount = $tax_excluded_display ? $this->order_slip->total_shipping_tax_excl : $this->order_slip->total_shipping_tax_incl;
$this->order->total_paid_tax_incl += $this->order->total_shipping_tax_incl;
$this->order->total_paid_tax_excl += $this->order->total_shipping_tax_excl;
$total_cart_rule = 0;
if ($this->order_slip->order_slip_type == 1 && is_array($cart_rules = $this->order->getCartRules($this->order_invoice->id))) {
foreach ($cart_rules as $cart_rule) {
if ($tax_excluded_display) {
$total_cart_rule += $cart_rule['value_tax_excl'];
} else {
$total_cart_rule += $cart_rule['value'];
}
}
}
$this->smarty->assign(array('order' => $this->order, 'order_slip' => $this->order_slip, 'order_details' => $this->order->products, 'cart_rules' => $this->order_slip->order_slip_type == 1 ? $this->order->getCartRules($this->order_invoice->id) : false, 'amount_choosen' => $this->order_slip->order_slip_type == 2 ? true : false, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address), 'tax_excluded_display' => $tax_excluded_display, 'total_cart_rule' => $total_cart_rule));
$tpls = array('style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')), 'addresses_tab' => $this->smarty->fetch($this->getTemplate('invoice.addresses-tab')), 'summary_tab' => $this->smarty->fetch($this->getTemplate('order-slip.summary-tab')), 'product_tab' => $this->smarty->fetch($this->getTemplate('order-slip.product-tab')), 'total_tab' => $this->smarty->fetch($this->getTemplate('order-slip.total-tab')), 'payment_tab' => $this->smarty->fetch($this->getTemplate('order-slip.payment-tab')), 'tax_tab' => $this->getTaxTabContent());
$this->smarty->assign($tpls);
return $this->smarty->fetch($this->getTemplate('order-slip'));
}
示例3: getContent
/**
* Returns the template's HTML content
*
* @return string HTML content
*/
public function getContent()
{
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
$formatted_invoice_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
}
$carrier = new Carrier($this->order->id_carrier);
$carrier->name = $carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name;
$order_details = $this->order_invoice->getProducts();
if (Configuration::get('PS_PDF_IMG_DELIVERY')) {
foreach ($order_details as &$order_detail) {
if ($order_detail['image'] != null) {
$name = 'product_mini_' . (int) $order_detail['product_id'] . (isset($order_detail['product_attribute_id']) ? '_' . (int) $order_detail['product_attribute_id'] : '') . '.jpg';
$path = _PS_PROD_IMG_DIR_ . $order_detail['image']->getExistingImgPath() . '.jpg';
$order_detail['image_tag'] = preg_replace('/\\.*' . preg_quote(__PS_BASE_URI__, '/') . '/', _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR, ImageManager::thumbnail($path, $name, 45, 'jpg', false), 1);
if (file_exists(_PS_TMP_IMG_DIR_ . $name)) {
$order_detail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_ . $name);
} else {
$order_detail['image_size'] = false;
}
}
}
}
$this->smarty->assign(array('order' => $this->order, 'order_details' => $order_details, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'order_invoice' => $this->order_invoice, 'carrier' => $carrier, 'display_product_images' => Configuration::get('PS_PDF_IMG_DELIVERY')));
$tpls = array('style_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.style-tab')), 'addresses_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.addresses-tab')), 'summary_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.summary-tab')), 'product_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.product-tab')), 'payment_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.payment-tab')));
$this->smarty->assign($tpls);
return $this->smarty->fetch($this->getTemplate('delivery-slip'));
}
示例4: getContent
/**
* Returns the template's HTML content
* @return string HTML content
*/
public function getContent()
{
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
$formatted_invoice_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
}
$carrier = new Carrier($this->order->id_carrier);
$carrier->name = $carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name;
$order_details = $this->order_invoice->getProducts();
if (Configuration::get('PS_PDF_IMG_DELIVERY')) {
foreach ($order_details as &$order_detail) {
if ($order_detail['image'] != null) {
$name = 'product_mini_' . (int) $order_detail['product_id'] . (isset($order_detail['product_attribute_id']) ? '_' . (int) $order_detail['product_attribute_id'] : '') . '.jpg';
$order_detail['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_ . 'p/' . $order_detail['image']->getExistingImgPath() . '.jpg', $name, 45, 'jpg', false);
if (file_exists(_PS_TMP_IMG_DIR_ . $name)) {
$order_detail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_ . $name);
} else {
$order_detail['image_size'] = false;
}
}
}
}
$this->smarty->assign(array('order' => $this->order, 'order_details' => $order_details, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'order_invoice' => $this->order_invoice, 'carrier' => $carrier));
return $this->smarty->fetch($this->getTemplate('delivery-slip'));
}
示例5: getShopAddress
/**
* Returns the shop address
*
* @return string
*/
protected function getShopAddress()
{
$shop_address = '';
$shop_address_obj = $this->shop->getAddress();
if (isset($shop_address_obj) && $shop_address_obj instanceof Address) {
$shop_address = AddressFormat::generateAddress($shop_address_obj, array(), ' - ', ' ');
}
return $shop_address;
}
示例6: getContent
/**
* Returns the template's HTML content
* @return string HTML content
*/
public function getContent()
{
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
$formatted_invoice_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
}
$this->smarty->assign(array('order' => $this->order, 'order_details' => $this->order_invoice->getProducts(), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'order_invoice' => $this->order_invoice));
return $this->smarty->fetch($this->getTemplate('delivery-slip'));
}
示例7: getContent
/**
* Returns the template's HTML content
* @return string HTML content
*/
public function getContent()
{
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
$formatted_invoice_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
}
$this->smarty->assign(array('order_return' => $this->order_return, 'return_nb_days' => (int) Configuration::get('PS_ORDER_RETURN_NB_DAYS'), 'products' => OrderReturn::getOrdersReturnProducts((int) $this->order_return->id, $this->order), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'shop_address' => AddressFormat::generateAddress($this->shop->getAddress(), array(), '<br />', ' ')));
return $this->smarty->fetch($this->getTemplate('order-return'));
}
示例8: getShopAddress
/**
* Returns the shop address
* @return string
*/
protected function getShopAddress()
{
$shop_address = '';
if (Validate::isLoadedObject($this->shop)) {
Shop::setContext(Shop::CONTEXT_SHOP, $this->shop->id);
$shop_address_obj = $this->shop->getAddress();
if (isset($shop_address_obj) && $shop_address_obj instanceof Address) {
$shop_address = AddressFormat::generateAddress($shop_address_obj, array(), ' - ', ' ');
}
return $shop_address;
}
return $shop_address;
}
示例9: getContent
/**
* Returns the template's HTML content
* @return string HTML content
*/
public function getContent()
{
$country = new Country((int) $this->order->id_address_invoice);
$invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
$formatted_delivery_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
}
$customer = new Customer((int) $this->order->id_customer);
$this->smarty->assign(array('order' => $this->order, 'order_details' => $this->order_invoice->getProducts(), 'cart_rules' => $this->order->getCartRules($this->order_invoice->id), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'tax_excluded_display' => Group::getPriceDisplayMethod($customer->id_default_group), 'tax_tab' => $this->getTaxTabContent(), 'customer' => $customer));
return $this->smarty->fetch($this->getTemplateByCountry($country->iso_code));
}
示例10: getContent
/**
* Returns the template's HTML content
* @return string HTML content
*/
public function getContent()
{
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
$formatted_invoice_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
}
$carrier = new Carrier($this->order->id_carrier);
$carrier->name = $carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name;
$this->smarty->assign(array('order' => $this->order, 'order_details' => $this->order_invoice->getProducts(), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'order_invoice' => $this->order_invoice, 'carrier' => $carrier));
return $this->smarty->fetch($this->getTemplate('delivery-slip'));
}
示例11: getContent
public function getContent()
{
$invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
$formatted_delivery_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
}
$customer = new Customer((int) $this->order->id_customer);
$carrier = new Carrier((int) $this->order->id_carrier);
$data = array('order' => $this->order, 'order_details' => $this->order->getProducts(), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'tax_excluded_display' => Group::getPriceDisplayMethod($customer->id_default_group), 'customer' => $customer, 'carrier' => $carrier);
$this->smarty->assign($data);
$order_pdf_tpl = _PS_MODULE_DIR_ . '/mobassistantconnector/views/templates/front/order_pdf.tpl';
return $this->smarty->fetch($order_pdf_tpl);
}
示例12: getContent
/**
* Returns the template's HTML content
* @return string HTML content
*/
public function getContent()
{
$invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
$formatted_delivery_address = '';
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
}
$customer = new Customer((int) $this->order->id_customer);
$this->order->total_products = $this->order->total_products_wt = 0;
foreach ($this->order->products as &$product) {
$product['total_price_tax_excl'] = $product['unit_price_tax_excl'] * $product['product_quantity'];
$product['total_price_tax_incl'] = $product['unit_price_tax_incl'] * $product['product_quantity'];
if ($this->order_slip->partial == 1) {
$order_slip_detail = Db::getInstance()->getRow('
SELECT * FROM `' . _DB_PREFIX_ . 'order_slip_detail`
WHERE `id_order_slip` = ' . (int) $this->order_slip->id . '
AND `id_order_detail` = ' . (int) $product['id_order_detail']);
$product['total_price_tax_excl'] = $order_slip_detail['amount_tax_excl'];
$product['total_price_tax_incl'] = $order_slip_detail['amount_tax_incl'];
}
$this->order->total_products += $product['total_price_tax_excl'];
$this->order->total_products_wt += $product['total_price_tax_incl'];
$this->order->total_paid_tax_excl = $this->order->total_products;
$this->order->total_paid_tax_incl = $this->order->total_products_wt;
}
unset($product);
// remove reference
if ($this->order_slip->shipping_cost == 0) {
$this->order->total_shipping_tax_incl = $this->order->total_shipping_tax_excl = 0;
}
if ($this->order_slip->partial == 1 && $this->order_slip->shipping_cost_amount > 0) {
$this->order->total_shipping_tax_incl = $this->order_slip->shipping_cost_amount;
}
$tax = new Tax();
$tax->rate = $this->order->carrier_tax_rate;
$tax_calculator = new TaxCalculator(array($tax));
$this->order->total_shipping_tax_excl = Tools::ps_round($tax_calculator->removeTaxes($this->order_slip->shipping_cost_amount), 2);
$this->order->total_paid_tax_incl += $this->order->total_shipping_tax_incl;
$this->order->total_paid_tax_excl += $this->order->total_shipping_tax_excl;
$this->smarty->assign(array('order' => $this->order, 'order_slip' => $this->order_slip, 'order_details' => $this->order->products, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'tax_excluded_display' => Group::getPriceDisplayMethod((int) $customer->id_default_group), 'tax_tab' => $this->getTaxTabContent()));
return $this->smarty->fetch($this->getTemplate('order-slip'));
}
示例13: getContent
public function getContent()
{
if (isset($this->order) and Validate::isLoadedObject($this->order) and Module::isInstalled('agilemultipleseller')) {
$carrier = new Carrier($this->order->id_carrier);
$this->smarty->assign(array('order_number_text' => sprintf('%06d', $this->order->id), 'carrier_name' => $carrier->name));
}
$content = parent::getContent();
if (isset($this->order) and Validate::isLoadedObject($this->order) and Module::isInstalled('agilepickupcenter')) {
$country = new Country((int) $this->order->id_address_invoice);
$invoice_address = new Address((int) $this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
$formatted_delivery_address = $formatted_invoice_address;
if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
$delivery_address = new Address((int) $this->order->id_address_delivery);
$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
}
require_once _PS_ROOT_DIR_ . "/modules/agilepickupcenter/agilepickupcenter.php";
$pickupcenter = new AgilePickupCenter();
$delivery_address = $formatted_delivery_address . "<BR>" . $pickupcenter->displayInfoByCart($this->order->id_cart);
$this->smarty->assign(array('delivery_address' => $delivery_address));
$content = $this->smarty->fetch($this->getTemplateByCountry($country->iso_code));
}
return $content;
}
示例14: generateAddressSmarty
public static function generateAddressSmarty($params, &$smarty)
{
return AddressFormat::generateAddress($params['address'], isset($params['patternRules']) ? $params['patternRules'] : array(), isset($params['newLine']) ? $params['newLine'] : "\r\n", isset($params['separator']) ? $params['separator'] : ' ', isset($params['style']) ? $params['style'] : array());
}
示例15: _getFormatedAddress
/**
* @param Object Address $the_address that needs to be txt formated
* @return String the txt formated address block
*/
protected function _getFormatedAddress(Address $the_address, $line_sep, $fields_style = array())
{
return AddressFormat::generateAddress($the_address, array('avoid' => array()), $line_sep, ' ', $fields_style);
}