• We have a custom checkout field which would like to include in the index and search. There seems to be a lot of documentation out there but all the plugins seem to be outdated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author rayrutjes

    (@rayrutjes)

    Hello there,

    This plugin is completely decoupled from other plugins out there, and as such, existing documentation of other plugins do not really apply to this plugin.

    I’ve had a few requests recently on adding custom fields to the indexed orders.

    I’d love to know more about that field of yours. Is it managed by ACF or any other existing plugin?

    Ideally I’d like to keep the configuration options to the minimum, but on a case by case basis, add out of the box support for some popular setups out there.

    As of now, the only way to add your fields is to edit the plugin files. I’d love to discuss more your needs before you go down that route.

    Thread Starter hattendesign

    (@hattendesign)

    We use checkout field editor by themehigh. I wouldn’t mind editing the code a little if you point me to the right files which would need editing. This functionality is only necessary in the admin side and it’s just one custom field from the custom checkout form. Thanks for your help

    Plugin Author rayrutjes

    (@rayrutjes)

    Hi again, sorry about the delay.

    If you want to go down the road of editing the files of the plugin, here is what you can do.

    Add your custom field value at indexing time here: https://github.com/rayrutjes/wc-order-search-admin/blob/master/includes/class-orders-index.php#L222

    If you want to make your new field searchable, make sure to include it in searchAttributes settings here: https://github.com/rayrutjes/wc-order-search-admin/blob/master/includes/class-orders-index.php#L130

    If you also want to display the new field as part of the autocomplete dropdown, you will have to add the field to this file: https://github.com/rayrutjes/wc-order-search-admin/blob/master/assets/js/orders-autocomplete.js#L23

    Finally, you’ll have to:
    1. Recompile the JS files running npm install && grunt
    2. Push the settings & re-index everything from the settings screen of the plugin

    Writing this, I completely acknowledge this is far from a simple process.
    I feel like I could improve this flow in the future.

    Hope it helps nonetheless.

    Cheers.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is there a way to index and search a custom order field?’ is closed to new replies.