Results 1 to 4 of 4
  1. #1
    Join Date
    May 2007
    Posts
    7
    Plugin Contributions
    0

    Default Modifying the checkout process - making "comments" a required field - urgent

    I need to make the Comments/Special instructions text area field on the checkout process (page 2 of 3) a compulsory field. The process should not advance to page 3 unless this field has some data.

    Could someone please advice on how to implement this.

    Thanks in advance.

  2. #2
    Join Date
    May 2007
    Posts
    7
    Plugin Contributions
    0

    Default Modifications to the checkout process - Urgent

    We urgently need to make the Comments / Special Instructions field appearing at the end of the Checkout Page 2 of 3 a compulsory field.

    The Checkout should not proceed to Step 3 unless this field has some data.

    What modifications do I need to do to ensure that?

    Please advice.

    Thanks all.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Modifying the checkout process - making "comments" a required field - urgent

    This is the concept which you can work with to build your custom coding:
    /includes/modules/pages/checkout_confirmation/header_php.php
    around line 44 you have:
    Code:
    if (isset($_POST['payment'])) $_SESSION['payment'] = $_POST['payment'];
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
    Add the check to enforce not-empty content:
    Code:
    if (isset($_POST['payment'])) $_SESSION['payment'] = $_POST['payment'];
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
    if ($_SESSION['comments'] == '') {
      $messageStack->add('checkout_payment', 'Please enter order comments before proceeding.', 'error');
      zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    }
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    May 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: Modifying the checkout process - making "comments" a required field - urgent

    Thanks a million DrByte. Your suggestion was all that was needed to get it working. Only the add('checkout_payment'...... had to be changed to add_session('checkout_payment'.... to get the error prompt to show on the frontend.

    It is now working just as we had wanted. Thanks again.

    AuroraMedia

 

 

Similar Threads

  1. Making a "Address Line 2" registration field a required
    By vladimir_vulic in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 31 Jan 2019, 02:27 AM
  2. v153 Can I make "comments" a "required field" when making a purchase?
    By pixel1987 in forum Setting Up Categories, Products, Attributes
    Replies: 12
    Last Post: 7 Jan 2015, 08:17 PM
  3. Setting Order Comments field required, and making it drop-down?
    By davemehta in forum General Questions
    Replies: 8
    Last Post: 24 Nov 2008, 06:37 PM
  4. I need to make the "company" field a required field
    By semaxd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 30 Jun 2008, 09:09 PM
  5. Changing and field names and making them "required"
    By amfd in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Nov 2007, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg