I want to hide prices from specific product categories on search.

Home Forums Product Support Forums Ajax Search Pro for WordPress Support I want to hide prices from specific product categories on search.

This topic contains 2 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #47683
    screentime
    screentime
    Participant

    Problem 1:

    I have a category in which I want to hide prices from the search,
    I have created a custom field “hide_price” and added this snippet in advanced settings: “{titlefield}
    {if hide_price == false && _price} – Price: {_price}{/if}” but my website still displays the prices of the products I would like searched ie. https://audioholics.info/product/sonos-move-2-portable-speaker-each/
    What did I do wrong?

    Problem 2:
    On the search page(when you click enter) I only see 3 columns when I selected 6 within the settings. How do I go about rectifying this? I have added a screenshot for your perusal.

    #47704
    screentime
    screentime
    Participant

    you said your turn around time is 2 hour, its been 2 days since I posted this ticket!!!

    #47707
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    It’s usually 2 hours when I’m at the office. Unfortunately I’m a bit ill, so I had to take a day off.

    The problem with your pseudo-code is, that there is no such thing as “if” statements in the advanced fields: {if hide_price == false && _price} – Price: {_price}{/if}
    It’s a complicated story, but for that to work the advanced fields should be coded to be Turing complete (or at least partially), which is is just beyond it’s design and it wouldn’t make too much sense as the field can be modified programmatically.

    For these more advanced uses I suggest using the asp_results hook instead, as with that you can do whatever you want to any of the content fields via code snippets.

    On the search page(when you click enter) I only see 3 columns when I selected 6 within the settings. How do I go about rectifying this? I have added a screenshot for your perusal.
    The search results page is not controlled by the plugin, it’s an archive page and the layout is usually controlled by the theme or a page builder (if you have one). Usually there are options for the search archive in the theme settings where you can change the overall layout.

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.