wp-search-with-algolia icon indicating copy to clipboard operation
wp-search-with-algolia copied to clipboard

The `algolia_instantsearch_after_hit` hook is not yet compatible with the modern Instantsearch template.

Open tw2113 opened this issue 1 year ago • 2 comments

We use the following hook for a little bit of extra markup and output for WooCommerce data with the Algolia Pro addon.

<?php
	do_action( 'algolia_instantsearch_after_hit' );
?>

With the legacy WP Utils style templating, we were able to echo out the markup to the page just fine, and in place.

However, with the switch to template literals, I have yet to find a working way to have extra content from a separate plugin properly get inserted.

Do we want to have this be a blocker for what should be 2.9.0?

or perhaps have this hook be a bit more exclusive to the default template only, and trust that someone switching to the modern template/template style is going to be proficient enough to include that same content on their own, if they so choose?

tw2113 avatar Apr 18 '25 21:04 tw2113

I don't want to outright close this, but I don't want to have it blocking. We can always adjust templates more later as things get figured out.

tw2113 avatar May 20 '25 18:05 tw2113

Instead of trying to set the output from PHP/hook, move to if/else inside instantsearch-modern.php in the js, based on Pro option?

Biggest issue is that this makes Free plugin actively "aware" of pro at the code level, as opposed to just having hooks that have default values.

Perhaps ship matching file with Pro that overrides Free's instantsearch-modern.php IF the setting for output is toggled on. User-customized versions should always take priority.

tw2113 avatar May 20 '25 18:05 tw2113