Viewing 3 reply threads
  • Author
    Posts
    • #7717
      levipe
      Participant

      Hi,

      I’m in the wine trade.
      I use WooCommerce.

      Products are wines.

      I created 3 content types
      – grape
      – region
      – estate

      I want to link products to content type posts

      This is the code:

      <?php
      /*
      Title: My custom fields
      Post Type: product
      */
      
      piklist('field', array(
          'type' => 'post-relate',
          'scope' => 'estate',
          'template' => 'field'
      ));
      
      piklist('field', array(
          'type' => 'post-relate',
          'scope' => 'grape',
          'template' => 'field'
      ));
      
      piklist('field', array(
          'type' => 'post-relate',
          'scope' => 'region',
          'template' => 'field'
      ));

      Settings are not saved.
      Then I started to dabble.

      Found out that the last relation-field is saved.

      1 field: no problem
      2 fields, second field will be saved (not the first)
      3 fields, third field is saved (not the 2 first)

      Probably something in the field description, though the checkboxes with the posts in scope show up all right.

      So, what do I have to do?

      Thanks,

      Charles

    • #7719
      Dan
      Participant

      Hi Charles,

      Not really a solution, but could you perhaps do the following:

      – Grapes – as tags to account for grape blends etc. allows multiple grape types to be selected.
      – Link the product to the estate.
      – Link the estate to the region.

      Dan

    • #7720
      levipe
      Participant

      Well,

      found out what happened.
      Results get saved only if there is more than one custom post in the custom post type

      Example:
      if I’d have only one grape (eg Pinot Noir) in the grape post type, then the relation won’t save.
      If I have more than one, then the save is performed.

      I guess this might be one for the bug list

      Charles

    • #7731
      Steve
      Keymaster

      @levipe– That’s really odd. And I wasn’t able to reproduce. Are you sure the one post in the grape cpt was “published”?

Viewing 3 reply threads
  • You must be logged in to reply to this topic.