[ic] Problems with account_change profile in etc/profiles.order

Mark Bryant mark at vwe.net
Tue Nov 2 11:00:06 EST 2004


Hi Everyone,

I'm having a really odd problem with the account_change profile in that 
fields that are marked as required are not being picked up by IC.

The account_change profile in  etc/profiles.order is as follows:

__NAME__                            account_change
fname=required
lname=required
address1=required
city=required
country=required
[if value country =~ /^(US|CA)$/i]
         state=state_province
         zip=postcode
[/if]
&or phone_day=phone, phone_night=phone Must have day or evening phone number
email=required
&fatal = yes
email=email

__END__


If a customer is on the account.html page and for example leaves out their 
First Name, IC doesn't seem to be honouring the profile.

The data is being collected as follows:

   <td align=right>[error name=fname std_label="First Name" 
required=1]:&nbsp;</td>
   <td colspan="3"><INPUT TYPE=text NAME=fname VALUE="[value fname]" 
size="15" maxlength="20"></td>

I believe that this should tell IC that the field "fname" is required 
(married with the profile above) as part of this form for a successful 
process and follows the example in the foundation store/pages.

I am using the following code to detect the errors (in case someone can see 
something silly in that) and was lifted directly from the foundation 
account.html page:

[if type=explicit compare="[error all=1 show_var=1 keep=1]"]
<P><b>There were errors in your last submission.</b><br>
They are shown in <FONT color="red">this color</FONT> below.</FONT>
<P>
[/if]

What's really odd is that the checkout profile is working just fine, it's 
just the account_change one that's not and I can't see any difference other 
than the options for the various payment methods.

__NAME__                            checkout_profile
fname=required
lname=required
address1=required
city=required
country=required
[if value country =~ /^(US|CA)$/i]
         state=state_province
         zip=postcode
[/if]
&or phone_night=phone, phone_day=phone Must have day or evening phone number

&fatal = yes
email=required
email=email

&set = mv_payment Incomplete

[if value fax_order == 1]
&set = mv_payment Check or Money Order (will call)

[elsif value fax_order == 2]
project_id=required Please include your PO number
&set = mv_payment Purchase order [value project_id]
[value name=tmp_total set="[total-cost noformat=1]" hide=1]
[perl tables="pricing products userdb"]
         $CGI->{credit_limit_ok} = 1;
         my $total = delete $Values->{tmp_total};
         return unless $limit = tag_data('userdb', 'credit_limit', 
$Session->{username});
         Log("credit_limit=$limit total=$total");
         delete $CGI->{credit_limit_ok};
         if($limit >= $total) {
                 $CGI->{credit_limit_ok} = 1;
         }
         return;
[/perl]
credit_limit_ok=mandatory Credit limit exceeded.
[/elsif]

[elsif value fax_order == 3]
&set = mv_payment COD
[value name=mv_handling set=cod hide=1]
[/elsif]
[elsif variable MV_PAYMENT_MODE]
&credit_card=standard keep __CREDIT_CARDS_ACCEPTED__
&charge=[var MV_PAYMENT_MODE][cgi mv_payment_test]
&set=mv_payment Real-time ([var MV_PAYMENT_MODE]) Credit Card
[/elsif]

[elsif config CyberCash]
&fail=../special_pages/failed
&charge=[var CYBER_MODE]
[/elsif]

[elsif config CreditCardAuto]
mv_credit_card_valid=required Credit card fails tests.
&set=mv_payment Credit Card (%c)
[/elsif]

[else]
&credit_card=standard __CREDIT_CARDS_ACCEPTED__
&set=mv_payment Credit Card (%c)
[/else]
[/if]

&calc = $Values->{mv_payment} =~ s/\%c/$Values->{mv_credit_card_type}/g; 1;
&final = yes
&setcheck=mv_email [value email]

__END__

Could it be that I'm not correctly detecting the error state (although I 
doubt it given the direct code lift).

I'm using IC 4.8.7 (yes I know it's old, but it works), Perl 5.6.1 on 
RedHat Linux 7.3 (yes I know this is old too) and would be grateful for any 
suggestions.

Many thanks

Mark




Eros Shop
vwe internet ltd
PO BOX 1067
SLOUGH
SL1 7YA
UK

Shop - http://www.eros-shop.co.uk
EMail - info at eros-shop.co.uk
Tel - 0870 284 3369
Fax - 0870 284 4469




More information about the interchange-users mailing list