Thread: Orders Table

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Orders Table

    I was wondering if anyone knows where the customer information from the "address_book" and "customer" tables get inserted into the orders table at... I have some custom fields that are stored in these two tables that I need inserted along with the rest of the data that gets put in after each order. I know order.php pulls from the orders table but I don't ever see it filling these fields before it pulls from them.

    thanks

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Orders Table

    The order information is managed in the order class ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Re: Orders Table

    yeah, thats what I have been looking at, and I am confused as to when/where in the file data is actually inserted in orders table fields. In create_account.php, the fields in tpl_modules_create_account.php, like name address and stuff are all inserted into the customers and address book tables. How does that data make it into the orders table, I sure can't find it in order.php.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Orders Table

    PHP Code:
      function create($zf_ot_modules$zf_mode 2) { 
    Everything is built in there then applied to each table ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jun 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: Orders Table

    This is sort of off topic but similar. I think it's more of a database problem but I'm not sure. I have two custom written payment mods for TransFirst; ePay and eCheck. About two weeks ago I had the Admin Activity log full so I reset it without doing a backup I doubt that caused any problems but the issue now is only the first order seems to be able to be inserted into the two tables related to these modules. I've dropped the tables are recreated them and the same thing happens. The cart seems to work fine by taking multiple orders and the listing seems fine but only the first order made after dropping the tables can be inserted into the tables. I'm currently waiting for the host to recreate the tables to see if that will make a difference since I can't access phpMyAdmin because the cart just has an i.p. address until it's finished so I can reroute the dns.

    Hopefully that all makes sense and someone can give some advice.

  6. #6
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Re: Orders Table

    Quote Originally Posted by Ajeh View Post
    PHP Code:
      function create($zf_ot_modules$zf_mode 2) { 
    Everything is built in there then applied to each table ...
    thanks Ajeh appreciate it

  7. #7
    Join Date
    Apr 2005
    Location
    Spokane, Washington
    Posts
    372
    Plugin Contributions
    0

    Default Re: Orders Table

    Bryce, did the fix work for you? Here is my quandry.....

    I have a number of custom fields that customers fill out when registering.

    The data is captured in the customers table of the database.

    I have gotten as far as placing
    Code:
    No thank yous: <?php echo $order->customer['nothanks']; ?>
    into super_invoice.php, the proper corresponding code into order.php in included/classes and the appropriate field into table_orders.

    What I am wondering is how does the information get from the customers table into the orders table so that it will show on the invoice.

    This is in ZC 1.3.7

    Edit: I went into the DB, and entered some text into the field of the orders table and it shows on the invoice. So, how can I get the orders table to pull that field from the customers table like it gets the rest of the customer data?

    Just knowledgeable enough to be dangerous.

  8. #8
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Re: Orders Table

    Ok so I take it you are storing your data from the custom field(s) in the customers table, right?

    The following code populates an array from the fields in the customers table and then this array is used to populate the customer fields of the orders table....

    includes/classes/orders.php
    PHP Code:
    $this->customer = array('firstname' => $customer_address->fields['customers_firstname'],
                                
    'lastname' => $customer_address->fields['customers_lastname'],
                                
    'company' => $customer_address->fields['entry_company'],
                                
    'street_address' => $customer_address->fields['entry_street_address'],
                                
    'suburb' => $customer_address->fields['entry_suburb'],
                                
    'city' => $customer_address->fields['entry_city'],
                                
    'postcode' => $customer_address->fields['entry_postcode'],
                                
    'state' => ((zen_not_null($customer_address->fields['entry_state'])) ? $customer_address->fields['entry_state'] : $customer_address->fields['zone_name']),
                                
    'zone_id' => $customer_address->fields['entry_zone_id'],
                                
    'country' => array('id' => $customer_address->fields['countries_id'], 'title' => $customer_address->fields['countries_name'], 'iso_code_2' => $customer_address->fields['countries_iso_code_2'], 'iso_code_3' => $customer_address->fields['countries_iso_code_3']),
                                
    'format_id' => $customer_address->fields['address_format_id'],
                                
    'telephone' => $customer_address->fields['customers_telephone'],
                                
    'email_address' => $customer_address->fields['customers_email_address']); 
    I am not exactly sure what you are wanting to do but you need to either edit one of those if you want one of the orders table values to get populated by a different field than it currently is....or add a new entry to the array for your custom database field in the orders table and the custom value from the customers table.

    example:
    'custom_value' => $customer_address->fields['my_custom_field']);

    hope some of that makes some sense.
    Last edited by brycej2; 12 Sep 2007 at 08:52 PM.

  9. #9
    Join Date
    Apr 2005
    Location
    Spokane, Washington
    Posts
    372
    Plugin Contributions
    0

    Default Re: Orders Table

    Yes, what you said makes sense.

    In includes/classses/order.php I have added the line

    'nothanks' => $order->fields['customers_no_thanks'],

    And in super_invoice.php I have

    No thank yous: <?php echo $order->customer['nothanks']; ?>

    The text "No thank yous:" shows fine on the invoice, it's just that what should be pulled from the customers_no_thanks field of the customers table isn't appearing.

    I even added a customers_no_thanks field to to the orders table thinking that would automatically fill in with the data from the customers table.

    Just knowledgeable enough to be dangerous.

  10. #10
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Re: Orders Table

    If you are sure that your registration form is actually putting data in the field 'customers_no_thanks' in your customers table, then you would need to add this to the end of the array I showed you earlier:

    'customers_no_thanks' must be the exact name of the field in the customers table

    PHP Code:
    'nothanks' => $customer_address->fields['customers_no_thanks']); 
    Then try what you were trying in the invoice:
    PHP Code:
     No thank yous: <?php echo $order->customer['nothanks']; ?>
    I'm not sure if that is the correct way of echoing the field because I'm not sure how the others in the invoice are being shown, but the key is that your 'customers_no_thanks' in the customers table is actually getting inserted with data from your form. If it is, then I dont see why what I have shown you would not work.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Orders are not saving in orders table after installing fast and easy checkout!
    By srivats in forum Managing Customers and Orders
    Replies: 0
    Last Post: 29 Jun 2010, 08:18 AM
  2. Corrupted Stuck Orders table?
    By lucidlee in forum Managing Customers and Orders
    Replies: 1
    Last Post: 27 Dec 2008, 12:05 PM
  3. Replies: 3
    Last Post: 20 May 2008, 12:22 AM
  4. information in orders table???
    By brycej2 in forum Managing Customers and Orders
    Replies: 0
    Last Post: 8 May 2007, 09:05 PM
  5. previous orders table ??
    By yabora in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 17 Jul 2006, 10:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR