X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Easily Copy & Paste Shipping Address of orders (https://forum.x-cart.com/showthread.php?t=20840)

fractalspin 03-30-2006 02:50 PM

Easily Copy & Paste Shipping Address of orders
 
After spending a whole morning frustrated about deleting extra space and field descriptions from the shipping field in the Stamps.com labeling program, I figured I should just modify the way x-cart displays the info so it's easy to copy and paste the shipping address.

It even makes the address stand out better with a tasteful little orange box around it.

Copy this bit:

Code:


<TR valign="top">
<TD valign="top"></TD>
<TD valign="top">


<div style="padding:10px; border-width:1px; border-style:solid; border-color:orange; background:white">
        {if $customer.default_fields.firstname}
                {$customer.s_firstname}
        {/if}
        {if $customer.default_fields.lastname}
                {$customer.s_lastname}

        {/if}       
        {if $customer.default_fields.s_address}
                {$customer.s_address}

        {/if}
        {if $customer.default_fields.s_address_2}
                {$customer.s_address_2}

        {/if}
        {if $customer.default_fields.s_city}
                {$customer.s_city}
        {/if}
        {if $customer.default_fields.s_state}
                {$customer.s_statename}
        {/if}
        {if $customer.default_fields.s_zipcode}
                {$customer.s_zipcode}

        {/if}
        {if $customer.default_fields.s_county && $config.General.use_counties eq 'Y'}
                  {$customer.s_countyname}
        {/if}
        {if $customer.default_fields.s_country}
                {$customer.s_countryname}
        {/if}
        </div>


</TD>
</TR>


Now open up skin1/main/order_info.tpl and go to around line 438. Select all of this:

Code:

{if $customer.default_fields.firstname}
<TR valign="top">
  <TD>  {$lng.lbl_first_name}</TD>
  <TD>{$customer.s_firstname}</TD>
</TR>

{/if}
{if $customer.default_fields.lastname}
<TR valign="top">
  <TD>  {$lng.lbl_last_name}</TD>
  <TD>{$customer.s_lastname}</TD>
</TR>

{/if}
{if $customer.default_fields.s_address}
<TR>
  <TD valign="top">  {$lng.lbl_address}</TD>
  <TD valign="top">{$customer.s_address}</TD>
</TR>

{/if}
{if $customer.default_fields.s_address_2}
<TR>
  <TD valign="top">  {$lng.lbl_address_2}</TD>
  <TD valign="top">{$customer.s_address_2}</TD>
</TR>

{/if}
{if $customer.default_fields.s_city}
<TR>
  <TD valign="top">  {$lng.lbl_city}</TD>
  <TD valign="top">{$customer.s_city}</TD>
</TR>

{/if}
{if $customer.default_fields.s_county && $config.General.use_counties eq 'Y'}
<TR>
  <TD valign="top">  {$lng.lbl_county}</TD>
  <TD valign="top">{$customer.s_countyname}</TD>
</TR>

{/if}
{if $customer.default_fields.s_state}
<TR>
  <TD valign="top">  {$lng.lbl_state}</TD>
  <TD valign="top">{$customer.s_statename}</TD>
</TR>

{/if}
{if $customer.default_fields.s_zipcode}
<TR>
  <TD valign="top">  {$lng.lbl_zip_code}</TD>
  <TD valign="top">{$customer.s_zipcode}</TD>
</TR>

{/if}
{if $customer.default_fields.s_country}
<TR>
  <TD valign="top">  {$lng.lbl_country}</TD>
  <TD valign="top">{$customer.s_countryname}</TD>
</TR>
{/if}


And hit delete. Leave the cursor in the empty space at line 438 and paste the new code.

Save it & upload it.

Yay.

shimmy 02-19-2009 05:48 AM

Re: Easily Copy & Paste Shipping Address of orders
 
This is fantastic thanks, I had been trying to figure out an easy way to do this without having to change the invoice. I have one quick question, How would I make it so it's properly formatted for an address label rather than one straight line of text. I tried to put a <p> tag in after each line but it left it double spaced like this

fake customer

123 fake St.

Someplace ID 12345

But I'd like to look like this

fake customer
123 fake St.
Someplace ID 12345

JWait 02-21-2009 04:18 AM

Re: Easily Copy & Paste Shipping Address of orders
 
Quote:

Originally Posted by shimmy
This is fantastic thanks, I had been trying to figure out an easy way to do this without having to change the invoice. I have one quick question, How would I make it so it's properly formatted for an address label rather than one straight line of text. I tried to put a <p> tag in after each line but it left it double spaced like this

fake customer

123 fake St.

Someplace ID 12345

But I'd like to look like this

fake customer
123 fake St.
Someplace ID 12345


A <br /> instead of a <p> will make it drop one line.

shimmy 02-21-2009 08:45 AM

Re: Easily Copy & Paste Shipping Address of orders
 
Thanks a billion, I guess I should reread HTML for dummies

shimmy 12-03-2009 08:43 AM

Re: Easily Copy & Paste Shipping Address of orders
 
I'm tried this in the new 4.3 and it seems to work except for the first and last name showing up.
Any Ideas
Thanks

JWait 12-03-2009 09:31 AM

Re: Easily Copy & Paste Shipping Address of orders
 
Just a thought, but do you have the customer's first and last names as required? You can check this in admin in the general settings area under "user profiles options".


All times are GMT -8. The time now is 10:14 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.