Forum Replies Created

  • wpsolr
    Keymaster

    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.

    wpsolr
    Keymaster

    No, do not select variations post type on screen 2.2. Only products.

    wpsolr
    Keymaster

    As mentioned in our last answer, the fix had to pass automated tests. But it didn’t. We had to remove it.

    wpsolr
    Keymaster

    Add 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.

    wpsolr
    Keymaster

    If you edit and save, it will also index the new product’s price.
    If you want to reindex all prices, reindex all your products.

    wpsolr
    Keymaster

    Here 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)

    wpsolr
    Keymaster

    Yes, in functions.php or a in custom plugin.

    wpsolr
    Keymaster
    4 years, 1 month ago in reply to: Unable to create new core WPSolr 22.3, Solr 9.0 #30721

    There 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.

    wpsolr
    Keymaster

    calculate 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.

    wpsolr
    Keymaster

    Here 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;
    }
    wpsolr
    Keymaster

    You want to index all your products with a single variation price, the lowest?

    wpsolr
    Keymaster

    Indeed, 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)

    wpsolr
    Keymaster

    To be a bit more precise, themes are showing product prices on results. Not WPSOLR.

    wpsolr
    Keymaster

    Themes 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.
    wpsolr
    Keymaster
    4 years, 1 month ago in reply to: Date Facet with Range #30705

    Sorry, we only provide a date slider facet layout.

    What you ask for is a full new widget, and cannot be done with simple tweaks.

Viewing 15 posts - 961 through 975 (of 3,679 total)