[ic] newbie checkout question: mandatory shipping address

Paul Jordan interchange-users@icdevgroup.org
Wed Nov 27 14:15:02 2002


> >>Esteemed ic-guys:
> >>
> >>  This must be a pretty easy one and doubtless well documented but
> I've
> >>trawled the archived and rtfm with no joy.
> >>
> >>  I'm doing a site where the shipping and delivery
> addresses must both
>
> >>be entered and I can't figure out how to insist the user
> enters both.
> >>I've copied code of this sort:
> >>
> >>  	  <tr>
> >>	    <td align="right" class="contentbar1">
> >>	      <b>First Name</b>
> >>	    </td>
> >>	    <td align="left" class="contentbar1">
> >>	      <INPUT TYPE=text NAME=b_fname VALUE="[value b_fname]"
> size="20"
> >>maxlength="20">
> >>	    </td>
> >>	    <td class="contentbar1"><b>Last Name</b></td>
> >>	    <td align="left" class="contentbar1">
> >>	      <INPUT TYPE=text NAME=b_lname VALUE="[value b_lname]"
> size="20">
> >>	    </td>
> >>	  </tr>
> >>
> >>  to replace the collection of the billing address in the
> foundation
> >>code (this is cribbed from the code that collect the shipping info)
> but
> >>it doesn't complain if the input field is blank.
> >>
> >>  My guess is that somewhere there lurks something that
> tells IC what
> >>needs checking here but I can't find it. Help greatly appreciated.
> >>
> >>Regards,
> >>
> >>Ross McAllister
>
>
> >Take a look at etc/profiles.order to see how required fields are
> handled.
>
> >For instance, let's say you wanted something labeled Delivery Address
> to be >required whose associated form field name was "d_address".
>
> >Here would be your steps.
>
> >1. Add something like this for the label of the field:
> > [error name=d_address std_label="Delivery Address" required=1]
>
> >2. Give it a form field like:
> ><INPUT TYPE=text NAME=d_address size="20">
>
> >3. Make this entry into the proper place in profiles.order:
> >d_address=required
>
> >4. I think you need to restart IC, but I cannot remember.Michael,


I am not sure if I am not seeing the whole context in this message but
for what it is worth...


You mean that you want to require both shipping addresses AND billing
addresses (as in the demo) right?

Look into profiles.order and make any changes as neccessary for b_foo
inputs:

b_city=required

In checkout you would have:

[error name=b_city std_label="City" required=1]

Would be an example. In the above post, I am not sure if you have
previously mention any d_foo alterations to the demo, as opposed to the
standard b_foo, but the idea is the same.

HTH

Paul