Skip to main content

Hidden custom order fields shown in frontpage

More
15 years 4 weeks ago #24529 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.

Please Log in or Create an account to join the conversation.

More
15 years 4 weeks ago #24547 by nicolas
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.

Please Log in or Create an account to join the conversation.

More
15 years 4 weeks ago #24559 by hko
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!

Please Log in or Create an account to join the conversation.

More
15 years 4 weeks ago #24567 by nicolas
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.

More
15 years 4 weeks ago #24569 by hko
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...

Please Log in or Create an account to join the conversation.

More
15 years 3 weeks ago #24575 by nicolas
Then, try with that line instead:
if(!@$oneExtraField->field_frontcomp || empty($this->order->$fieldName)) continue;

Please Log in or Create an account to join the conversation.

More
15 years 3 weeks ago #24579 by hko
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.

Please Log in or Create an account to join the conversation.

More
15 years 3 weeks ago #24584 by nicolas
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
Powered by Kunena Forum