Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can show male/femal on order and customer pages?


kieran_mullen

Recommended Posts

I modified male female to be student/teacher in the defines files for customer registration and it also shows correctly in the customer.php page.

 

How can I get that to show info on the order page? Everything related to the order is pretty much copied and then pulled form the orders table. Male/Femal status is not.

 

For example when I get orders in now I put business cards in every box. However I would just normally throw promo items or business cards in the teachers boxes.

 

Thanks!

Link to comment
Share on other sites

yes I have thank you but I dont think that would have any affact on the page orders.php as it is not displayed there in the first place.

 

Have you modified includes/languages/english.php and admin/includes/languages/english.php?

 

(or whatever language you are using)

Link to comment
Share on other sites

In /admin/includes/classes/order.php add the customer title to the query

 

 

 

$order_query = tep_db_query("select customers_name, customers_company, etc.

 

to

 

$order_query = tep_db_query("select customers_title, delivery_title, billing_title, customers_name, customers_company, etc.

Link to comment
Share on other sites

The table of your query you gave me is for orders ". TABLE_ORDERS ." This table does not contain the gender of the cusotmer . TABLE_CUSTOMERS.

has . customers_gender . however I do not see a query for that table on order.php

 

thank you

 

km

 

 

 

In /admin/includes/classes/order.php add the customer title to the query

 

 

 

$order_query = tep_db_query("select customers_name, customers_company, etc.

 

to

 

$order_query = tep_db_query("select customers_title, delivery_title, billing_title, customers_name, customers_company, etc.

Link to comment
Share on other sites

I'm not good at MYSQL but I tested the following code in the admin and it retrieves the customers gender on the orders page:

 

<?php
 if ( isset($oID) ) {
// get_email
   $get_email_query = tep_db_query("select customers_email_address from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
   $get_email = tep_db_fetch_array($get_email_query);

// get_gender
   $get_gender_query = tep_db_query("select customers_gender from " . TABLE_CUSTOMERS . " where customers_email_address = '" . $get_email['customers_email_address'] . "'");
   $get_gender = tep_db_fetch_array($get_gender_query);

// $get_gender['customers_gender'] now contains the customers gender
// you can display it like this:
// echo '<br>Gender=[' . $get_gender['customers_gender'] . ']';
 }
?>

I had to go thru 2 queries to get there.

 

I'm fairly sure there would be a way to get it with just one query, but someone else will have to post that, and then we'll both learn something new!

:lol:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...