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-
AuthorPosts
-
January 19, 2018 at 8:44 pm #413490
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!
January 20, 2018 at 12:34 am #413532Hello 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
January 20, 2018 at 12:42 am #413535Thank 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.
January 20, 2018 at 1:47 am #413546Hello 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/
January 20, 2018 at 2:11 am #413551Sorry, I can’t understand how that post offers anything of relevance.
January 20, 2018 at 2:26 am #413552It shows how to query for the listing ID.
January 20, 2018 at 2:29 am #413553Yes, but then how would I get that to affect a link? Maybe @stiofan can offer some insight.
January 20, 2018 at 10:29 am #413581Alex’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
January 24, 2018 at 9:30 pm #414280Thank 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?
January 25, 2018 at 8:02 am #414319Hello 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
January 25, 2018 at 8:21 am #414324I 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.
January 25, 2018 at 6:08 pm #414418Hi 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
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket