- December 3, 2022 at 11:13 am #40377
The plugin is great, but there’s some unique functionality I require and without it, the plugin is no use to me. My client sells paint and each WooCommerce product has a custom field $rgb_values that define the colour of a swatch. I would like to show that colour as the background colour of the search results product image.
You can see an example here https://www.advancedpaints.co.uk/product/pantone-012-012/ where the yellow background colour of the product image is set dynamically based on this custom field.
I have found the relevant code in /ajax-search-pro/includes/views/results/vertical.php and can hard code an RGB value into the image background colour on the results. What I’m trying to achieve is setting that value dynamically for the individual products shown in the search results.
I guess that this field will need setting up in your functions.php file or directly in vertical.php, but I can’t figure out how to make it available to the script? I do realise this is a customisation, but if you could provide any suggested code to pull in a custom Woocommerce product field into your script it would be amazing. I’ve spent hours trying to find a solution. I’m sure it’s an easy thing for you guys.
Mike.December 3, 2022 at 1:03 pm #40378
Pleased to report that this is now resolved. Try searching ‘pantone’ on this demo page and you’ll see each paint colour has a dynamically generated background colour.December 5, 2022 at 1:53 pm #40396
You must be logged in to reply to this topic.