AbanteCart Community

AbanteCart Development => Customization help => Topic started by: Geoffrey on July 03, 2017, 04:22:53 PM

Title: How to remove Fax field from checkout guest_step_1
Post by: Geoffrey on July 03, 2017, 04:22:53 PM
Can you tell me how to remove the Fax field from checkout guest_step_1?

There is no specific call for this field in guest_step_1.tpl.  It is apparently part of a family of general form fields.  If a field is in the family, it will get called. 

I searched in default controller files, but could not find a way there to remove Fax from the family. 

It is not a required field, therefore should be easy to remove. 

Any help?

Thanks.
Title: Re: How to remove Fax field from checkout guest_step_1
Post by: abolabo on July 04, 2017, 05:02:38 AM
you can add skipping there.
Just add

Code: [Select]
if($field_name == 'fax'){ continue; }
after
Code: [Select]
foreach ($form['fields']['general'] as $field_name=>$field) { before close php tag ?>
Title: Re: How to remove Fax field from checkout guest_step_1
Post by: Geoffrey on July 04, 2017, 03:30:14 PM
Thanks for the suggestion. 

I tried it as directed.  It didn't work. 

After doing some reading, I can see the logic of inserting continue "to skip the rest of the current loop iteration and continue execution at the condition evaluation ".

I tried every conceivable location for the snippet, and also tried variations with different use of spaces in the code snippet, and tried removing the {}, etc. 

So I really tried to make your suggestion work, but it never removed the Fax name or field, and it always resulted in displaying the code snippet directly on the site page.  (I cleared cache each iteration. )

I suspect that your suggestion is very close to a solution, but there is a format or syntax problem interfering, and identification of that problem is beyond my capabilities. 

Any ideas?

Thanks!
Title: Re: How to remove Fax field from checkout guest_step_1
Post by: Geoffrey on July 06, 2017, 09:39:55 PM
...
Title: Re: How to remove Fax field from checkout guest_step_1
Post by: Geoffrey on July 06, 2017, 09:40:39 PM
Sorry, what I meant to say was "bump".  Anyone?
Title: Re: How to remove Fax field from checkout guest_step_1
Post by: abolabo on July 07, 2017, 03:30:34 AM
ok. try to replace file with attached
Title: Re: How to remove Fax field from checkout guest_step_1
Post by: Geoffrey on July 08, 2017, 01:24:39 PM
Ah.  That was it.

I misunderstood the original instructions.
 
I thought the close tag was line 37-38, but I see now that 37-38 is its own tag, and the close tag for the skip is actually line 29 ?>. 

So simple.  Now I know. 

Thanks for taking the time so that a noob can understand really simple things like close tag.  Duh. 

You have lightened my burden!  :-)