php - OpenCart 3 + Journal 3, remove email field from guest checkout?

I want to remove email field from checkout page for guest, I use OpenCart 3 with theme Journal 3. So what I can do?
I've tried to call out it from guest.php but still not work.
Answer
Solution:
You can't just remove email field. A lot of system properties connected to email on checkout, although using journal3 makes more complicated extraction of email.
You can see what fields you can turn on / switch of in Journal Quick Checkout:
Journal > Skins > Checkout
UPDATED
To disable Email only for guests in Journal 3 Quick Checkout:
Go to /catalog/view/theme/journal3/template/journal3/checkout/register.twig
Find
{# customer email #}
<div class="form-group required account-email">
<label class="control-label" for="input-email">{{ entry_email }}</label>
<input v-model="order_data.email" type="text" name="email" value="" placeholder="{{ entry_email }}" id="input-email" class="form-control"/>
<span class="text-danger" v-if="error && error.email" v-html="error.email"></span>
</div>
Adding a check, like for passwordv-if="account === 'register'"
. New code is
{# customer email #}
<div v-if="account === 'register'" class="form-group required account-email">
<label class="control-label" for="input-email">{{ entry_email }}</label>
<input v-model="order_data.email" type="text" name="email" value="" placeholder="{{ entry_email }}" id="input-email" class="form-control"/>
<span class="text-danger" v-if="error && error.email" v-html="error.email"></span>
</div>
Now go to /catalog/controller/journal3/checkout.php and find
// email
if ((utf8_strlen(Arr::get($this->request->post, 'order_data.email')) > 96) || !filter_var(Arr::get($this->request->post, 'order_data.email'), FILTER_VALIDATE_EMAIL)) {
$error['email'] = $this->language->get('error_email');
} else if (($this->session->data['account'] === 'register') && $this->model_account_customer->getTotalCustomersByEmail(Arr::get($this->request->post, 'order_data.email'))) {
$error['email'] = $this->language->get('error_exists');
}
Replace with
// email
if ($this->session->data['account'] === 'register') {
if ((utf8_strlen(Arr::get($this->request->post, 'order_data.email')) > 96) || !filter_var(Arr::get($this->request->post, 'order_data.email'), FILTER_VALIDATE_EMAIL)) {
$error['email'] = $this->language->get('error_email');
} else if (($this->session->data['account'] === 'register') && $this->model_account_customer->getTotalCustomersByEmail(Arr::get($this->request->post, 'order_data.email'))) {
$error['email'] = $this->language->get('error_exists');
}
}
Answer
Solution:
Additional to the emntioned 3 steps you have to fix the sendmail funtion. One way is mentioned here in 2 more steps:
File: system/library/mail.php Change:
$this->to = $to;
To:
if ($to != '') {$this->to = $to;} else { $this->to = '[email protected]';}
Change [email protected] to an e-mail that you will receive the confirmation instead of the customer.
- Then remove the * from the mail field on checkout page
File: catalog/view/theme/journal3/template/journal3/checkout/register.twig Change:
<div class="form-group required account-email">
To:
<div class="form-group account-email">
Good luck.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: cannot set properties of undefined (setting '_dt_cellindex')
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.