Remove link from suggestions
-
Hi,
Is it possible to remove the product link from the product suggestions? I don’t want the single product page to be available.
Thanks! Jelle
-
Hello Jelle,
If you would like to disable click on suggestions, you can add the following code in your Child theme’s functions.php file:
add_action('dgwt/wcas/product/permalink', function(){ return ''; });Please backup your site before adding the code.
Best regards,
ClintHi Clint,
Thanks a lot, but what about the suggestions on the right side? The list with other suggestions, is it possible to turn the links of but keep the suggestions scrollable?
Thanks!
Br, Jelle
Hello Jelle,
You can try the following filter:
add_filter( 'dgwt/wcas/suggestion_details/product/html', function($html, $product_id){ $html = str_replace('to-replace', 'your-extra-html', $html); return $html; }, 10, 2);You need to modify the “text to replace” on the details panel HTML. I haven’t looked at this myself yet. Let me know how it goes and we’ll take it from there.
Best regards,
ClintHi Clint,
Thanks, but I don’t understand what you mean exactly. I don’t need to replace anything. I want to disable the clicking part for the scrollable suggestions. Normally this is working with tag, but is seems like there’s no tag in the markup?
Br, Jelle
Hi Jelle,
We’re getting the entire HTML structure for the details panel with the filter above. I take it that you don’t want any links in the details panel including Add to Cart button. Can you first share your site address so I can take a look? I’ll work on a solution for this and will get back to you.
Hi Clint,
Ah oke, thanks. Of course. My website is set to private. How can I provide you with the credentials safely?
This screenshot is showing my current setup. The red part should be visisble and srcollable, but not clickable to a single product page.
https://i.gyazo.com/f20a576c384be69457693843f9da7e95.png
Thanks!
Br, Jelle
-
This reply was modified 5 years, 1 month ago by
jellejacob.
Hi Clint,
Thanks I did:)
Br, Jelle
Hello,
You can use this filter:
add_filter('dgwt/wcas/scripts/disable_hits', '__return_true');Here is the better explanation – https://fibosearch.com/documentation/tips-tricks/how-to-remove-links-from-suggestions/
This filter works with FiboSearch > v1.9.0, so if anyone wants to use it before the official release, please contact us via https://fibosearch.com/contact/
Best
DamianThanks a lot Damian for solving the issue. Much appreciated!
Br, Jelle
-
This reply was modified 5 years, 1 month ago by
The topic ‘Remove link from suggestions’ is closed to new replies.