Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

comments moved vs Paypal IPN


Guest

Recommended Posts

Hi guys,

 

So after installing Pablo's contrib, Paypal IPN 0.97, I tried testing it but ran into an error:

 

1054 - Unknown column 'comments' in 'field list'

 

So I did some investigating and noticed that Pablo's code in checkout_paypalipn.php was making reference to a comments column:

 

'comments' => $order->info['comments'],

 

After commenting out that line, it appeared to work. However, I was still curious as to why Pablo would include that element if it didn't exist. So I decided to dig deeper. I discovered that a different client who was using a snapshot back in September DID have comments in their "orders" table. However, my current client (who is using a snapshot from a couple days ago) DOES NOT have comments in their "orders" table.

 

After looking around, it appears that "comments" was moved from the "orders" table to the "orders_status_history" table. So here are my questions:

 

1. How should I handle this? Should I just comment out that line in Pablo's code?

 

2. Or should I just add "comments" to the "orders" table?

 

3. Any ideas or suggestions as to why comments was moved?

 

4. Would it be better to modify Pablo's contrib in a way to incorporate "TABLE_ORDERS_STATUS_HISTORY"?

 

Thanks in advance for your help and suggestions. And Pablo, great job with this contrib.

 

-Ray

 

PS: It appears that there have been a lot of changes since September because I've been receiving a lot of email lately about my BofA contrib not working anymore. The only way that I could debug it is to update my old clients version of OSC, but I really don't want to break their store. In addition, I have no reliable means of testing because this would involve running their BofA account in a test mode, which I personally don't think is a good idea. :(

Link to comment
Share on other sites

Where the comments are entered in the customer checkout process, and the strategy for revising the code was discussed here:

http://www.oscommerce.com/forums/viewtopic.php?t=28865

 

In the last few months there have been several substantial logic changes in the checkout process, this being only one among them, so many of the payment and shipping contributions are incompatible with the most recent cvs. But there should be a moment of clarity soon, represented by the designation of MS1, when perhaps we can all get back in synch.

Link to comment
Share on other sites

Where the comments are entered in the customer checkout process, and the strategy for revising the code was discussed here:

http://www.oscommerce.com/forums/viewtopic.php?t=28865

 

In the last few months there have been several substantial logic changes in the checkout process, this being only one among them, so many of the payment and shipping contributions are incompatible with the most recent cvs.  But there should be a moment of clarity soon, represented by the designation of MS1, when perhaps we can all get back in synch.

 

Fritz,

 

Thanks for the link. It gave me some insite as to how to tackle this problem. I know that there's more to it than this, the following is a quick fix for the comments problem in Pablo's code (checkout_paypalipn.php).

 

$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';

 $sql_data_array = array('orders_id' => $insert_id, 

                         'orders_status_id' => DEFAULT_ORDERS_STATUS_ID, 

                         'date_added' => 'now()', 

                         'customer_notified' => $customer_notification,

                         'comments' => $order->info['comments']);

 tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

 

 

In addition, I had to remove the reference to comment in the following (order.php):

 

 

$order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($order_id) . "'");

 

Thanks again for the feedback. I'm sure Pablo will figure this out later, but to those that decide on upgrading and using Paypal IPN, please note the subtle differences, otherwise your OSC will break.

 

-Ray

Link to comment
Share on other sites

I'm sorry but I forgot to mention where I added the code in checkout_paypalipn.php. I added it immediately after:

 

  tep_db_perform(TABLE_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_ORDERS_TOTAL, $sql_data_array);

 }

 

-Ray

Link to comment
Share on other sites

  • 1 month later...

Archived

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

×
×
  • Create New...