Topic: How i can make db_cart to work with data from access_user class? (Read 848 times)
I crack Photoshop!
Gender:
Posts: 3
22 credits Members referred : 0
beginner
« on: Apr 25, 2007, 06:26:58 AM »
Hello Olaf! Thank you for message.And sorry i tryed to contact you directly.Just im not so good to surf around forums...I sow some archive about validate class and i found nesesery information and fix the problem.Now feeback form is working.Now i need some advice how to make db_cart to work with already existing data from access_user class tables if is posible?
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6479
39706 credits Members referred : 374
Hello Olaf! Thank you for message.And sorry i tryed to contact you directly.Just im not so good to surf around forums...I sow some archive about validate class and i found nesesery information and fix the problem.Now feeback form is working.Now i need some advice how to make db_cart to work with already existing data from access_user class tables if is posible?
Actually the script is written to use it with access_user:
check the code inside "db_cart_checkout_example.php"
Code:
$myCheckout = new db_cart(8000);
the number 8000 could be the user id from AU
this code snipped demonstrates how to read the file from the profile table:
Code:
if (!$myCheckout->check_return_shipment()) { // get the external customer data here $cust_conn = mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD); mysql_select_db(DB_NAME, $cust_conn); // the exampple query for customer data (the default shipment address) $cust_sql = sprintf("SELECT name, name2, address, address2, postal_code, place, country FROM db_cart_example_customer WHERE cust_no = %d", $cust_no); $cust_result = mysql_query($cust_sql) or die(mysql_error()); $cust_obj = mysql_fetch_object($cust_result); $myCheckout->ship_name = $cust_obj->name; $myCheckout->ship_name2 = $cust_obj->name2; $myCheckout->ship_address = $cust_obj->address; $myCheckout->ship_address2 = $cust_obj->address2; $myCheckout->ship_pc = $cust_obj->postal_code; $myCheckout->ship_city = $cust_obj->place; $myCheckout->ship_country = $cust_obj->country; mysql_free_result($cust_result); $myCheckout->insert_new_shipment(); } else { $myCheckout->set_shipment_data(); }
of course you can use the methods from AU here and you need to protect pages if needed