Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Dec 2014
    Location
    uruguay
    Posts
    65
    Plugin Contributions
    0

    Default Can I make "comments" a "required field" when making a purchase?

    hi i want to know if a required field is possible when doing a purchase

    Click image for larger version. 

Name:	obligatorio.jpg 
Views:	140 
Size:	37.0 KB 
ID:	14839

    thanks
    Attached Images Attached Images  
    Last edited by pixel1987; 5 Jan 2015 at 07:54 PM.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,710
    Plugin Contributions
    17

    Default Re: Can I make "comments" a "required field" when making a purchase?

    Yes. If the attribute being filled in is a Text attribute, it can be forced to be required by selecting the required flag within the attributes controller... See the following FAQs:
    http://www.zen-cart.com/content.php?...to-my-products
    and:
    http://www.zen-cart.com/content.php?...e-causing-this (The first line applies only for this situation..)

    There are other ways as well to do data validation after submitting, but the above should address your immediate concerns/issues.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Dec 2014
    Location
    uruguay
    Posts
    65
    Plugin Contributions
    0

    Default Re: Can I make "comments" a "required field" when making a purchase?

    thanks for the reply, but served me because this is already created and donot where access it, is when the user is doing the buying asking these mandatory fields I want to add

  4. #4
    Join Date
    Jul 2012
    Posts
    16,710
    Plugin Contributions
    17

    Default Re: Can I make "comments" a "required field" when making a purchase?

    Sorry, I guess I misunderstood the original request/expectation. Thank you for clarifying.

    Although it probably is more preferred to put the attribute in the product itself, you could do validation in the header_php.php file that follows (or an observer) to kick back to the previous or designated page... Would check for the post data of the field to validate that it is not blank, and if it is blank to take the action necessary to 1) post a message about the need to enter the data and to return back (forward) to that page..
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Can I make "comments" a "required field" when making a purchase?

    If a dropdown of options would work (and it looks like it would) re-working this mod might be easier: http://www.zen-cart.com/downloads.php?do=file&id=90

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Can I make "comments" a "required field" when making a purchase?

    You could also customize the file:
    /includes/modules/pages/checkout_configuration/header_php.php

    and add the code in RED:
    Code:
    if (isset($_POST['payment'])) $_SESSION['payment'] = $_POST['payment'];
    $_SESSION['comments'] = $_POST['comments'];
    
    // bof: force comment
    if (trim($_SESSION['comments']) == '') {
      $messageStack->add_session('checkout_payment', 'Please enter order comments before proceeding.', 'error');
      zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    }
    // eof: force comment
    
    //'checkout_payment_discounts'
    //zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    Now, if they try to submit the order on the checkout_confirmation page without a comment, they will be returned to the checkout_payment and they will see a red message telling them to include a comment ...
    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: v1.5.5]
    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!

  7. #7
    Join Date
    Dec 2014
    Location
    uruguay
    Posts
    65
    Plugin Contributions
    0

    Default Re: Can I make "comments" a "required field" when making a purchase?

    thank for the reply mc12345678 and stevesh; stevesh I have the version 1.53 that is a module and then lets me add a option value?
    pd: products database with this module are removed?

    mc12345678 I did not understand your answer

  8. #8
    Join Date
    Dec 2014
    Location
    uruguay
    Posts
    65
    Plugin Contributions
    0

    Default Re: Can I make "comments" a "required field" when making a purchase?

    it worked thanks RED, but is possible to make a option value in here?

  9. #9
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Can I make "comments" a "required field" when making a purchase?

    It appeared from your image that you want the customer to choose from a number of companies the order would be shipped from. If that isn't correct, post again.

  10. #10
    Join Date
    Dec 2014
    Location
    uruguay
    Posts
    65
    Plugin Contributions
    0

    Default Re: Can I make "comments" a "required field" when making a purchase?

    that is correct as you say

 

 
Page 1 of 2 12 LastLast

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. can i have products of types "Purchase" and "View only"...need both
    By aniketanyee in forum Customization from the Admin
    Replies: 2
    Last Post: 24 Nov 2012, 11:06 AM
  3. How to make "Company Name" a required field?
    By hllight in forum General Questions
    Replies: 4
    Last Post: 15 Feb 2009, 04:26 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. Replies: 3
    Last Post: 31 Aug 2007, 07:29 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR