Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

trying to fix the address layout on the gmap.tpl file

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-18-2015, 11:26 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default trying to fix the address layout on the gmap.tpl file

When I click on a customers location in the admin/orders/ it opens up a map with the customer name and address in the top left corner. I would like to fix the way the address is laid out. The template that lays out the address is /common_files/gmap.tpl

Code:
{capture name="gmap"} <strong>{$description.name}</strong><br /> ({if $description.type eq "shipping"} {$lng.lbl_shipping_address} {else} {$lng.lbl_billing_address} {/if})<br /> {$description.address}<br /> {$lng.lbl_phone}: {$description.phone} {/capture} <a href="javascript:void(0);" onclick="javascript:GMap.showModal('{$address|escape:htmlcompat|escape:javascript}','{$smarty.capture.gmap|escape:htmlcompat|escape:javascript}');" class="gmarker{if $show_on_map eq "1"} gmarker-show-on{/if}">{if $show_on_map eq "1"}{$lng.lbl_gmap_show}{/if}</a>

the line in question is the
Code:
{$description.address}

How do I adjust the way that variable is laid out? Meaning I want to have
Street
City, State, Zip

instead of
Street
Zip
City
State

Any help would be appreciated. Thanks.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #2  
Old 06-18-2015, 11:44 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: trying to fix the address layout on the gmap.tpl file

You will have to go to the php or js file that writes "address" to $description array and correct it there. Another way would be to use smarty modifier to modify {$description.address} and re-write it any way you want
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 06-18-2015, 11:57 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: trying to fix the address layout on the gmap.tpl file

I've google smarty modifier and kind of understand but could you give an example of some code that would move parts of the variable around? I'm not asking for the full answer cause I'd like to learn. How do I "see" the different parts of the variable?
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #4  
Old 06-18-2015, 03:40 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: trying to fix the address layout on the gmap.tpl file

$description is an array. you can list its key/value pairs with var_dump or print_r php functions.

If you are sure "address" holds the value you want to modify and it is like you said most likely there is "<br/>" for each new line in it. You can also use smarty replace on the variable to replace the new line with comma.

Coding modifier you can use "explode" to split the $description['address'] and then joing them together in new variable(s) as you need
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 06-19-2015, 09:43 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: trying to fix the address layout on the gmap.tpl file

thanks for the tips Steve.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:04 PM.

   

 
X-Cart forums © 2001-2020