- Posts: 33
- Thank you received: 0
Hidden custom order fields shown in frontpage
15 years 4 weeks ago #24529
by hko
Hidden custom order fields shown in frontpage was created by hko
Set up custom order field, not to be displayed on the frontpage.
During checkout ok, will not display.
but when the customer later checks his order via de frontend webaccess, all extra custom order fields are displayed.
During checkout ok, will not display.
but when the customer later checks his order via de frontend webaccess, all extra custom order fields are displayed.
Please Log in or Create an account to join the conversation.
15 years 4 weeks ago #24547
by nicolas
Replied by nicolas on topic Re: Hidden custom order fields shown in frontpage
You need to add the code:
if(empty($this->order->$fieldName)) continue;
after the line
$foreach($this->fields as $fieldName => $oneExtraField) {
in the file "show" of the view "order" of the front end via the menu Display->Views and that will do what you want.
if(empty($this->order->$fieldName)) continue;
after the line
$foreach($this->fields as $fieldName => $oneExtraField) {
in the file "show" of the view "order" of the front end via the menu Display->Views and that will do what you want.
Please Log in or Create an account to join the conversation.
15 years 4 weeks ago #24559
by hko
Replied by hko on topic Re: Hidden custom order fields shown in frontpage
Hi Nicolas,
thx, that is indeed the solution.. this is how it is expect to work or not? Will it be included in new versions?
thx!
thx, that is indeed the solution.. this is how it is expect to work or not? Will it be included in new versions?
thx!
Please Log in or Create an account to join the conversation.
15 years 4 weeks ago #24567
by nicolas
Replied by nicolas on topic Re: Hidden custom order fields shown in frontpage
Well, it would be more logical that way I think. So yes, we'll add it to next version.
Please Log in or Create an account to join the conversation.
15 years 4 weeks ago #24569
by hko
Replied by hko on topic Re: Hidden custom order fields shown in frontpage
Sorry Nicolas, but it does not work completely yet..
Just added another order custom field, but this time a checkbox, hidden for frontend.
When I tick the box in the backend for an order it will still show up on the frontend.
Tried with Radio Buttons, same results...
Just added another order custom field, but this time a checkbox, hidden for frontend.
When I tick the box in the backend for an order it will still show up on the frontend.
Tried with Radio Buttons, same results...
Please Log in or Create an account to join the conversation.
15 years 3 weeks ago #24575
by nicolas
Replied by nicolas on topic Re: Hidden custom order fields shown in frontpage
Then, try with that line instead:
if(!@$oneExtraField->field_frontcomp || empty($this->order->$fieldName)) continue;
if(!@$oneExtraField->field_frontcomp || empty($this->order->$fieldName)) continue;
Please Log in or Create an account to join the conversation.
15 years 3 weeks ago #24579
by hko
Replied by hko on topic Re: Hidden custom order fields shown in frontpage
Yes, this seems to work.
It also has an extra benefit which I don't know if it is intended or not, but if the field is empty, it will not show up. ( I can use that because I first setup another box to set show/not show for that other tekst field. )
But I can imaging this 'side effect' is not what you want perhaps.
thx again.
It also has an extra benefit which I don't know if it is intended or not, but if the field is empty, it will not show up. ( I can use that because I first setup another box to set show/not show for that other tekst field. )
But I can imaging this 'side effect' is not what you want perhaps.
thx again.
Please Log in or Create an account to join the conversation.
15 years 3 weeks ago #24584
by nicolas
Replied by nicolas on topic Re: Hidden custom order fields shown in frontpage
In most cases, it's what you want though so we'll leave it like that. It can easily be changed anyway.
Please Log in or Create an account to join the conversation.
Time to create page: 0.266 seconds