viki Posted November 17, 2021 Posted November 17, 2021 (edited) I have try to add TypeaheadProductCollectionType field in my module what using hookActionCategoryFormBuilderModifier for adding specific related products for category for my task. I have add to category edit form this field: $formBuilder->add('related_products', TypeaheadProductCollectionType::class, [ 'remote_url' => $this->context->link->getLegacyAdminLink('AdminProducts', true, ['ajax' => 1, 'action' => 'productsList', 'forceJson' => 1, 'disableCombination' => 1, 'exclude_packs' => 0, 'excludeVirtuals' => 0, 'limit' => 20]) . '&q=%QUERY', 'mapping_value' => 'id', 'mapping_name' => 'name', 'mapping_type' => 'product', 'placeholder' => $this->getTranslator()->trans('Search and add a related product', [], 'Admin.Catalog.Help'), 'template_collection' => '<span class="label">%s</span><i class="material-icons delete">clear</i>', 'required' => false, 'label' => $this->getTranslator()->trans('Accessories', [], 'Admin.Catalog.Feature'), ]); After this related products field is appeared in category edit form but not working. As I can see this form not get all needing JS events for working... Please help me. What am I doing wrong? Edited November 17, 2021 by viki (see edit history) Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now