Post by easyaspie » Tue Oct 18, 2011 8:02 pm

Hi.

How do I show the payment and shipping address (firstname, lastname, address, e-mail etc.) on the checkout confirm page, formatted according to the "address format" settings related to the selected country?


Thank's a lot
Morten
Last edited by easyaspie on Fri Oct 21, 2011 3:43 pm, edited 1 time in total.

Newbie

Posts

Joined
Wed Oct 05, 2011 3:45 pm

Post by Jeremy Fisk » Fri Oct 21, 2011 3:11 pm

if i have read your question right, it should just be another php echo...

but if you want to make it easier... please post a picture of what you want done and i'll have a look

Thanks

Jem

Hand Dryers

Bookstore Mod
QuickShop Module
Restricted Access - Compulsory Login
Template Override - Category Specific (vQmod)
Template Override - Brand Specific (vQmod)
How did you find out about us register question mod
Compulsory Login vQmod
Brands In Top Menu
zoom - Product Image - Auto on hover


User avatar
Active Member

Posts

Joined
Thu Nov 11, 2010 6:11 pm
Location - New Zealand (Tokomaru, Palmerston North)

Post by easyaspie » Fri Oct 21, 2011 3:43 pm

I figured it out by using code from one of the other controllers.

In the confirm controller, I added this (same for shipping):

...
$data['shipping_country'] = $shipping_address['country'];
$data['shipping_country_id'] = $shipping_address['country_id'];
$data['shipping_address_format'] = $shipping_address['address_format'];


//CUSTOM format shipping address
if ($data['shipping_address_format']) {
$format = $data['shipping_address_format'];
} else {
$format = '{firstname} {lastname}' . "\n" . '{company}' . "\n" . '{address_1}' . "\n" . '{address_2}' . "\n" . '{city} {postcode}' . "\n" . '{zone}' . "\n" . '{country}';
}

$find = array(
'{firstname}',
'{lastname}',
'{company}',
'{address_1}',
'{address_2}',
'{city}',
'{postcode}',
'{zone}',
'{zone_code}',
'{country}'
);

$replace = array(
'firstname' => $data['shipping_firstname'],
'lastname' => $data['shipping_lastname'],
'company' => $data['shipping_company'],
'address_1' => $data['shipping_address_1'],
'address_2' => $data['shipping_address_2'],
'city' => $data['shipping_city'],
'postcode' => $data['shipping_postcode'],
'zone' => $data['shipping_zone'],
'zone_code' => $data['shipping_zone_code'],
'country' => $data['shipping_country']
);

$this->data['shipping_address'] = str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $format))));


In the confirm template I show the addresses with:

<div class="left">
<h2><?php echo $text_checkout_payment_address; ?></h2>
<?php echo $payment_address; ?>
</div>
<div class="right">
<h2><?php echo $text_checkout_shipping_address; ?></h2>
<?php echo $shipping_address; ?>
</div>
<div style="clear:both"></div>

Newbie

Posts

Joined
Wed Oct 05, 2011 3:45 pm
Who is online

Users browsing this forum: No registered users and 146 guests