Forum Replies Created
-
wpsolrKeymaster4 years, 1 month ago in reply to: autocomplete_solr.js drives an endless reload loop in Chrome when url has # #30735
Unfortunately, this is something we could not fix without breaking other WPSOLR features.
It should only happen when the ‘(Deprecated) Use WPSOLR custom Ajax search templates’ search template option is selected on screen 2.1
If you can, you should switch to your own theme archive loop template instead.wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30733No, do not select variations post type on screen 2.2. Only products.
wpsolrKeymaster4 years, 1 month ago in reply to: autocomplete_solr.js drives an endless reload loop in Chrome when url has # #30731As mentioned in our last answer, the fix had to pass automated tests. But it didn’t. We had to remove it.
wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30730Add some debug traces in your code (echo ‘something’), to be sure it is called when you save a product. Also check your WP debug.log file.
wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30727If you edit and save, it will also index the new product’s price.
If you want to reindex all prices, reindex all your products.wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30725Here is the procedure:
1) Select type “Float” for “_price” on screen 2.2
2) In your code use “_price_f” (“_f” for float):$document_for_update['_price_f'] = 2000;
3) Save your product to reindex its price (or all your products if you want to see a single facet value (2000)wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30723Yes, in functions.php or a in custom plugin.
wpsolrKeymaster4 years, 1 month ago in reply to: Unable to create new core WPSolr 22.3, Solr 9.0 #30721There must remain some kind of a similar issue.
You can create, though, your index “index1” manually in Solr’s dashboard (with the WPSOLR config files), then connect it to WPSOLR with the “/solr/index1” path. This will work, because WPSOLR will not try to create “index1” as it already exists: it will just save the index configuration in database.
wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30718calculate new price here from wc_get_product( $post->ID ) and its variations
You can do whatever you want to calculate the price here.
You will need to reindex your products to see the price facet updated.wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30716Here is the idea: replacing the product _price just before sending the product to the index.
<?php use wpsolr\core\classes\WPSOLR_Events; add_filter( WPSOLR_Events::WPSOLR_FILTER_SOLARIUM_DOCUMENT_BEFORE_UPDATE, 'update_price_with_lowest_variation_price', 99, 5 ); function update_price_with_lowest_variation_price( array $document_for_update, $solr_indexing_options, $post, $attachment_body, $search_engine_client ) { switch ( $post->post_type ) { case 'product': $document_for_update['_price_f'] = /* calculate new price here from wc_get_product( $post->ID ) and its variations */; break; } return $document_for_update; }wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30714You want to index all your products with a single variation price, the lowest?
wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30712Indeed, WPSOLR found that Product1 has at least one variation with a price in the filter range 4000-5000.
But your theme is showing Product1 with a default price (lower variation price perhaps) not in the filter range.Some themes can show the price range of variations on products results, $2,000-$4,000 for your example.
You could also customize your search results price to show the intersection of filter range and price range (in the url as parameters), $4,000 in your example (intersection of 2000-4000 and 4000-5000)
wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30710To be a bit more precise, themes are showing product prices on results. Not WPSOLR.
wpsolrKeymaster4 years, 1 month ago in reply to: Display prices of a particular variation in filter #30707Themes only display products in search results, not product variations.
WPSOLR is indexing products with all their variations prices, which enables filtering products (not product variations) on all variation prices.
After getting the results from WPSOLR, the themes display the product with its price.- This reply was modified 4 years, 1 month ago by wpsolr.
wpsolrKeymaster4 years, 1 month ago in reply to: Date Facet with Range #30705Sorry, we only provide a date slider facet layout.
What you ask for is a full new widget, and cannot be done with simple tweaks.