CRE Loaded Community

Banner


Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: "Add a New Customer" Field Modifications
PostPosted: Tue Aug 31, 2010 9:55 am 
Offline
CRE Newbie
User avatar

Joined: Mon Jul 26, 2010 2:08 pm
Posts: 32
Can someone please tell me how to change what is on the "Add a New Customer" screen? I'm assuming there is a file somewhere that can be edited.

Currently, when I add a customer to create a manual order, the address ends up out of order, which (to me) is very tacky.

Also, for whatever reason, the "Company Name" field on the Add a New Customer page is required to have input in the admin, although it is just an optional field when customers are placing the order themselves. I want the field to be available, but not required. How do I go about changing which fields are required or not?


Top
 Profile  
 
 Post subject: Re: "Add a New Customer" Field Modifications
PostPosted: Wed Sep 01, 2010 5:49 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2211
Location: New Zealand
kidstore wrote:
Can someone please tell me how to change what is on the "Add a New Customer" screen? I'm assuming there is a file somewhere that can be edited.

Currently, when I add a customer to create a manual order, the address ends up out of order, which (to me) is very tacky.

Also, for whatever reason, the "Company Name" field on the Add a New Customer page is required to have input in the admin, although it is just an optional field when customers are placing the order themselves. I want the field to be available, but not required. How do I go about changing which fields are required or not?

1. admin/account_details.php
2. er, not sure. seems to work on the demo versions ... Street Address/Suburb/Zip Code/City/State/Country... what are you getting?
3. admin/create_account_process.php, around line 110:

From this:
Code:
if (ACCOUNT_COMPANY == 'true') {
    if (strlen($company) < ENTRY_COMPANY_MIN_LENGTH) {
      $error = true;
      $entry_company_error = true;
    } else {
      $entry_company_error = false;
    }
  }

To this:
Code:
if (ACCOUNT_COMPANY == 'true') {
           $error = false;
           $entry_company_error = false;
  }

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: "Add a New Customer" Field Modifications
PostPosted: Wed Sep 01, 2010 10:05 pm 
Offline
CRE Newbie
User avatar

Joined: Mon Jul 26, 2010 2:08 pm
Posts: 32
Quote:
1. admin/account_details.php
2. er, not sure. seems to work on the demo versions ... Street Address/Suburb/Zip Code/City/State/Country... what are you getting?


The order of the fields in the Add New Customer page is:

Street Address:
Suburb:
Zip Code:
City:
State/Province:

So, when I want to print out a packing slip, that is the order it is given:

Street Address
City, Zip Code
State, USA

It didn't seem to help to change the order of things in the admin/account_details.php file. Is there something else I need to try?


Quote:
3. admin/create_account_process.php, around line 110:

From this:
Code:
if (ACCOUNT_COMPANY == 'true') {
    if (strlen($company) < ENTRY_COMPANY_MIN_LENGTH) {
      $error = true;
      $entry_company_error = true;
    } else {
      $entry_company_error = false;
    }
  }

To this:
Code:
if (ACCOUNT_COMPANY == 'true') {
           $error = false;
           $entry_company_error = false;
  }


This worked perfectly! Now the field is still available, but not required. Thank you!


Top
 Profile  
 
 Post subject: Re: "Add a New Customer" Field Modifications
PostPosted: Wed Sep 01, 2010 11:37 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2211
Location: New Zealand
Ok, so you're talking about address formats (as displayed by the invoice/packing slip.)
These are configured by country:

Admin//Locations/Taxes//Countries - so for the US example you've probably got an address format of 2.
The table address_format can have multiple AF types depending on the address format of that country.
AFAIK you edit this directly in the dbase using phpMyAdmin

So as an example:

1 $firstname $lastname$cr$streets$cr$city$cr$postcode$cr$country
would work for UK addresses

2 $firstname $lastname$cr$streets$cr$city $state $postcode$cr$country
would work for the US and Australia

You would then specify which AF for each country in Locations/Taxes//Countries.

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: "Add a New Customer" Field Modifications
PostPosted: Thu Sep 02, 2010 5:51 am 
Offline
CRE Newbie
User avatar

Joined: Mon Jul 26, 2010 2:08 pm
Posts: 32
soundzgood2 wrote:
Ok, so you're talking about address formats (as displayed by the invoice/packing slip.)
These are configured by country:

Admin//Locations/Taxes//Countries - so for the US example you've probably got an address format of 2.
The table address_format can have multiple AF types depending on the address format of that country.
AFAIK you edit this directly in the dbase using phpMyAdmin

So as an example:

1 $firstname $lastname$cr$streets$cr$city$cr$postcode$cr$country
would work for UK addresses

2 $firstname $lastname$cr$streets$cr$city $state $postcode$cr$country
would work for the US and Australia

You would then specify which AF for each country in Locations/Taxes//Countries.

Simon


Everything looks to be in order there. The US is set for 2 and there is the correct AF in the table.

I guess I didn't mention that the format is fine when a customer creates their own account from the storefront.

The only time there is a problem is when I use the "Add a New Customer" page from the admin., such as when a customer calls and has not created their account online.

Which is why I assumed that it had something to do with that page.

Is there somewhere else I can check?


Top
 Profile  
 
 Post subject: Re: "Add a New Customer" Field Modifications
PostPosted: Thu Sep 02, 2010 12:56 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2211
Location: New Zealand
The address that appears in the packing slip would be based on the database table address_format, as defined by this line (around 104) out of the file admin/packingslip.php:

Code:
<td class="dataTableContent"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '&nbsp;', '<br>'); ?></td>

So if your address_format table entry 2 shows:

Code:
$firstname $lastname$cr$streets$cr$city $state $postcode$cr$country

then your US packing slip should show (where $cr are the equivalent of linebreaks):
First/Last Names
Street
City State Post/Zipcode
Country

Perhaps double check the code above, esp the address_format table?
Are you definitely talking 'packing slip' or 'invoice'?
Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: "Add a New Customer" Field Modifications
PostPosted: Thu Sep 02, 2010 3:31 pm 
Offline
CRE Newbie
User avatar

Joined: Mon Jul 26, 2010 2:08 pm
Posts: 32
Quote:
The address that appears in the packing slip would be based on the database table address_format, as defined by this line (around 104) out of the file admin/packingslip.php:

Code:
<td class="dataTableContent"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '&nbsp;', '<br>'); ?></td>


File admin/packingslip.php shows:

<td class="dataTableContent"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '&nbsp;', '<br>'); ?></td>

which matches what you gave.

Quote:
So if your address_format table entry 2 shows:

Code:
$firstname $lastname$cr$streets$cr$city $state $postcode$cr$country

then your US packing slip should show (where $cr are the equivalent of linebreaks):
First/Last Names
Street
City State Post/Zipcode
Country

Perhaps double check the code above, esp the address_format table?
Are you definitely talking 'packing slip' or 'invoice'?
Simon


The address_format table entry 2 shows:

$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country

It's not just the packing slip and invoice that are wrong, but the order detail page itself, as well.

Whenever I add a new customer, it shows the address to be out of order in every place where that address would appear.... The order details page, packing slip, invoice, etc.

Oddly enough, it is correct in every place when the customer enters the information themselves.


Top
 Profile  
 
 Post subject: Re: "Add a New Customer" Field Modifications
PostPosted: Thu Sep 02, 2010 11:30 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2211
Location: New Zealand
Ok, understood.

To get the address format working correctly on all those pages, edit the following:

admin/create_order_process.php (line 78)

Replace:
Code:
$format_id = "1";

With:
Code:
//$format_id = "1";
  $format_id = tep_get_address_format_id($country_id);


admin/includes/functions/general.php (before say the tep_address_format function at line 628):

Add:
Code:
////
// Returns the address_format_id for the given country
// TABLES: countries;
  function tep_get_address_format_id($country_id) {
    $address_format_query = tep_db_query("select address_format_id as format_id from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'");
    if (tep_db_num_rows($address_format_query)) {
      $address_format = tep_db_fetch_array($address_format_query);
      return $address_format['format_id'];
    } else {
      return '1';
    }
  }

This copies over the existing address_format_id function that works in the customer account process creation on the Store to the admin side of things when you go to create an account.

BUT there are shortcomings with creating accounts on the Admin side -
1) the shipping address will take the same address format as the customer's address (this won't be a problem if the customer's address format and the shipping address format is the same.)
2) there is no address book feature. Any address changes you make in edit orders won't appear in the customers address book (and any created by the customer in his/her address book will likewise not appear on the Admin side.)

Hope this helps.
Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: "Add a New Customer" Field Modifications
PostPosted: Fri Sep 03, 2010 8:46 am 
Offline
CRE Newbie
User avatar

Joined: Mon Jul 26, 2010 2:08 pm
Posts: 32
Perfect! Thank you!
:D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Tue Feb 07, 2012 10:53 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

Follow Us on Twitter

An error occurred

Oops, an error seems to have occurred. We're sorry for any inconvenience this might have caused. If the error persists, feel free to tell us about it.

CRE Loaded Community Chat hosted by CRE Loaded.

Join now


Chat about what's on your mind. More about public chats.


© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy