Disbale link to Profile page for Free listings

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

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

Open Support Ticket
  • Author
    Posts
  • #67448

    Shane
    Buyer
    Post count: 149

    Hi all,

    Me again 😀

    Just wondering how I might create a mod to disable the Listing Title on the Listings Page linking to the profile page if the listing is a free / non-claimed listing?

    Thanks

    Shane

    #67482

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    you’ll have to create a geodirectory folder in your child theme. In that folder create a copy of the listing-listview.php template and customize the code.

    To check if a listing is claimed:

    
    
    global $post;
    $is_owned = geodir_get_post_meta($post_id,'claimed',true);
    if ($is_owned == '0') { // your function here }
    

    To check if a listing is featured

    
    
    global $post;
        if(isset($post->is_featured) && $post->is_featured){
            // your function here
        }
    

    To check for both things in one statement:

    
    
    global $post;
        $is_owned = geodir_get_post_meta($post_id,'claimed',true);
        if(isset($post->is_featured) && $post->is_featured && $is_owned == '0'){
            // your function here
        }
    

    Let us know how you went.

    Thanks

    #67503

    Shane
    Buyer
    Post count: 149

    Many many thanks yet again Paolo.

    How might I check if it belongs to a specific pricing package?

    for example

    if ($pricing_package_ID = “34”) {…..?

    #67603

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    
    
    if (isset($_GET['package_id'])){
    $pid = $_GET['package_id'];
    if ($pid == 34) {
    // function here
    	}

    You are welcome 🙂

    #67634

    Shane
    Buyer
    Post count: 149

    Thank you.

    As a follow up, using the code you gave me above,

    global $post;
    $is_owned = geodir_get_post_meta($post_id,’claimed’,true);
    if ($is_owned == ‘0’) { // your function here }

    Basically I set that if owned to allow hyperlink, if not to disable.

    When ($is_owned == ‘0’) nothing disabled.

    When (!$is_owned == ‘0’) or ($is_owned == ‘1’) everything disabled.

    As I uploaded using the import feature and assigned to me, does the system see them all as claimed by me?

    #67637

    Paolo
    Site Admin
    Post count: 31206

    actually that would work on the add listing page only, this is actually what’s needed on listing and detail page:

    
    
    
    global $post;
    if ($post->package_id == 1) {//function here}
    

    Thanks

    #67638

    Shane
    Buyer
    Post count: 149

    Thanks again,

    Just edited my last comment as still an issue with previous query.

    Thanks

    #67639

    Paolo
    Site Admin
    Post count: 31206

    That depends how you imported them, do you still have the csv file to check?

    #67642

    Shane
    Buyer
    Post count: 149

    Apologies,

    I am getting mixed up with production site.
    I am working on test site.
    This is the one I am editing now I am just using the sample data and manually input 2 using PayPal sandbox to process.

    #67644

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I’d need to check your backend to tell you more, I can’t guess things.

    If you provide a link and admin credentials I’ll have a look.

    Thanks

    #67648

    Shane
    Buyer
    Post count: 149

    Leave with me a bit.

    You have done loads for me already.
    I will figure it out.
    Not a full time, or even trained coder, just self taught but I figure stuff out pretty quickly.

    If really stuck I will get back to you.

    Thanks again Paolo.

    #67650

    Paolo
    Site Admin
    Post count: 31206

    ok, you are welcome.

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

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

Open Support Ticket