Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Order in Database


Recommended Posts

Hi, i am having some trouble in regards to fixing an issue I have. I am trying to understand the process of how oscommerce works so what i wanted to find out was in the case of an order being placed and then being paid for, at which point of the process (i.e. checkout_shipping.php) is the order written to the database?


If somebody could please help would really appreciate it.

Link to comment
Share on other sites

thanks burt and nobodyfamous for your responses. I have added some questions on checkout_shipping.php but for some reason when selecting paypal to pay with the answers dont get written into database but when selecting cash on delivery than answers get written into database and displayed in backend.


So i thought that it might be best to understand to process so that i can try and workout where this is falling apart..


Thanks for this, really appreciate it.

Link to comment
Share on other sites

hey medidad, I have a few extra boxes for adding additional comments to orders (gift card message, requested delivery date, coupons) and everything worked with "flat" and "COD" shipping, but the extra values also disapeared when I would use PayPal, I had to edit catalog/includes/modules/payment/paypal_standard.php


in the function confirmation, you find large arrays like this; (around line 150)

	  $sql_data_array = array('customers_id' => $customer_id,
							  'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
							  'customers_company' => $order->customer['company'],
							  '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_telephone' => $order->delivery['telephone'],
							  'delivery_company' => $order->delivery['company'],
							  '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'],
			 // ship date
			 'delivery_date' => $order->info['delivery_date'],
			 // eof ship date
			 'giftCard' => $order->info['giftCard'],
							  'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
							  'billing_company' => $order->billing['company'],
							  'billing_street_address' => $order->billing['street_address'],
							  'billing_suburb' => $order->billing['suburb'],
							  'billing_city' => $order->billing['city'],
							  'billing_postcode' => $order->billing['postcode'],
							  'billing_state' => $order->billing['state'],
							  'billing_country' => $order->billing['country']['title'],
							  'billing_address_format_id' => $order->billing['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' => $order->info['order_status'],
							  'currency' => $order->info['currency'],
							  'currency_value' => $order->info['currency_value']);


You will notice mine contains a shipDate, deliveryPhone, and giftCard. I had to add those to get the info to submit to the data base. I may have had to add them in a few other places as well. Just do your best to follow the variables through the checkout. If PayPal is the only one dropping info, it will likely be in this file.

Link to comment
Share on other sites

I think with paypal the customer needs to return to checkout_process.php before the order is logged. I may be wrong. Set your return URL in your paypal profile to checkout_process.php.


Link to comment
Share on other sites

I have managed to add the fields to the paypal_standard.php file which is slightly different to the above example as my fields were initially added to the orders_status_history after the comment field, so it was a case of searching of comments in the file and adding the required fields underneath. The only issue when testing with paypal is that the order now gets added into the database but for some reason it seems to be writing it twice so I get 2 orders_status_history_ids.


Any ideas why this is happening? Thanks btw once again, this has really helped me out..

Link to comment
Share on other sites


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

  • Create New...