Change size – Won't work!

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Change size – Won't work!

This topic contains 14 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 1 month ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #12363
    Jan Trier
    Jan Trier
    Participant

    Hey Guys,

    I want to change the size of my search bar but it doesn’t work. I increase the amount of pixel of the high but nothing happens…
    Also if I change the width… I wan to make it smaller… Nothing happens…

    Could you please check that?

    Greetings and Thank You!

    #12369
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Thank you for the proper details!

    I just checked, but it appears to me the same size as configured on the back-end (60px height, 100% width): https://i.imgur.com/kN5M7mJ.jpg

    After making changes and re-freshing your front-end I recommend clearing all caches, in case you have any. Refreshing by pressing CTRL + SHIFT + R is usually enough, but if you have server side cache, then you might have to clear that as well.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #12370
    Jan Trier
    Jan Trier
    Participant

    Where do you configure that?

    Because I also checked Firefox and other PC, but they do not see any changes?
    You cann set the height to 100px if you want. But if I change the high in:

    Ajax Search Pro -> main Settings -> Theme options -> Overall box layout -> Seach box height -> 60px -> save

    I do not see any changes!

    #12371
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Where do you configure that?
    What do you mean?

    Because I also checked Firefox and other PC, but they do not see any changes?
    Make sure to clear your site and browser cache, on all levels. If you use clodudflare or other CDN, make sure to clear that as well! Cloudflare can cache all CSS and Javascript files, and cause this issue.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #12376
    Jan Trier
    Jan Trier
    Participant

    I mean, could you please describe, where are you change the width and hight of the search bar?

    I use cloudflare. But I changed it yesterday!

    #12377
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You can change it exactly where you described: https://i.imgur.com/4Sb1GN5.png

    You always have to clear all the cache when you make style changes on your website, otherwise cloudflare will serve the old CSS and JS files. This is definitely only a cache related problem, as the option changes, and if I load up the stylesheet in console with a different query string, the changes are there.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #12380
    Jan Trier
    Jan Trier
    Participant

    Okay, it is now working! – Thank You!

    And I have one question left. Is it possible to show the price of each product which is shown in the result list of the ajax search bar?
    The values of the prices are saved in custom fields. To get the lowest price of one product I am supposed to make a SQL query or to make a PHP query.

    Is it possible?

    Greetings

    #12382
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    If it’s stored in a custom field, you can use the advanced title or description fields for that, without coding. Please check this section of the documentation: Advanced title & description fields

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #12383
    Jan Trier
    Jan Trier
    Participant

    Hi,

    okay, Thank You! – I am going to check it out right now.
    Do you know Advanced Custom Fields?

    The prices are stored in a repeater. So I have a different amount of prices for each product because one product is linked to 3 shops and one is linked to only 1 shop. My problem now is to get the cheapest price. Because the cheapest price could be in the repeater field 0, 1 or 2 for the product with 3 different linked shops…

    So, I cannot say select field 0 to get the cheapest price. I must compare all fields of each product. Can I also do that in the plugin?

    #12393
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    With a custom code this could be possible. As a starting example here is this tutorial: Custom fields in result titles

    I guess ACF has functions to get the repeater field values based on post ID and repeater field name, that’s the one thing you will need. And then just loop over the values to find the lowest one, and add it to the title field.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #12403
    Jan Trier
    Jan Trier
    Participant

    Hey,

    there is a way to get the lowest price by post ID. I wrote you an example for that:
    http://pastebin.com/5kEEQTpH

    My question now is, how can I get the post ID from the search and how can I add the filter?

    Greetings and Thank You!

    #12404
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    In that code loop the $v->id is the post id. I’ve aggregated your solution with the sample code. I haven’t tested this, but it should be close to a solution:

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #12407
    Jan Trier
    Jan Trier
    Participant

    Do I have to return the price or something like this?

    "<font color=\"#01de01\">" . min($price_array_min) . "€<font>";

    And I have two further question.
    1. Where I’m supposed to insert the code?
    2. Do I have to take any actions in the Ajax Search Bar Pro Settings? – Or will the result displayed automated?

    #12408
    Jan Trier
    Jan Trier
    Participant

    Okay, it is working!
    Thank You! – It is also the right price! 🙂

    You can test it here https://gamekeys-shop.de/

    But I have one question left!
    Is, and if yes, how, it possible to display the price below the title and can I add some words like “Now”?

    #12410
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I’m glad it’s working now 🙂

    Well, for example instead of changing the title, you could add it to the description field instead. So I would change line 12 in the code above to:

    $results[$k]->content  .= $price;

    If you want to add some words to it, you can simply do it as well:

    $results[$k]->content  .= 'Words before ' . $price . ' words after';
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.