Dynamic Listing Package link

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

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

Open Support Ticket
  • Author
    Posts
  • #413490

    Joy
    Buyer
    Post count: 1076

    Hi, how would in incorporate and “Upgrade Listing” package that would link to a specific price package and also invoke the listing ID number?

    We’re trying to have a popup appear on the Add/Edit Listing page that would have links to each package type. However, the link would need to be dynamic so that the active listing ID is input when the package is selected. Any ideas?

    Thank you!

    #413532

    Alex Rollin
    Moderator
    Post count: 27815

    Hello Joy,

    Use following code to get an upgrade listing url by using listing ID & package ID.

    
    
    
    $post_ID = '47'; // REPLACE POST ID
    $package_ID = '5'; // REPLACE PACAKAGE ID
    $upgrade_url = geodir_getlink( get_permalink( geodir_add_listing_page_id() ), array( 'pid' => $post_ID, 'package_id' => $package_ID ), false );
    

    The variable $upgrade_url will retrieve upgrade url like https://MYSITE.com/add-listing/?pid=47&package_id=5

    #413535

    Joy
    Buyer
    Post count: 1076

    Thank you. But isn’t that going to be a specific link applied for each listing ID and package ID rather than dynamically added in the info based on the link selection?

    Let me try to better explain the process I’m looking for. Once someone claims a listing, if they view the Upgrade Listing page, they will be presented with a popup. The popup will have the features of each package type offered(3 packages) with a link to “Select” a specific package. Once the link is clicked, it should load the package type, with the listing ID’s details.

    So far I know that we can remove a listing ID from the package link, but this would mean that the package would load, but the listing details would be blank – it would be like creating a new listing. I also know that I can include the listing ID in the package link, but that would mean that every customer who selects the link with the ID would be directed to that specific Upgrade Listing page for the specified ID. Which doesn’t work.

    How do I get the link package link, and have the listing ID to be used based on the currently viewed listing. So if someone is looking for the packages for listing 4, then the listing ID would be dynamically inserted into the link.

    #413546

    Alex Rollin
    Moderator
    Post count: 27815

    Hello Joy,

    Take a look at this post, to see how to get all the information for a post so you can develop a customization to do what you need to do:

    https://wpgeodirectory.com/support/topic/getting-data-of-listing-in-php/

    #413551

    Joy
    Buyer
    Post count: 1076

    Sorry, I can’t understand how that post offers anything of relevance.

    #413552

    Alex Rollin
    Moderator
    Post count: 27815

    It shows how to query for the listing ID.

    #413553

    Joy
    Buyer
    Post count: 1076

    Yes, but then how would I get that to affect a link? Maybe @stiofan can offer some insight.

    #413581

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Alex’s post above pretty much provides the answer:

    
    
    global $post;
    $post_ID = $post->ID; // use the current post ID
    $package_ID = '4'; // REPLACE PACAKAGE ID
    $upgrade_url = geodir_getlink( 
            get_permalink( geodir_add_listing_page_id() ), 
            array( 'pid' => $post_ID, 'package_id' => $package_ID ), 
            false 
        );

    Thanks,

    Stiofan

    #414280

    Joy
    Buyer
    Post count: 1076

    Thank you for your help. I added this snippet and this is the error I am getting:

    Fatal error: Call to a member function get_page_permastruct() on a non-object in /home/findlocalgarages/public_html/wp-includes/link-template.php on line 357

    To call this snippet I have tried to use: `<a href=”<?php echo $link_address;?>”> Link </a>
    `

    Am I missing something here?

    #414319

    Alex Rollin
    Moderator
    Post count: 27815

    Hello Joy,

    We are pointing out the approach as an example, and this is just the first step in composing the solution you are after.

    We are very focused on GD V2 at this moment, which, when released, will make many of these detail oriented changes fundamentally more approachable and in a more systematic way.

    We understand that this doesn’t solve your issue in the meantime, but this is also clearly outside of our support policy. This is a customization and you will need to find your own developer resources to implement the feature.

    Thanks for your understanding

    #414324

    Joy
    Buyer
    Post count: 1076

    I doubt that V2 will have any effect on what I am hoping to achieve here.

    A simple, “This is beyond our support” would have been appreciated, I find your response a bit condescending.

    In addition, it’s pretty impossible to know what is part of support and what isn’t. It’s really seems to be based on the developer who responds, in my experience, if it’s an easy enough question, it’ll be answered, once the question gets too complicated the support disclaimer is offered instead.

    I’m assuming I am missing a small part of this snippet that would address the error and provide me a solution. But thanks for your response anyway.

    #414418

    Paolo
    Site Admin
    Post count: 31206

    Hi Joy,

    let me explain our policy so that you won’t have doubts in the future.

    1) As a general rule customization are beyond support. This is pretty straightforward and I think easy to understand. You are paying for a software and the support to use it, not to modify it.

    2) However if the customization requested doesn’t take a lot of our time to be implemented and can be useful to others, we generally do implement it and provide it in the forum.

    3) If it takes more than 15 minutes we say no, because 1 customer’s customization would be stealing time to the rest of the community.

    What happens exactly is that either Guust, Alex, Kor or Me flag the request for the developers, they evaluate how easy/hard it would be and tell us yes or no and we report the answer to who originally asked.

    Hope this is clearer now.

    Thank you

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
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount