Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
checkFields example
'required' =>
(string)
$field
->
getRequired
(
)
, // intended string cast to keep compatibility 'label' =>
$field
->
getLabel
(
)
,
'class' =>
$field
->
getClass
(
)
,
'value' =>
$field
->
getValue
(
)
,
'error_msg' =>
$field
->
getErrorMsg
(
)
,
]
;
}
$this
->
translateForm
(
$form
,
$this
->_elements
)
;
if
(
$this
->
Request
(
)
->
isPost
(
)
)
{
$this
->
checkFields
(
)
;
}
$orderNumber
=
$this
->
Request
(
)
->
getParam
(
'sOrdernumber'
)
;
if
(
empty
(
$this
->
Request
(
)
->Submit
)
|| \
count
(
$this
->_errors
)
)
{
foreach
(
$this
->_elements
as
$id
=>
$element
)
{
if
(
$element
[
'name'
]
=== 'sordernumber'
)
{
try
{
$this
->
get
(
OrderNumberValidatorInterface::
class
)
->
validate
(
$orderNumber
)
;
$product
=
Shopware
(
)
->
Modules
(
)
->
Articles
(
)
->
sGetArticleNameByOrderNumber
(
$orderNumber
)
;