Forums / Customization from the Admin / About "Special Instructions or Comments About Your Order"

About "Special Instructions or Comments About Your Order"

Locked

Started by tanky on 14 Jul 2006, 9:28 AM · Views: 4,007

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
14 Jul 2006, 9:28 AM
#1
tanky avatar

tanky

New Zenner

Join Date:
Mar 2006
Posts:
28
Plugin Contributions:
0

About "Special Instructions or Comments About Your Order"

Hi,

I have question about "Special Instructions or Comments About Your Order"
in both shipping and payment check out prcedure.

Can I configure this box as complusory? (*) So customer must enter something in the box. It is because I have add another option for them so they must provide additional information in the box.

Thanks,
Tk

19 Jul 2006, 11:09 AM
#2
tanky avatar

tanky

New Zenner

Join Date:
Mar 2006
Posts:
28
Plugin Contributions:
0

Re: About "Special Instructions or Comments About Your Order"

Can anyone help me to sovle this question, I can find any answer of it.
Many thanks.

23 Jul 2006, 2:16 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: About "Special Instructions or Comments About Your Order"

The best place for this is to start on Shipping so that the comments are done with, in theory, as the payment info will get tossed if the comments are missing there ...

Edit the file:
/includes/modules/pages/checkout_shipping/header_php.php

Around lines 119 ... change the code to read:

// process the selected shipping method
  if ( isset($_POST['action']) && ($_POST['action'] == 'process') ) {
    if (zen_not_null($_POST['comments'])) {
      $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
    }
    $comments = $_SESSION['comments'];
    if (empty($comments)) {
      $messageStack->add_session('header', ERROR_MISSING_COMMENT, 'error');
      zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }

This forces the comment to be filled in or throw an error ...

The error message: ERROR_MISSING_COMMENT

Will need to be defined ... usually these extra things are best defined in a file in the directory:
/includes/languages/english/extra_definitions/something.php

These files auto load when english.php loads ...

That test on the comments should then be added to the header_php.php for the checkout_payment as well so that they don't erase everything ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Jul 2006, 6:13 AM
#4
tanky avatar

tanky

New Zenner

Join Date:
Mar 2006
Posts:
28
Plugin Contributions:
0

Re: About "Special Instructions or Comments About Your Order"

wow~ this is very cool, it works!

but i have a minor question is that the error message come at the top of webpage. How can i edit it to be shown on just on top of the comment box?

thanks. really appreciated with your work and kindly help.
Tk

25 Jul 2006, 6:57 AM
#5
tanky avatar

tanky

New Zenner

Join Date:
Mar 2006
Posts:
28
Plugin Contributions:
0

Re: About "Special Instructions or Comments About Your Order"

I have checked that with the create_account. (because there are the error message i want to be shown in check_out_shipping)

I found:

<?php if ($messageStack->size('create_account') > 0) { ?> <tr> <td class="main" colspan="2"><?php echo $messageStack->output('create_account'); ?></td> </tr>

I think this is the way to show error message if required field is missing.
So how to integtate with the one I want for COMMENTS BOX WHEN CHECK OUT?

anyone's help is much appreciated.

4 Aug 2006, 8:24 AM
#6
tanky avatar

tanky

New Zenner

Join Date:
Mar 2006
Posts:
28
Plugin Contributions:
0

Re: About "Special Instructions or Comments About Your Order"

is there anyone can help me? i am confused...

24 Aug 2006, 8:50 AM
#7
tanky avatar

tanky

New Zenner

Join Date:
Mar 2006
Posts:
28
Plugin Contributions:
0

Re: About "Special Instructions or Comments About Your Order"

seems i have to get back this problem and need a solution for it... >.<

well, what i have changed is...

includes/modules/pages/checkout_shipping/header_php.php, i create:

if ($error == true) {
$messageStack->add('checkout_shipping', ERRPR_MISSING_COMMENT);
}

and

includes/templates/[custom]/templates/tpl_checkout_default.php, i create the error display at the place i wanted:

<?php if ($messageStack->size('checkout_shipping') > 0) { echo $messageStack->output('checkout_shipping'); }?>

nothing happen.... anyone can help ?

i did all these changes following the mechanism of the login / contact us / create account error....

hopeless =(