List of CPTs within the details page of a different CPT
This topic contains 6 replies, has 2 voices, and was last updated by Guust 7 years, 7 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: add-on, custom development
-
AuthorPosts
-
March 18, 2017 at 8:49 pm #368351
I’ve been searching the forum but haven’t found a solutions to what I’m trying to do. If anyone can point me in the right direction, I would be appreciative. Or, if what I describe below would take some extensive coding, I’d love to hire a developer to build an add-on. Either is fine.
I have 2 CPTs.
1. This post type is a location (Not a business location). More like a street corner.
2. The other post type is a business.What I’d like to do is have a list of businesses associated with the location within the details page of the location post type.
An example would be to have a location details page for “Maple and Elm” then listed on that page would be businesses within a short distance from Maple and Elm.
Business would be able to include their business name (along with a link to their page) on any location post type detail page they’d like. The listing is NOT necessarily based on location so it can’t be automatic. It must be requested.
The business detail page would also include a list of locations they service (with links to those location detail pages).
Businesses would get a standard listing on a location post type for free then would have the option to purchase a featured listing that would offer more information about the business and keep their listing on the top.
Thanks in advance for the help.
Let me know if this is unclear or would like a better example. I’m experienced at having plugins built so I’m happy to write up a scope of work if an add-on needs to be developed.
March 19, 2017 at 12:17 am #368362I think I understand the scenario, but not really sure.
1. I am assuming that you are adding the “location” listings yourself.
2. When setting up the “business” CPT, set it up so it links to the “location” CPT.
That will create a new tab/section on the detail page for a “location” called “businesses”.
https://wpgeodirectory.com/docs/linking-custom-post-types/3. Because users can only link their “business” to a “location” they added themselves, you will have to link any new “business” to the “location” yourself as admin.
When you link a “business” to a location in the backend as an admin, some details like the address will be overwritten with the details of the “location” listing.
So you would have to find a way around that, make sure to change the details back after linking for example.4. A “business” can only be linked to one “location”.
5. If you need a “business” to link to more than one “location”, I am assuming that the “business” has “branches”.
6. So that is when we enable the Franchise Manager for those “business” CPT.
https://wpgeodirectory.com/docs/franchise-manager-add-on/7. Make sure to enable the franchises in the “business” price packages.
https://wpgeodirectory.com/docs/prices-and-payments-add-on-overview/8. The Payment Manager will allow the option to purchase a featured listing that would offer more information about the business and keep their listing on the top.
Thanks
March 19, 2017 at 12:28 am #368364This reply has been marked as private.March 19, 2017 at 12:18 pm #368416You’re close but not quite.
1. I’m not adding locations myself. In my directory, anyone should be able to register and add locations. This includes business owners.
2, 3, 4. Businesses and location CPTs should be kept separate. There are different custom fields for each and they should be able to appear on the map as separate as well.
5. There aren’t branches of businesses but they can serve (and usually will serve) multiple locations. Some businesses CAN have multiple locations but 95% of the time, there will only be one business severing multiple locations.
I’m guessing I need to move this to the developemnt area to get this done?
Thanks for the quick reply and thanks for your time!!
March 19, 2017 at 12:36 pm #3684201. That does not matter, but linking can only be done by the same user or admin.
2, 3, 4. That is what linking CPTs does: CPTs are kept separate.
5. All listings can only have one address, that is why I suggested the franchise manager.
If you need custom development, add your request at https://wpgeodirectory.com/support/forum/geodirectory-jobs/
Thanks
March 19, 2017 at 7:51 pm #368462I like how you have that set up. It’s similar to what I want.
I think the problem will be that the businesses and locations will require a different set of custom fields.
Is there a way around the custom field bit?
I opened up a post in the job section even if I don’t get this figured out, I have other issues I’ll need help with.
March 19, 2017 at 10:24 pm #368470“Business” and “Location” are separate CPTs [that is why they can be linked], so they can have different custom fields.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket