• Resolved kouts34

    (@kouts34)


    Hello,

    I would like to ask a question regarding mapping boolean fields in taxonomies. I have a feed that contains data like:

    <Bright>true</Bright>
    <Elevator>true</Elevator>
    <NearToMetro>false</NearToMetro>

    I would like to add these amenities in a taxonomy, comma separated:

    {Bright[1]},{Elevator[1]},{NearToMetro[1]}

    If i leave it like that i get only true or false.

    If i enable mapping with something like that:

    In Your File: <Bright>true</Bright>
    Translated To: Bright

    I still get true or false.

    Can you please help me?

    Kind regards,
    George

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @kouts34

    Unfortunately, it’s not possible to output the import element names. The best way to tackle this would be with a custom PHP function: http://www.wpallimport.com/documentation/developers/execute-php/. Example function:

    function my_output_term( $is_output, $term_name ) {
    	return ( $is_output == 'true' ) ? $term_name : null;
    }

    Example usage:

    [my_output_term({Bright[1]},"Bright")],[my_output_term({Elevator[1]},"Elevator")],[my_output_term({NearToMetro[1]},"NearToMetro")]

    Keep in mind that this is only an example. You’ll need to adjust it as needed.

    Thread Starter kouts34

    (@kouts34)

    Hello,

    Thanks for your reply. I will give it a try. One thing to mention, when i add something like [my_output_term({Bright[1]},”Bright”)] in the taxonomies, i get an error “[ unexpected character”. Should i add /[ ?

    I have read that / is an escape character when you are using Visual Composer.

    Once again thank you.

    Plugin Author WP All Import

    (@wpallimport)

    Hi @kouts34

    One thing to mention, when i add something like [my_output_term({Bright[1]},”Bright”)] in the taxonomies, i get an error “[ unexpected character”. Should i add /[ ?

    No, you shouldn’t have to escape functions. Please open a ticket about this at http://www.wpallimport.com/support/ so that we can take a look at what’s going wrong.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Mapping boolean fields in Taxonomies’ is closed to new replies.