Post by mrblond » Fri Nov 17, 2017 7:01 pm

How to hide/remove the telephone field in Checkout>Billing Details>Your Personal Details?

Active Member

Posts

Joined
Fri Oct 13, 2017 4:43 pm

Post by straightlight » Fri Nov 17, 2017 8:36 pm

This extension may provide what you need: https://www.opencart.com/index.php?rout ... n_id=21931 . However, it may require small adjustments for v3.x releases.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by avarahvahin » Sat Nov 18, 2017 2:39 pm

You can do it manually using below steps:
1. from theme template file, catalog/view/theme/yourtheme/template/checkout/register.twig, hide/remove telephone field.
2. From controller file, catalog/controller/checkout/register.php, remove line $json['error']['telephone'] = $this->language->get('error_telephone');
You can use the extension to remove telephone field validation, https://www.opencart.com/index.php?rout ... n_id=32474

Thanks,
Team Pamtechsolutions
dev@pamtechsolutions.com

View All My Extensions


User avatar
Newbie

Posts

Joined
Sat Nov 18, 2017 2:22 pm


Post by FoxT337 » Sun Jun 18, 2023 9:25 am

Hey. Thanks for this 'hard coding' answer.
Just to add my own 2¢ it did work in oc 3.0.3.7 [not using the latest]
and removing the same lines from guest.php and guest.twig will also allow checkout for guests to not enter their #.
NOTE: I did not remove the lines however, I only commented them out in case I needed to revert.

EDIT: In order for this telephone hack to work you will also need to look for all the files that use the 'telephone' var and erase or comment out the needed lines.
PLUS ALSO: If wanted, one can just edit out the * [asterisk] before the telephone field and then find the correct lines in the correct file that cause an error if the field is empty. This way you can get the number but don't have to.

Newbie

Posts

Joined
Mon May 22, 2023 9:36 am
Who is online

Users browsing this forum: lockiedownunder and 52 guests