Hi all,
Is there an alternative way to assign a default value to a custom input field other than this (below) that doesn’t involve that default input being visible in the front-end of the field?
When I use this method, the ‚0‘ is displayed in the field, even though there is a placeholder text assigned.
I’ve used different methods of adding the default value within the register file, like an if statement, unfortunately everything I tried so far results in the default value showing in the field.
Without, an assigned value, of course there is the error: „This value should not be empty.“
value=„{{ context.customer.customFields[‚custom_my_customom_number_‘] | default(‚0‘) }}“
id=„customFields[custom_my_customom_number_]“
placeholder=„{{ „custom_my_customom_number__txt_ex“|trans }}“
I’m using Shopware 6.5.8.3 and created a plug-in to extend the register.html.twig file, adding a field for users to voluntarily input a number. If the user inputs a number, then all is fine, and is the default is set, that is fine too. As mentioned, it’s just that the default shouldn’t be visible to the visitor.
The custom field itself was set up in Shopware’s admin settings, custom fields.
If anyone has run into this before or knows a good solution, please let me know.
Thank you!