curtisagitate
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Search with Algolia] hierarchical indexing of categoriesFurther to my other message, just for anyone else’s benefit trying to attempt this same thing.
All I had to do further to my last work was update the order of the ranking and sorting attributes within Algolia directly. Pushing this custom ranking to the top of the list has got this working.
Not sure why, I was under the impression any settings configured within Alogolia would be overridden by the plugin – swear I read that on some piece of documentation. But I have pushed settings and reindexed within the plugin and it doesn’t appear to have overridden this ??
Forum: Plugins
In reply to: [WP Search with Algolia] hierarchical indexing of categoriesJust been thinking about this and come up with a different way to achieve the same thing, I think.
First I have added a new attribute called ‘Ranking Importance’ and set this to 1 or 2 based on category.
//ranking priority
$terms = get_the_terms( $post->ID, ‘product_cat’ );
foreach ($terms as $term) {
$product_cat_id = $term->term_id;
if($product_cat_id == ’22’) {
$ranking = 2000;
}
else {
$ranking = 1;
}
}
$attributes[‘ranking_importance’] = $ranking;`Then I have registered this as a custom ranking:
function custom_posts_index_settings( array $settings ) {
$custom_ranking = $settings[‘ranking_importance’];
array_unshift( $custom_ranking, ‘asc(ranking_importance)’ );
$settings[‘ranking_importance’] = $custom_ranking;return $settings;
}add_filter( ‘algolia_posts_index_settings’, ‘custom_posts_index_settings’ );`
`Note: Set to 2000 due to weighting – https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/
As I understand it, this should have worked. I can see the new attribute in Algolia but it seems the custom ranking function has had 0 impact.
Any thoughts?
Forum: Plugins
In reply to: [WP Search with Algolia] hierarchical indexing of categoriesThanks, I was under the impression that any settings configured within Algolia will be overridden by your plugin when you index?
Is that not the case if I were to config this Alogolia’s end?
Forum: Plugins
In reply to: [WP Search with Algolia] Twig for loop in template not renderingYup, all good and working now. Thanks for your support! Much appreciated.
Forum: Plugins
In reply to: [WP Search with Algolia] Twig for loop in template not renderingSorry I realise now what you are saying, its not twig at all. I confused it due to similar syntax.
Thank you. Based on that I would need something like this…
<# _.each( data.swatches, function() { #> <li class="two-color"> {{ data.swatches.color_1 }} </li> <# }) #>
Forum: Plugins
In reply to: [WP Search with Algolia] Twig for loop in template not renderingYeah I am running a standard custom WordPress build, not timber/twig. This is just edits made on the twig template within the instantsearch.php file (copied into theme directory)
So as I understand it, though that template is twig based I am limited to simply outputting content from Algolia and am unable to run a for loop to output contents of object?
I belive I have sorted it. I didn’t re-index ‘all posts’ (searchable_posts) only the products index.
Not fully understanding what the ‘all posts’ index is but that has resolved it
- This reply was modified 2 years, 7 months ago by curtisagitate.
I know the template is correct as other changes are showing. E.g the echoing out of the post_date which was done as a test. But also the page title…
I am still unable to get this data to show with {{ data.price }} despite seeing these attributes in algolia dashboard after indexing
Specifically this was caused by a script I had in the footer file that was aimed at solving passive listener issues which Google Pagespeed index didn’t like. I wrapped it in an if statement to not run on the checkout and that resolved the problem.
Thanks, have done
There are only 4 and they are effectively all the same. I have tried all but here is a link to one:
https://curtisrwilliams.co.uk/product/w8-gym-hot-pink/
Thanks
Yup payment is 100% being taken. I have performed a number of test payments in live with my own card and all were processed.
This is now in test mode and I can confirm the same problem is occurring. I look forward to your response
Have just done again and see that it appends URL with: https://curtisrwilliams.co.uk/checkout/#response=… (lots of letters…)
The site isn’t in test mode, it is a demo but the stipe connection is in live mode. Allow me a few minutes to change this to test mode
Thanks for your reply. The page refreshes and I see some content gets added into the URL at the top.
The transaction is created and successful.
But the order confirmation page doesn’t load.
I am not getting any console errors with inspect during this
Does that help?
If there was a JS error then how come the Paypal and Cash on delivery options don’t also have this?