Can anyone explain to me what code makes it only remember those but not: first/last name, email, telephone, address?
What I mean is:
~go to checkout, in STEP-1 chose GUEST,
~in STEP-2 fillout everything and click CONTINUE.
~Now you are in STEP-3 or STEP-4, now go back to STEP-1 and change to REGISTER ACCOUNT and click CONTINUE
~Now in STEP-2 for register account you will see it only remembered: zip code, state, country, BUT NOT first/last name, email, telephone, address
WHY? I guess I'm too dumb to figure it out after 2 hours
.
~ OC 3.0.3.2 and OCmods only ~
It looks like you're still using OC v3.0.3.2, according to your signature. Have you tried the latest OC v3.0.3.9 or OC v3.2.0.0 release to see if the issue could be replicated?supak111 wrote: ↑Mon May 13, 2024 9:11 amI've looked through so much code and still can't figure out why OC3 only remembers: zip code, state, country, between guest checkout and register checkout BUT NOT first/last name, email, telephone, address
Can anyone explain to me what code makes it only remember those but not: first/last name, email, telephone, address?
What I mean is:
~go to checkout, in STEP-1 chose GUEST,
~in STEP-2 fillout everything and click CONTINUE.
~Now you are in STEP-3 or STEP-4, now go back to STEP-1 and change to REGISTER ACCOUNT and click CONTINUE
~Now in STEP-2 for register account you will see it only remembered: zip code, state, country, BUT NOT first/last name, email, telephone, address
WHY? I guess I'm too dumb to figure it out after 2 hours
.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I've tested what I wrote above on other peoples OC websites different versions of OC3 and it's the same. OC is made to only remember ZIP, STATE, COUNTRY. It clears the other fields and I want to know what code is making it only remember those 3 and not the rest.It looks like you're still using OC v3.0.3.2, according to your signature. Have you tried the latest OC v3.0.3.9 or OC v3.2.0.0 release to see if the issue could be replicated?
Try it yourself if you have an OC website
~ OC 3.0.3.2 and OCmods only ~
In "guest.php', you can see that the address fields are stored in:
Code: Select all
$this->session->data['payment_address']
Code: Select all
$this->session->data['shipping_address']
Code: Select all
$this->session->data['guest']
Code: Select all
if (isset($this->session->data['shipping_address']['postcode'])) {
$data['postcode'] = $this->session->data['shipping_address']['postcode'];
} else {
$data['postcode'] = '';
}
So what you could do is to add your own code to check if the other required data is available via "shipping_address" or "payment_address" and "guest" stored in the session array, and assign them to the "$data" variable so that you can display them in the fields in "register.twig".
Also, it doesn't actually clear the fields, it just doesn't access the fields stored in the session to display them. If you go to "Guest Checkout" and fill up all the fields and proceed to Step 4, then back to Step 1 and select "Register Account", and then back to "Guest Checkout" again, you can see that the original values filled up in the fields are all appearing - so the fields aren't actually cleared - you just need to access them from the session array. Hope that helps!
Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager Pro • Drag & Drop Sort Order
Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.
But when I try adding this to register.php it still doesn't remember the CITY for example
Code: Select all
if (isset($this->session->data['shipping_address']['city'])) {
$data['city'] = $this->session->data['shipping_address']['city'];
} else {
$data['city'] = '';
}
Code: Select all
if (isset($this->session->data['payment_address']['city'])) {
$data['city'] = $this->session->data['payment_address']['city'];
} else {
$data['city'] = '';
}
Code: Select all
//if (isset($this->session->data['shipping_address']['postcode'])) {
// $data['postcode'] = $this->session->data['shipping_address']['postcode'];
//} else {
// $data['postcode'] = '';
//}
~ OC 3.0.3.2 and OCmods only ~
Code: Select all
if (isset($this->session->data['guest']['firstname'])) {
$data['firstname'] = $this->session->data['guest']['firstname'];
} else {
$data['firstname'] = '';
}
~ OC 3.0.3.2 and OCmods only ~
Open up the template file "register.twig" and insert the firstname variable into the first name field's value attribute. For example, the following is the original first name field HTML:supak111 wrote: ↑Mon May 13, 2024 1:46 pmJust tried to make it remember the firstname with the code below by adding to register.php, but this doesn't work either. Am I missing some code?
Code: Select all
if (isset($this->session->data['guest']['firstname'])) { $data['firstname'] = $this->session->data['guest']['firstname']; } else { $data['firstname'] = ''; }
Code: Select all
<input type="text" name="firstname" value="" placeholder="{{ entry_firstname }}" id="input-payment-firstname" class="form-control" />
Code: Select all
<input type="text" name="firstname" value="{{ firstname }}" placeholder="{{ entry_firstname }}" id="input-payment-firstname" class="form-control" />
Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager Pro • Drag & Drop Sort Order
Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.
Now that the issue has been solved, please add: [SOLVED] at the beginning of the subject line on your first post.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 19 guests