Page 1 of 1
Remove quest email obligativity from checkout [SOLVED]
Posted: Mon Jan 17, 2022 6:35 pm
by doghi22
Hello there,
I want to remove email obligativity for quests from checkout. Im using opencart 3.0.3.2 with Journal Theme 3.
I tried
https://stackoverflow.com/questions/631 ... t-checkout, but is not working. The error message is still there, also this code removes completly email, i just want to make it optional.
Re: Remove quest email obligativity from checkout
Posted: Mon Jan 17, 2022 8:23 pm
by paulfeakins
Re: Remove quest email obligativity from checkout
Posted: Mon Jan 17, 2022 9:08 pm
by doghi22
They don't provide assistance for this matter.
Re: Remove quest email obligativity from checkout
Posted: Mon Jan 17, 2022 9:23 pm
by khnaz35
Have you refresh your modifications and clear the theme cache after changes in code?
Re: Remove quest email obligativity from checkout
Posted: Mon Jan 17, 2022 9:31 pm
by doghi22
khnaz35 wrote: ↑Mon Jan 17, 2022 9:23 pm
Have you refresh your modifications and clear the theme cache after changes in code?
Yeap, that message is still there.
(error message i meant)
Re: Remove quest email obligativity from checkout
Posted: Mon Jan 17, 2022 9:33 pm
by khnaz35
doghi22 wrote: ↑Mon Jan 17, 2022 9:31 pm
khnaz35 wrote: ↑Mon Jan 17, 2022 9:23 pm
Have you refresh your modifications and clear the theme cache after changes in code?
Yeap, that message is still there.
(error message i meant)
Then most likely you have made changes to different files.
Re: Remove quest email obligativity from checkout
Posted: Mon Jan 17, 2022 10:11 pm
by doghi22
khnaz35 wrote: ↑Mon Jan 17, 2022 9:33 pm
doghi22 wrote: ↑Mon Jan 17, 2022 9:31 pm
khnaz35 wrote: ↑Mon Jan 17, 2022 9:23 pm
Have you refresh your modifications and clear the theme cache after changes in code?
Yeap, that message is still there.
(error message i meant)
Then most likely you have made changes to different files.
No, the modifications from that link aplies, no email is displayed in checkout as guest, also no error displayed anymore. But in console i have an js error from checkout.js about email is required, even with those changes.
Re: Remove quest email obligativity from checkout
Posted: Mon Jan 17, 2022 10:25 pm
by doghi22
After some changes i manage to cancel the errors from checkout.js
Now i can send the order without email warning, but i got error cause website cant sent email, becose is empty.
File: system/library/mail.php Change:
$this->to = $to;
To:
if ($to != '') {$this->to = $to;} else { $this->to = 'myemail@email.com';}
This code not working, i need to send it to a default adress if its empty..
Re: Remove quest email obligativity from checkout
Posted: Tue Jan 18, 2022 5:45 am
by doghi22
I did manage to solve this
Re: Remove quest email obligativity from checkout
Posted: Tue Jan 18, 2022 10:34 am
by Majnoon
doghi22 wrote: ↑Tue Jan 18, 2022 5:45 am
I did manage to solve this
Thanks for the update will suggest you post your solution here too if someone is struggling with same don't have to go through the same.
Re: Remove quest email obligativity from checkout
Posted: Tue Jan 18, 2022 5:49 pm
by doghi22
Majnoon wrote: ↑Tue Jan 18, 2022 10:34 am
doghi22 wrote: ↑Tue Jan 18, 2022 5:45 am
I did manage to solve this
Thanks for the update will suggest you post your solution here too if someone is struggling with same don't have to go through the same.
Ofcorse, you are right.
I did follow this :
https://stackoverflow.com/questions/631 ... t-checkout
Code: Select all
I did not do this step : if ($to != '') {$this->to = $to;} else { $this->to = 'web-and-seo@itech.bg';}
cause not working,
Instead i made changes in :
/ocartdata/storage/modification/catalog/controller/mail/order.php
Code: Select all
I added this condition:
if (empty($order_info['email'])) {
$finalemail= "info@mywebsite.com";}
else {
$finalemail= $order_info['email'];
}
Code: Select all
and changed :
$mail->setTo($order_info['email']);
to
$mail->setTo($finalemail);
Re: Remove quest email obligativity from checkout
Posted: Tue Jan 18, 2022 11:40 pm
by khnaz35
Glad your issue is resolved now. Kindly add word [SOLVED] at the beginning of the post title.
Re: Remove quest email obligativity from checkout
Posted: Wed Jan 19, 2022 9:11 am
by Cue4cheap
doghi22 wrote: ↑Tue Jan 18, 2022 5:49 pm
Instead i made changes in :
/ocartdata/storage/modification/catalog/controller/mail/order.php
This will get overwritten when you refresh modifications.
Mike
Re: Remove quest email obligativity from checkout
Posted: Wed Jan 19, 2022 6:13 pm
by doghi22
Cue4cheap wrote: ↑Wed Jan 19, 2022 9:11 am
doghi22 wrote: ↑Tue Jan 18, 2022 5:49 pm
Instead i made changes in :
/ocartdata/storage/modification/catalog/controller/mail/order.php
This will get overwritten when you refresh modifications.
Mike
Not really, i did deleted and refreshed modifications a few times. My code is still there, maybe this file no regenerating ?
Re: Remove quest email obligativity from checkout
Posted: Wed Jan 19, 2022 11:17 pm
by doghi22
Cue4cheap wrote: ↑Wed Jan 19, 2022 9:11 am
doghi22 wrote: ↑Tue Jan 18, 2022 5:49 pm
Instead i made changes in :
/ocartdata/storage/modification/catalog/controller/mail/order.php
This will get overwritten when you refresh modifications.
Mike
I think you are right in the end.
so change this
public_html/catalog/controller/mail/order.php