I would like to know the answer too. Anyone here know what is the answer to your question. I'll do some research in Google and get back to you if I find an useful answer. You should email the people at iPage as they probably can answer it..
You need to separate the code from the sql, then you can create the tables via mysql connector, mysql prompt or phpmyadmin..
Ok, pardon my dumbness. your help is quite appreciated. Can I import the tables now that I figured out how to create them or do I have to manually input all the fields? I have phpmyadmin...
You can put all the SQL in a seperate file and use the laod from file command if your host supports it (many don't now b/c of security issues) or you can simply copy/paste the SQL in the SQL text box in phpMyAdmin. No need to manually create the tables...
Thanks Bud, I copy and pasted, wasnt too bad, I am on the last line and I am unsure of what this here means.
KEY idx_orders_total_orders_id (orders_id).
Anyone have any ideas what I do with this?.
Here's my screenshot:..
I want to install the mod below but I am not sure what is meant by creatinh holding tables. Is this SQL related? I have an interface with my ISP but not sure if this is where or how I go about doing this, any help would be gladly appreciated or if you know of another script that performs the same functions and is easier to insatll. I process credit cards offline and had people enter orders and I recieved no order in osCommerce. Thanks alot..
Greetings,.
I've read in the forums that some people have had a problem with an order not being logged at their iPage site because the customer did not click the appropriate button to return to the iPage site after they entered their credit card at their payment processor's iPage site (e.g. 2Checkout)..
I use 2Checkout for my payment processor and have had this problem several times. At the completion of the payment, if the customer does not click "Finish Order" upon completing the credit card entry, they do not return to my iPage site and thus the order is not logged. I've had to go back to several customers to ask them what they ordered. This is not a good situation..
This contribution logs the order, products ordered and order total in three holding tables triggered at the checkout_confirmation.php page before the customer is passed to the payment processor. The process is seamless and doesn't interfere with the regular checkout process..
Access to the order information in the holding tables is through phpMyAdmin (or your db tool of choice) at this time. If I stay with 2Checkout or move to another payment processor that has the potential for this same situation, I will create access to these tables/holding orders through Admin. Right now, I don't have the time to do this..
I hope this helps anyone that has experienced this same situation..
Cheers,.
Mark Russell.
Install.
The mod is quite simple to install..
>>>>>> Create the three holding tables defined here:.
CREATE TABLE holding_orders (.
Orders_id int(11) NOT NULL auto_increment,.
Customers_id int(11) NOT NULL default '0',.
Customers_name varchar(64) NOT NULL default '',.
Customers_street_address varchar(64) NOT NULL default '',.
Customers_suburb varchar(32) default NULL,.
Customers_city varchar(32) NOT NULL default '',.
Customers_postcode varchar(10) NOT NULL default '',.
Customers_state varchar(32) default NULL,.
Customers_country varchar(32) NOT NULL default '',.
Customers_telephone varchar(32) NOT NULL default '',.
Customers_email_address varchar(96) NOT NULL default '',.
Customers_address_format_id int(5) NOT NULL default '0',.
Delivery_name varchar(64) NOT NULL default '',.
Delivery_street_address varchar(64) NOT NULL default '',.
Delivery_suburb varchar(32) default NULL,.
Delivery_city varchar(32) NOT NULL default '',.
Delivery_postcode varchar(10) NOT NULL default '',.
Delivery_state varchar(32) default NULL,.
Delivery_country varchar(32) NOT NULL default '',.
Delivery_address_format_id int(5) NOT NULL default '0',.
Payment_method varchar(32) NOT NULL default '',.
Cc_type varchar(20) default NULL,.
Cc_owner varchar(64) default NULL,.
Cc_number varchar(32) default NULL,.
Cc_expires varchar(4) default NULL,.
Last_modified datetime default NULL,.
Date_purchased datetime default NULL,.
Orders_status int(5) NOT NULL default '0',.
Orders_date_finished datetime default NULL,.
Comments text,.
Currency char(3) default NULL,.
Currency_value decimal(14,6) default NULL,.
PRIMARY KEY (orders_id).
) TYPE=MyISAM;.
CREATE TABLE holding_orders_products (.
Orders_products_id int(11) NOT NULL auto_increment,.
Orders_id int(11) NOT NULL default '0',.
Products_id int(11) NOT NULL default '0',.
Products_model varchar(12) default NULL,.
Products_name varchar(64) NOT NULL default '',.
Products_price decimal(15,4) NOT NULL default '0.0000',.
Final_price decimal(15,4) NOT NULL default '0.0000',.
Products_tax decimal(7,4) NOT NULL default '0.0000',.
Products_quantity int(2) NOT NULL default '0',.
PRIMARY KEY (orders_products_id).
) TYPE=MyISAM;.
CREATE TABLE holding_orders_total (.
Orders_total_id int(10) unsigned NOT NULL auto_increment,.
Orders_id int(11) NOT NULL default '0',.
Title varchar(255) NOT NULL default '',.
Text varchar(255) NOT NULL default '',.
Value decimal(15,4) NOT NULL default '0.0000',.
Class varchar(32) NOT NULL default '',.
Sort_order int(11) NOT NULL default '0',.
PRIMARY KEY (orders_total_id),.
KEY idx_orders_total_orders_id (orders_id).
) TYPE=MyISAM;.
>>>>>> Define Tables in catalog/includes/application_top.php.
Define('TABLE_HOLDING_ORDERS', 'holding_orders');.
Define('TABLE_HOLDING_ORDERS_PRODUCTS', 'holding_orders_products');.
Define('TABLE_HOLDING_ORDERS_TOTAL', 'holding_orders_total');.
>>>>>> Change to checkout_confirmation.php.
After line (approximately line 293):.
<! body_eof //>.
Paste the following:.
<?php.
//Log order into holding tables before checkout is passed to payment processor.
$sql_data_array = array('customers_id' => $customer_id,.
'customers_name' => $order->customer['firstname']' '$order->customer['lastname'],.
'customers_street_address' => $order->customer['street_address'],.
'customers_suburb' => $order->customer['suburb'],.
'customers_city' => $order->customer['city'],.
'customers_postcode' => $order->customer['postcode'],.
'customers_state' => $order->customer['state'],.
'customers_country' => $order->customer['country']['title'],.
'customers_telephone' => $order->customer['telephone'],.
'customers_email_address' => $order->customer['email_address'],.
'customers_address_format_id' => $order->customer['format_id'],.
'delivery_name' => $order->delivery['firstname']' '$order->delivery['lastname'],.
'delivery_street_address' => $order->delivery['street_address'],.
'delivery_suburb' => $order->delivery['suburb'],.
'delivery_city' => $order->delivery['city'],.
'delivery_postcode' => $order->delivery['postcode'],.
'delivery_state' => $order->delivery['state'],.
'delivery_country' => $order->delivery['country']['title'],.
'delivery_address_format_id' => $order->delivery['format_id'],.
'payment_method' => $order->info['payment_method'],.
'cc_type' => $order->info['cc_type'],.
'cc_owner' => $order->info['cc_owner'],.
'cc_number' => $order->info['cc_number'],.
'cc_expires' => $order->info['cc_expires'],.
'date_purchased' => 'now()',.
'orders_status' => DEFAULT_ORDERS_STATUS_ID,.
'comments' => $order->info['comments'],.
'currency' => $order->info['currency'],.
'currency_value' => $order->info['currency_value']);.
Tep_db_perform(TABLE_HOLDING_ORDERS, $sql_data_array);.
$insert_id = tep_db_insert_id();.
For ($i=0; $i<sizeof($order_totals); $i++) {.
$sql_data_array = array('orders_id' => $insert_id,.
'title' => $order_totals[$i]['title'],.
'text' => $order_totals[$i]['text'],.
'value' => $order_totals[$i]['value'],.
'class' => $order_totals[$i]['code'],.
'sort_order' => $order_totals[$i]['sort_order']);.
Tep_db_perform(TABLE_HOLDING_ORDERS_TOTAL, $sql_data_array);.
}.
For ($i=0; $i<sizeof($order->products); $i++) {.
$sql_data_array = array('orders_id' => $insert_id,.
'products_id' => tep_get_prid($order->products[$i]['id']),.
'products_model' => $order->products[$i]['model'],.
'products_name' => $order->products[$i]['name'],.
'products_price' => $order->products[$i]['price'],.
'final_price' => $order->products[$i]['final_price'],.
'products_tax' => $order->products[$i]['tax'],.
'products_quantity' => $order->products[$i]['qty']);.
Tep_db_perform(TABLE_HOLDING_ORDERS_PRODUCTS, $sql_data_array);.
$order_products_id = tep_db_insert_id();.
}.
//End log order before payment.
?>..
Im in my SQL from my Web Host, do I copy the above lines in there?..

