Author Topic: How to remove Fax field from checkout guest_step_1  (Read 5003 times)

Offline Geoffrey

  • Full Member
  • ***
  • Posts: 153
  • Karma: +28/-3
    • View Profile
How to remove Fax field from checkout guest_step_1
« 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.

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: How to remove Fax field from checkout guest_step_1
« Reply #1 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 ?>
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Geoffrey

  • Full Member
  • ***
  • Posts: 153
  • Karma: +28/-3
    • View Profile
Re: How to remove Fax field from checkout guest_step_1
« Reply #2 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!

Offline Geoffrey

  • Full Member
  • ***
  • Posts: 153
  • Karma: +28/-3
    • View Profile
Re: How to remove Fax field from checkout guest_step_1
« Reply #3 on: July 06, 2017, 09:39:55 PM »
...
« Last Edit: July 06, 2017, 11:06:37 PM by Geoffrey »

Offline Geoffrey

  • Full Member
  • ***
  • Posts: 153
  • Karma: +28/-3
    • View Profile
Re: How to remove Fax field from checkout guest_step_1
« Reply #4 on: July 06, 2017, 09:40:39 PM »
Sorry, what I meant to say was "bump".  Anyone?

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: How to remove Fax field from checkout guest_step_1
« Reply #5 on: July 07, 2017, 03:30:34 AM »
ok. try to replace file with attached
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Geoffrey

  • Full Member
  • ***
  • Posts: 153
  • Karma: +28/-3
    • View Profile
Re: How to remove Fax field from checkout guest_step_1
« Reply #6 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!  :-)

 

Powered by SMFPacks Social Login Mod