Hi,
OC 3.0.3.7
I am adding a date textbox to the "Payment Method" standard checkout. This is above the "Comment" textbox.
<input type="text" name="my_order_date" value="{{ my_order_date }}" placeholder="{{ entry_my_order_date }}" data-date-format="YYYY-MM-DD" class="form-control" />
However, when I reference the textbox from the controller code:
$this->request->post['my_order_date']
It gives me an Undefined index: my_order_date
However, the same code works for the existing "Comment" field within the same page with no issues. I'm obviously missing something just not sure what?
Happy to supply more information if required.
Any ideas would be gratefully received.
Vague. More info is needed.GazzaBJ wrote: ↑Mon Dec 06, 2021 11:22 pmHi,
OC 3.0.3.7
I am adding a date textbox to the "Payment Method" standard checkout. This is above the "Comment" textbox.
<input type="text" name="my_order_date" value="{{ my_order_date }}" placeholder="{{ entry_my_order_date }}" data-date-format="YYYY-MM-DD" class="form-control" />
However, when I reference the textbox from the controller code:
$this->request->post['my_order_date']
It gives me an Undefined index: my_order_date
However, the same code works for the existing "Comment" field within the same page with no issues. I'm obviously missing something just not sure what?
Happy to supply more information if required.
Any ideas would be gratefully received.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Well you need to look more closely at the code.
Your new variable is undefined and not being picked up by the ARRAY.
Look again at ALL the code related to the comment box and you will find your errors.
Your new variable is undefined and not being picked up by the ARRAY.
Look again at ALL the code related to the comment box and you will find your errors.
So I managed a workaround for this...
No markup "input" of type "text" would be posted back, but all other types ie checkbox, textarea would and as I couldn't figure out the reason why I did the following:
I created a hidden textarea that copied the value from "my_order_date" on the fly, to the hidden textarea which is then posted back and made available in my code.
Not ideal, but it works and may help anyone else that has the same issue.
No markup "input" of type "text" would be posted back, but all other types ie checkbox, textarea would and as I couldn't figure out the reason why I did the following:
I created a hidden textarea that copied the value from "my_order_date" on the fly, to the hidden textarea which is then posted back and made available in my code.
Not ideal, but it works and may help anyone else that has the same issue.
That is because of the way the ajax call javascript picks up the form fields.GazzaBJ wrote: ↑Mon Dec 06, 2021 11:22 pmHi,
OC 3.0.3.7
I am adding a date textbox to the "Payment Method" standard checkout. This is above the "Comment" textbox.
<input type="text" name="my_order_date" value="{{ my_order_date }}" placeholder="{{ entry_my_order_date }}" data-date-format="YYYY-MM-DD" class="form-control" />
However, when I reference the textbox from the controller code:
$this->request->post['my_order_date']
It gives me an Undefined index: my_order_date
However, the same code works for the existing "Comment" field within the same page with no issues. I'm obviously missing something just not sure what?
Happy to supply more information if required.
Any ideas would be gratefully received.
If you want to mess with checkout, better to get familiar with the ajax code.
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Who is online
Users browsing this forum: No registered users and 517 guests