Tell us what you are trying to do? I am building an auction site. I have two post types, Auction (product) and Bids. On the Bids PT, I have a custom number field that collects a bid from a bidder. Each bid creates a new post. In the Auction PT, I have a custom field called Max Bid. I'm wanting to get the highest bid from the Bids PT and place that value in the Auction Max Bid custom field. Then I want to compare that number to a new bid, using forms, and if the bid is higher it redirects you to a page stating you are the highest bidder. If the bid is lower, then it redirects you to a page that states there are bids higher. I'm assuming this will require PHP coding and I'm not too familiar with PHP.
Is there any documentation that you are following?
Hello. Thank you for contacting the Toolset support.
Yes - it obviously require some custom code but can you please tell me the flow.
From where user will add the Bids - is it from frontend or backend? if its from frontend is it using Toolset forms?
- is there a relation between bids and Auctions? How frequently the auctions are run?
Can you please share bit more details and then I'll be able to guide you in the right direction.
Thank you for getting back. Here are the answers to your questions...
From where user will add the Bids - is it from frontend or backend? Logged-in users are on the front end entering the bid.
Are you using Toolset forms? Yes, as I need to link with parent field (which I'm having issues with as well)
is there a relation between bids and Auctions? Currently, there is. It is a one (auction) to many (bids) relationship setup.
How frequently the auctions are run? When the item is available and will run for the determined time that is declared in the auction template.
What I'm needing is to find the highest bid in the many bid custom posts tied to the one auction the bids are attached. So Auction A is currently running and bids are coming in and ends tomorrow. The auction B starts today and runs through Friday. The Bid custom post is collecting the bids from both auctions. But I need to see only the bids for Auction A, determine the max bid for that product and then inform the bidder if or if not the highest bid. Same goes for Auction B. Need to separate the bids.
In a related issue on Toolset forms, I am having difficulty connecting the many bids to the one auction from the frontend. I need this form field to be hidden and the image should show the code. The form is not assigning the bid to the auction.
You can even use the view to query related posts and display it. It depends where and how exactly you want to display the maximum bid value.
Can you please share problem URL where exactly you want to display the maximum bid value and send me admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Where:
- Before redirect you can check by adding the custom code that bid is highest bid or not and based on that you can set the redirection page URL.
Do you happen to know a great PHP code to find the associated bids and get the highest bid from those and place it in the field so the form can compare it?
Can you please share two test post where one is having highest bit and another having not highest bit and based on those test post I'll try to share solution.
The topic ‘[Closed] Grabbing max value from series of child posts and inserting it on parent post’ is closed to new replies.