Support

Account

Home Forums General Issues Advice on ACF/DB best practice

Helping

Advice on ACF/DB best practice

  • I’m pretty new to development and PHP and would like some advice on how to structure the database tables etc.

    I have a page that lists boat schedules. I’ve used ACF repeater field with the following sub fields.

    departure date | return date | excursion

    This has been working fine and I’ve the different prices for each excursion in a separate table (based on date ranges – high season, low season)

    This works but I would prefer to include the prices within each row so users can easily see the pricing without having to figure it out for themselves.

    departure date | return date | excursion | cabin1 price | cabin 2 price

    Individual boats can have various cabin types, and number of cabin types, so I’ve added a further sub field (repeater with 2 sub fields = cabin type, cabin price)

    Is this the best way? It feels like I have to a lot of data entry putting in (sometimes the same) cabin information and price for every row. An average of 52 times for each yearly schedule.

    I’ve often found in the past that I have to update/change my set-up as I learn better ways of doing things. On this occasion, because there is potentially a lot of data entry, I thought it best to research the best way of doing it before moving too far forward.

    Any help and advice would be much appreciated.

  • If you have several “Cabins” that are used multiple time you should create a custom post type and then use a relationship field to associate them with boats. That way you can edit them once. I would also likely create an “Excursions” post type and then relate the boats to the excursions. But, this will become difficult to search, so it really depends on what you need to do with the information as much as it does with best practices.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Advice on ACF/DB best practice’ is closed to new replies.