How to detect if a listing is premium, to hide other elements from sight

This topic contains 2 replies, has 3 voices, and was last updated by  Paolo 7 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #204505

    Anthony Accetturo
    Buyer
    Post count: 76

    I need to expend the feature that hides related listings on premium listings. What is the method used to detect a premium listings, and how can it be expanded to other elements like widgets. My end goal will be to hide a widget containing related listing, popular listings and ads from premium listings. Where can I look to find this code to replicate it, and what table is it using to identity the listing is elevated?

    #204610

    Guust
    Moderator
    Post count: 29970

    If you use a price package that is featured, then in the package settings, you can turn off the related listings tab for those listings only.
    I’ll get Paolo to look at your question too, he might know how to hide widgets on a detail page that shows a featured listing, or a listing of a particular price package.

    #204752

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    you could try using a plugin like widget logic: https://wordpress.org/plugins/widget-logic/

    The logic to determine package ID would be:

    global $post; return ($post->package_id != 7);

    Where 7 is the only package where you don’t want the widget to show.

    Instead if you want to show a widget in more than one package you can use something like:

    global $post; return (in_array($post->package_id,array('7','9')));

    In this case the widget will appear on listings with package ID 7 AND 9.

    Let us know how you went.

    Thanks

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket