amitramani
Forum Replies Created
-
Hi @bhshravankumar
Any luck with this?You are 100% correct, it was the PerfMatters plug-in. Specifically, it’s the “disable dashicons” setting that caused the issue. Once I turned that setting off, the color and size swatches are showing up.
Can you please check on your end to verify. Please clear your browser cache.
Many thanks for the awesome support.
Hello @aamiribsf
Here is a link:
https://www.tacknrider.com/shop/for-horses-womens-knee-patch-show-breeches-minnie/Typically, the Size Chart link would show up after the last attribute of the Size. When I disable the Variation Swatches plugin, the Size Chart link shows up.
Hello
I heard back from Google Shopping Support team. Here is their response:I have consulted this to our team of specialists and they have advised that you will need to provide shipping weight in the feed so that the system can pull up the shipping values accordingly.
Thus eliminating the error flag on your shipping cost.
Learn more about the shipping weight attribute:
shipping_weight: Definition
The shipping_weight attribute lets you include the weight to use when calculating shipping costs through your Merchant Center settings. For example, you would use shipping_weight when using carrier-calculated rates.How do I add the shipping_weight attribute to the feed? Does your plugin allow to add shipping_weight attribute to the feed for each item?
Please advise.Thanks
THanks for the answer.
I have setup account level shipping settings in the Merchant Center. We offer Free Shipping on most orders over $99 (with some exclusions).
Google is flagging that there is a shipping mismatch between the feed and the actual shipping amount.
I am asking your help on how to fix that discrepancy. Do I have to upgrade to the pro version in order to add the “shipping” attribute to the feed?
I tried adding the code “greeting_dialog_display=’hide'” to the PHP file, but that only works non-Chrome browsers (according to all the other support threads).
I would like to do the same. Any luck with this?
There is no easy way to control the display of the greeting dialog. Especially on mobile, it takes up a lot of space.
I tried doing it with CSS, but it does not work consistently.
BTW, I figured out the code I added was correct. I did not force a re-index of all the indices.
once you re-index, the code works as designed.
Forum: Plugins
In reply to: [WP Search with Algolia] Change Instantsearch page to grid to show productsFirst off, you need to add the ‘price’ field to your index. You do that by adding the following code to your child theme’s functions.php
function algolia_wc_post_shared_attributes( array $shared_attributes, WP_Post $post) { //$shared_attributes['visits_count'] = vm_get_post_visit_count( $post->ID ); $product = wc_get_product( $post ); // Extract prices. $variations_count = 0; if ( $product instanceof WC_Product_Variable ) { $price = $product->get_variation_price( 'min', true ); $regular_price = $product->get_variation_regular_price( 'min', true ); $sale_price = $product->get_variation_sale_price( 'min', true ); $max_price = $product->get_variation_price( 'max', true ); $variations_count = count( $product->get_available_variations() ); } else { $price = $max_price = $product->get_display_price(); $regular_price = $product->get_display_price( $product->get_regular_price() ); $sale_price = $product->get_display_price( $product->get_sale_price() ); } $shared_attributes['product_type'] = (string) $product->get_type(); $shared_attributes['price'] = (float) $price; $shared_attributes['regular_price'] = (float) $regular_price; $shared_attributes['sale_price'] = (float) $sale_price; return $shared_attributes; } add_filter( 'algolia_post_product_shared_attributes', 'algolia_wc_post_shared_attributes', 10, 2 );
Once this is done, you will need to re-index your posts/products indices from within Algolia dashboard in your WordPress Admin. This is a very important step.
The next step is to add the code to display this “price” field in the InstantSearch results. You will add the following code (around Line 33) of your child theme’s instantsearch.php
<div class="ais-hits--content"> <h2 itemprop="name headline"><a href="{{ data.permalink }}" title="{{ data.post_title }}" itemprop="url"><code>data._highlightResult.post_title.value</code></a></h2> <div class="ais-hits--price">${{ data.price }}</div> </div>
There is one more step. This new “price” field has been added to your Products index, not the Searchable Posts Index. Therefore, you will need to switch to using your Products index in your child theme’s instantsearch.php (around Line 50) like so:
/* Instantiate instantsearch.js */ var search = instantsearch({ appId: algolia.application_id, apiKey: algolia.search_api_key, indexName: algolia.indices.posts_product.name, urlSync: { mapping: {'q': 's'}, trackedParameters: ['query'] }, searchParameters: { facetingAfterDistinct: true, highlightPreTag: '__ais-highlight__', highlightPostTag: '__/ais-highlight__' } });
Forum: Plugins
In reply to: [WP Search with Algolia] Change Instantsearch page to grid to show productsHello @arjunmurali1993
I was just able to change the display to a grid on the InstantSearch results page. This is done via CSS. You will have to add the following CSS rules in your child theme’s style.css..ais-hits { display: grid; grid-template-columns: auto auto auto auto; grid-gap: 10px; padding: 10px; }
Hope that helps for the grid part. I was also able to add the “Price” field to the InstantSearch Results hit result. I will post that in the next reply.
Forum: Plugins
In reply to: [WP Search with Algolia] InstantSearch How to Add Range Slider for PriceNever mind, I figured it out.
The code in instantsearch (by default) uses the ‘searchable_posts’ index when instantiating instantsearch. However, I had added the ‘price’ field to the wp_posts_product index. So when I added the range slider for the Price, it really did not find the ‘price’ field in the ‘wp_searchable_posts’ index.
When I change the code to instantiate Instantsearch with ‘wp_posts_product’ instead, it started working fine.
I would still like to get your advise on this. Is this the right way to implement InstantSearch on WooCommerce? Do you suggest doing it another way?
All good, @tw2113 , I got it to work the way I wanted. I was able to add the “price” field to the “wp_posts_products” index. Then I was able to display the Price field in Autocomplete results.
Forum: Plugins
In reply to: [WP Search with Algolia] Custom Post Types for Faceting/RefinementNever mind, I figured out my problem. I had added the right code. I just had not re-indexed the indices so the “wp_searchable_posts” index still contained entries from all post types. Once I re-indexed from within the WP Dashboard, it is now working correctly.
Forum: Plugins
In reply to: [WP Search with Algolia] Custom Post Types for Faceting/RefinementWere you able to solve Part A of this question?
I tried adding the code referenced above to apply the “algolia_searchable_post_types”, but it does not work.
It does not even seem that the code is being executed. I tried returning false from my filter (just as a test), but the results still showed up.
Any ideas?