I need to add js code that check customer added to form has a property or not, if yes do an action. for example in image below I want to check if the customer added to the form has company type or not, if yes then hide a specific part, I am new to OROcommerce and has no idea how to do it can someone help?
Asked
Active
Viewed 138 times
1 Answers
1
First, you need to make the Symfony form, used for rendering, dynamic.
If it's the form type defined somewhere in a vendor folder, you'll need to define the above listeners in a form type extension.
Then, you need to handle that with the JavaScript page component:

Andrey Yatsenko
- 1,936
- 1
- 11
- 13
-
can you tell me how add js in twig file? – Alireza Rahmani Khalili Apr 19 '21 at 19:38
-
1You have to register it in the Resources/config/jsmodules.yml file. https://doc.oroinc.com/backend/configuration/yaml/jsmodules/#reference-format-jsmodules – Andrey Yatsenko Apr 20 '21 at 08:15