Skip Navigation

[Gelöst] Question regarding my thought process for using custom types and shop page

This support ticket is created vor 8 Jahre, 3 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 5 Antworten, has 2 Stimmen.

Last updated by joshB-6 vor 8 Jahre, 3 Monate.

Assisted by: Ross Fisher.

Author
Artikel
#364414
13208D2EE2DEA45DC784DFD30FD4B3AFEFDA1A9A12E3A11EE6pimgpsh_fullsize_distr.jpg

I am trying to: find out of my thought process is correct

I visited this URL:

I expected to see:

Instead, I got:

#364459

Thank you for contacting Toolset support, I'd be delighted to assist!

That sounds like a solid post relationship/taxonomy relationship at first glance. "Forthcoming" and "Past" could be setup as a post filter in your View to sort by date instead of having two CPTs.

Another solution for is you wanted to simply offer online auctions with WooCommerce would be to start with a plugin that has this already and customize it using Toolset: hidden link

#364473

Hi Ross.

Thanks for your speedy reply.

I am actually already using an auction plugin called WooCommerce Auctions.

That side of the site is already set up and working as it should.

The part I am working on now is for the live auctions that the company does. These products will not be for sale. The reason i was thinking of using two CPT's is because past auctions will have slightly different custom fields to the forthcoming auctions. For example the Forthcoming auction will have a low and a high value estimate and a form to submit a telephone bid, and the past auction will have the results. Forthcoming auctions will then be changed over to past auctions through the the Woocommerce REST API with the company's auction system that they use to run live auctions.

I will be doing an import of the previous auctions data in to the db once I have this figured out.

Do you still think it would be better to have one CPT or two, knowing what you know now? In other words once the product is added int o the database as a forthcoming auction, we would just be changing the forthcoming CPT to Future and adding the price the lot sold for.

Your advise is most welcome as I have never worked on a site using CPT's before.

Best regards.
Josh

EDIT: Just a quick final question, After some more reading, What I believe I need to be doing is actually a custom taxonomy, not a CPT and the custom taxonomy will be what is used to differentiate an online auction product from a forthcoming or past live auction product?

#364517

Thank you for the explanation! What I see is a duplication of data but there are two ways this could be done.

1. Two CPTs. The middleware application copies from future to past while transforming the data.

2. One CPT, logic runs on pageload to render the view conditionally dependent upon a variable such as future/past to conditionally display certain information.

As all posts regardless of CPT are all stored in the database in the same table, there wouldn't be a performance benefit to splitting the CPTs. However, storing all in the same table and running conditional logic would impact server load as the logic would need to be interpreted and processed on each page load to generate the HTML to send to the client's browser.

One heads up moving forward, if you plan on storing tens of thousands of posts or more, regardless of CPT - you may run into performance issues due to the way WordPress handles storing data in MySQL: https://codex.wordpress.org/images/thumb/9/97/WP3.8-ERD.png/500px-WP3.8-ERD.png

This can be improved by using PHP 5.6 or newer with OpCode Caching, here are some example settings for production: hidden link

Another big one is to use the PECL PHP Redis extention and use a Redis backend as a database transient store, this will help a ton with common queries and helps from overloading MySQL: https://wordpress.org/plugins/redis-cache/

#364629

Thanks for your reply Rob.

Just one more quick question about the correct use of fields vs taxonomies:

CPT: "Auction Lots" all lots will be added as CPT's into the db
Each lot will have the following custom fields:
-Lot Name
-Auction Name/code
-Description
-Lot Number
-Session
-Image
-Artist
-Author
-Low Estimate
-High Estimate
-Price sold for (this will be the differentiator do decide if it is a past or forthcoming auction)
etc...

Then I would need a custom taxonomy to be able to classify the lots by category I think?
e.g.
Art, Photography, Jewellery, Carpets, books, etc.
or would this be a field also?

The custom view loop will then allow visitors to filter their results by auction name etc.

#364667

I discovered the property listings demo site and went in dug around to see how it was done and was able to figure out how i needed to lay things out.

Thank you.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.