Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Replace description with SKU/Variation Description or?
- This topic has 4 replies, 2 voices, and was last updated 9 years, 11 months ago by
Ernest Marcinko.
-
AuthorPosts
-
June 10, 2016 at 2:50 am #8944
techoguy
ParticipantHi,
I just purchased the plugin and am testing it and all the configurations for my woocommerce site.First, questions, is there a way to include the SKU in place of the description in the search results?
The main reason for this is that I have variations turned on or included in the list so the same title shows up 5 times without any indication that it’s different. So I was hoping to display either the SKU or the variation description (or even both).
The other option and question 2 is there a way to search variation as well but only display the parent product ones?
I’ve included the screenshot to show you what I’m talking about.
Thanks for the great plugin!
-ChaseJune 10, 2016 at 2:51 am #8945techoguy
Participantsorry the page reloaded and lost the attachment.
June 10, 2016 at 8:59 am #8954Ernest Marcinko
KeymasterHi Chase,
Thanks for your kind words!
It is possible to display the SKU instead of the description.
On the Advanced Options -> Content panel, there is an option called Advanced Description Field, which allows you to enter custom fields alongside with the product description: https://i.imgur.com/WLrnYYe.png
Basically, in your case I would use this value there:[code]{_sku} – {descriptionfield}[/code]
This should result: ProductSKU – Product description
Or if you simply only need the sku, then use only:
[code]{_sku}[/code]
I hope this helps your case!
June 11, 2016 at 9:30 pm #8968techoguy
ParticipantThanks for catching and fixing my typo in my email. That’s a great feature and makes it easy to display what every I want, I like that.
The second part to this is that I need to search Variations, but is there a way to search variations but only display the parent product or if the variation is listed to not display the parent of that variation? I’m just curious if there is a way to do this so I can test it.
Right now the confusing thing is that the parent product is listed as well as the variations but you can’t actually purchase the parent.
thanks in advance!
June 13, 2016 at 5:30 pm #8995Ernest Marcinko
KeymasterHi again!
There is no option to do that, unfortunately product variations are stored as separate post objects, however I might have found a possible solution for you.
After some experimenting I was able to come up with this code:
You can put this code to the functions.php file in your active theme directory. It locates product variations from the reuslts and collect their product IDs. Then removes the parents from the list if it’s present – so only variations are left.
This is the closest I could get, I hope it’s something you needed.
-
AuthorPosts
- You must be logged in to reply to this topic.