Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Advanced title methods
This topic contains 18 replies, has 2 voices, and was last updated by Ernest Marcinko 4 years, 12 months ago.
- AuthorPosts
- November 27, 2018 at 11:45 am #20122
Hello,
is there a way to have title conditional logic like so:
if {title1} has data, show only it, but if not, show {title2}
I’m using Iconic – Show single variations plugin, which generates “single products” out of all variables. The results show up on your search but It only shows parent title. There is a table for the title which is _jck_wssv_display_title but I hate that it then shows both titles, the parent and the variable title.
Also is there a way to set up search as static? I have a fixed header that scrolls with the site, but the search doesnt.
BTW SITE IS LIVE, PLEASE DO NOT ALTER ANYTHING ELSE! ?
Thanks!
November 27, 2018 at 12:39 pm #20125Hi,
Thank you for the details, it helps me a lot.
I think I understand what you need here, but that is not possible without using custom code, as the title is always set and the conditional fields then would not work.
Try this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!Scrolling fixed header question
By default, the plugin should recognize that, when initialize and should fix the results there, but in this case it fails, as the header is only fixed after initial scrolling. Using a bit of custom CSS however will help:.asp_r_3 { position: fixed !important; }
It will still ‘jump’ once the header fixation happens during the scrolling, but it will be much smoother.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 27, 2018 at 2:19 pm #20131Thank you so much, fast support and and worked right out of the box.
Let me know if you can still help with me this small thing. I’ve attached an image, I tried adding custom field to 2nd description and advanced descrption but I can’t seem to make it work. I’d like to add Woocommerce category “tree” there. You can see what I mean in the file I’ve included.
Thanks!
–Jyri
Attachments:
You must be logged in to view attached files.November 27, 2018 at 2:30 pm #20133Hi Jyri,
Well, if most of the items are categorized hierarchically, then you could use the advanced content field syntax like so:
For all the parameters you can check this documentation. This is not the best way, as non hierarchical items will be still printed separated by ‘>>’, but it’s definitely better than nothing.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 27, 2018 at 3:39 pm #20134Thanks again!
Last one, I promise! 🙂
{_jck_wssv_display_title}{titlefield}<font style = “color: #2884c5;”> [ – Tarjoushinta: {_sale_price} <font style =”font-size: 80%; color:#555;”>norm.][ {_regular_price}]</font></font>
Thats my title right now.
Tarjoushinta = sale price
norm = normallyOkay so the problem is that when I use the custom script you gave me for functions.php I lose prices for the variable products. Is there something to modify so that would work aswell?
November 27, 2018 at 4:08 pm #20138No problem 🙂
I see, that is indeed a problem. How about, using this custom code instead of the previous:
This will remove the original title from the constructed title, when the custom field exists.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 27, 2018 at 4:49 pm #20141Hi,
sorry to say I can’t get this code to work. Prices are back but titles are not showing again 🙂
November 27, 2018 at 5:07 pm #20143Hi,
Well, I am not sure then. Maybe the product variation titles are conflicting in some way. Perhaps this variation:
If this does not work, then I think I will need temporary FTP access to debug this directly. In that case, can you please also link me a product, on which this should work on? Thank you!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 27, 2018 at 5:12 pm #20144Damn, it’s very close. Now it’s showing the variable attribute, not the title. The first code displayed it just right, it only lost the price from it.
–Jyri
Attachments:
You must be logged in to view attached files.November 28, 2018 at 10:17 am #20148You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 28, 2018 at 10:28 am #20149You cannot access this content.November 28, 2018 at 12:56 pm #20151Hi!
Thanks for the details, I think I have managed to find a solution. I have changed the advanced title field like so:
<font style = "color: #2884c5;"> [ - Tarjoushinta: {_sale_price} <font style ="font-size: 80%; color:#555;">norm.][ {_regular_price}]</font></font>
The {titlefield} is no longer there, it is automatically added before the rest of the field
..and also the custom code a bit:It should display the result titles correctly now.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 28, 2018 at 1:15 pm #20152Thank you so much. Support 5/5! 🙂
Br. Jyri
November 28, 2018 at 1:17 pm #20154You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 1, 2018 at 11:28 pm #20213 - AuthorPosts
You must be logged in to reply to this topic.