Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Really need your help!


ryanf

Recommended Posts

Hey, I am really stuck on a problem I am having! Since our customers can only have products shipped and billed to their company address, I have taken out the checkout_shipping and checkout_payment and moved them to the checkout_confirmation page along with a comments box. Everything adds to the database fine except for the comments. I can't get them to load into the database so I guess they are not being passed into the checkout_process page. Anyone know how I can do this?

 

Here is a link to the two pages so you can take a look at them:

http://www.abdulky.com/help.html

 

I don't really care if I will have to rewrite checkout_confirmation either, but I am a little concerned about opening a security hole if I havn't already. Then again, the customers don't enter a credit card so there really isn't that much to secure.

 

Thanks for any help you can give!

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

You will need to add the comments box to your checkout process at the onset, whichever page that may be in your process of moving them through. Then in your posting you will need to add this code

 

// process the selected shipping method
 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {
   if (!tep_session_is_registered('comments')) tep_session_register('comments');
   if (tep_not_null($HTTP_POST_VARS['comments'])) {
     $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
   }

   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

   if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
     if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
       $shipping = $HTTP_POST_VARS['shipping'];

       list($module, $method) = explode('_', $shipping);
       if ( is_object($$module) || ($shipping == 'free_free') ) {
         if ($shipping == 'free_free') {
           $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
           $quote[0]['methods'][0]['cost'] = '0';
         } else {
           $quote = $shipping_modules->quote($method, $module);
         }
         if (isset($quote['error'])) {
           tep_session_unregister('shipping');
         } else {
           if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
             $shipping = array('id' => $shipping,
                               'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
                               'cost' => $quote[0]['methods'][0]['cost']);

             tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
           }
         }
       } else {
         tep_session_unregister('shipping');
       }
     }
   } else {
     $shipping = false;
               
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
   }    
 }

Always remember, we need patience, guidance and most of all understanding.

 

My Contributions

Link to comment
Share on other sites

I don't think I believe what you are trying to say. As of now when you click checkout on the shopping cart it goes to the checkout_confirmation page. There you write any comments on the order that you have, hit confirm or cancel and you are done. Where would I put this code? I want the comments page on the checkout_process page.

 

Thanks

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

So I understand correctly you want to have your comments section placed in your checkout_process.php

 

You will need to place the comment text feild in your checkout_process.php page. This will allow your customers to type in there message that you want top pass.

 

The code I have extracted in teh previous message is the code that passes along that text feild string. I will try to make it work on my site and see if I can't save you some time. Do I understand correctly what you are trying to do so I do it in the wrong step of the process?

 

JM

Always remember, we need patience, guidance and most of all understanding.

 

My Contributions

Link to comment
Share on other sites

Yeah thats right, I already have the code for the comments on my checkout_process page but I can't get the field passed along and get it into my database. In my first post I have a link that will show you both checkout_confirmation.php and checkout_process.php.

Here is what checkout_confirmation looks like:

checkout.gif

 

Thanks for helping out.

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Ryan,

 

You may have changed your code from what's in the html file, but if look at checkout_success.php you'll see that the the tep_draw_form occurs after (way below) where you put tep_draw_textarea_field('comments', 'soft', '60', '5');

 

Also in the top of checkout_process.php you dont' have

 if (!tep_session_is_registered('comments')) tep_session_register('comments'); if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); }

Like you do in checkout_confirmation.php

 

Once you sort out the above, any the two:

 

//'comments' => $comments);

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

 

Should work

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Awsome thank you guys so much, I can't believe I couldn't figure that one out, it was so simple. Anyway, you guys are great. 'comments' => $comments); worked the other didn't.

 

Thanks.

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...