Viewing 1 reply thread
  • Author
    Posts
    • #749
      r.cespa
      Member

      Hi, all!

      I’m starting to play with Piklist and I’m happy discovering something new every day using the forum, the docs and the source code.

      I’m trying to build a travel related web site with offers for holiday packages (flight + hotel + ground services, etc).

      I set up a couple of CPTs: hotel and offer; hotels will be related to offers as soon as I figure how to work with relationships. Offer CPT has a couple of custom taxonomies: departure-airport and arrival-airport. Everything is fine here. The idea is that an offer is built on:

      one or more hotels
      a group field (add_more => true) containing:
      departure-airport via text field
      arrival-airport via text field
      departure-date via date field
      several prices (double room, single room, etc) via text fields

      Everything is almost working as expected but if I insert the airport three letters code in one of the text fields with ‘scope’ => ‘taxonomy’ (e.g. FCO for Rome Fiumicino or LHR for London Heathrow) the term is inserted in the taxonomy, the term_id is saved but:

      in the taxonomy page there is no CPT associated to the term (so FCO element count is zero) item count is correct if I publish the CPT
      in the edit page the term_ID is shown in the text field

      I understand that text field is not the best choice but I want to give the user the ability to add new airports or cities without leaving the page. The idea is to set up some form of autocomplete to help the user and text field is ok for this.

      Here is my code: http://pastebin.com/tbHvdPU8

      One more problem is due to the fact that as soon as I add more items of the same group of fields (e.g.: one with departure from Rome and one with departure from Milan), I have two text fields in each group. Probably Piklist loops through all the associated terms and prints out one field per term.

      Ciao,
      Roberto

       

    • #751
      Steve
      Keymaster

      @r.cespa– I’m not sure I understand the issue, but if you’re having a problem with the count, this code might help: http://piklist.com/support/topic/taxonomies-custom-post-statuses-and-wp_tag_cloud/#post-672

Viewing 1 reply thread
  • You must be logged in to reply to this topic.