Jump to content

Custom Fields - dropdown selected?


Recommended Posts

if I include a custom dropdown filed on checkout, then if nothing is selected "None" will be displayed ...
would it be possible somehow hide this "None" or set an option as selected by default?

e.g.

-- empty -- (or option 1 as default)

option 1

option 2

option 3

 

Link to comment
Share on other sites

8 minutes ago, cluster said:

if I include a custom dropdown filed on checkout, then if nothing is selected "None" will be displayed ...
would it be possible somehow hide this "None" or set an option as selected by default?

the quick way to hide "none" would be to tweak the checkout.tpl (and possibly the clientareadetails.tpl) templates...

{$customfield.input|replace:'<option value="">None</option>':''}

the cleaner way would be to use a hook to do a string replace on the $customfields array, either removing none (as per above) or selectively assigning other dropdown options as selected.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated