OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce How to modify front end product search query to search by vendor name ?

This topic contains 2 replies, has 2 voices, and was last updated by  jeetendra_gawas1 6 years, 6 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #32079

    jeetendra_gawas1
    Participant

    Hi ,

    I am working on a feature wherein i need to modify the front end product search to list products by vendor search. I tried modifying the ProductRepository class to filter results based on vendor but it does not seem to be working. Can anybody provide any solution or a way to modify the product search query before the grid is rendered in front end ?

    Thanks

    Jeetendra

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #32080

    msulima
    Moderator

    Hi,

    you should modify https://github.com/orocommerce/orocommerce/tree/master/src/Oro/Bundle/ProductBundle/Resources/config/oro/website_search.yml to provide correct mapping for search index and https://github.com/orocommerce/orocommerce/tree/master/src/Oro/Bundle/ProductBundle/EventListener/WebsiteSearchProductIndexerListener.php#L40 to provide data from entity to product index.
    After that you will have all needed data in search index.

    Then you should update grid configuration of grid ‘frontend-product-search-grid’ and add filter for related data, that you added to search index before.

    In you case you need something like:

    To update configuration of grid you can use grid listener, something like https://github.com/orocommerce/orocommerce/tree/master/src/Oro/Bundle/CatalogBundle/EventListener/DatagridListener.php with configuration for it with tag


    #32081

    jeetendra_gawas1
    Participant

    Hi msulima,

    Thanks for your reply. Actually I want to search in a different table called oro_vendor_product custom created by us and the search should return me all vendors that match the searched keyword and display the results in a datagrid structure(similar to how product search results are shown). What is the best approach to follow in this case?

    Regards,

    Jeetendra Gawas

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroCommerce’ is closed to new topics and replies.

Back to top