• Resolved shrco

    (@shrco)


    Greetings,

    I need to be able to export property descriptions to Kyero, etc in multiple languages. Currently, the main description is in English and I believe it is just pulled from the post content. I have created a custom field to enter the description in Italian. I tried to use custom field mapping to map it to the Kyero xml feed. The only option I see to set the Kyero field to is “desc”. When I checked out the Kyero format they gave this example:

            <desc>
                <ca>Catalan property description</ca>
                <da>Danish property description</da>
                <de>German property description</de>
                <en>English property description</en>
                <es>Spanish property description</es>
                <fi>Finnish property description</fi>
                <fr>French property description</fr>
                <it>Italian property description</it>
                <nl>Dutch property description</nl>
                <no>Norwegian property description</no>
                <pt>Portuguese property description</pt>
                <ru>Russian property description</ru>
                <sv>Swedish property description</sv>
               </desc>

    Is there a way to map to individual language fields (ex.: <desc> <it>) instead of simply <desc>? I tried entering:

    If Description (Italian) is equal to * THEN <en>{post_content}</en> <it>{description-italian}</it>

    however the items with <> were removed. and i was only left with : {post_content} {description-italian}

    I would appreciate any help with this issue.

    Cheers, A

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter shrco

    (@shrco)

    I also saw the idea to use custom php code to hook into the houzez_feed_property filter to modify the desc field to merge the descriptions together for the XML feed. This is advanced for me, I’m not sure that will work, and I don’t want to go that route if possible. the code snippet suggested was this:

    add_filter('houzez_feed_property', function ($property, $post_id) {
    // Fetch the translations from custom fields (replace with your field names)
    $description_en = get_post_meta($post_id, 'description_en', true);
    $description_it = get_post_meta($post_id, 'description_it', true);
    $description_es = get_post_meta($post_id, 'description_es', true);

    // Build the <desc> structure with translations
    $property['desc'] = '<en>' . esc_html($description_en) . '</en>'
    . '<it>' . esc_html($description_it) . '</it>'
    . '<es>' . esc_html($description_es) . '</es>';

    // Return the modified property
    return $property;
    // Build the <desc> structure with translations
    $property['desc'] = '<en>' . esc_html($description_en) . '</en>'
    . '<it>' . esc_html($description_it) . '</it>'
    . '<es>' . esc_html($description_es) . '</es>';

    // Return the modified property
    return $property;
    }, 10, 2);

    Thanks

    Plugin Author Property Hive

    (@propertyhive)

    Hi there,

    I responded via email but for the case of this ticket:

    To include the italian description in the Kyero XML, assuming it’s in a custom field with the name specified, you can use a snippet like so:

    add_filter('houzez_property_feed_export_kyero_property_data', function ($property_xml, $post_id, $export_id) 
    {
    // Get the Italian description for the property (replace with your logic).
    $italian_desc = get_post_meta($post_id, 'description_it', true);
    if (!empty($italian_desc))
    {
    // Add the Italian description as a new child node within <desc>.
    $property_xml->desc->addChild('it', htmlspecialchars($italian_desc, ENT_QUOTES | ENT_XML1, 'UTF-8'));
    }
    return $property_xml;
    }, 10, 3);
    Thread Starter shrco

    (@shrco)

    Thanks, I got it to work fine!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.