Forum Replies Created

Viewing 15 replies - 1 through 15 (of 599 total)
  • Plugin Author sbouey

    (@sbouey)

    Ok, this field a serialised array from an option, you can use an online serializer / unserialize , you can try the online onlinephp.io

    I have started to make on my dev system something to make it directly in falang but sometimes it’s not a good idee and use a filter when it’s possible it’s better, i think you want to translate the ovabrw_tour_included_text

    look at the documentation of the popup make for the close button

    https://www.faboba.com/en/wordpress/falang-for-wordpress/documentation/173-how-to-translate-popup-maker.html

    stéphane

    Plugin Author sbouey

    (@sbouey)

    perhaps you can ask in the woocommerce forum with a link on this one , they are more use to work with woocommerce, the falang code is quite easy here

    Plugin Author sbouey

    (@sbouey)

    look at the first page , we have write about this

    i’m sorry but help you like this on this forum with a code i can’t test it’s too complicate and consume time. we are not on Falang support,

    Plugin Author sbouey

    (@sbouey)

    try this,

    /* New Product Tab @ WooCommerce Single Product */
    if (class_exists( 'Falang' )) {
    if ( has_term( 'noleggio', 'product_cat' ) || has_term( 'rents', 'product_cat' ) ) {
    $current_locale = Falang()->get_current_language()->locale;
    if ($current_locale == 'it_IT') {
    add_filter('woocommerce_product_tabs', 'woo_new_product_tab_it', 9999);
    function woo_new_product_tab_it($tabs)
    {
    $tabs['docs'] = array(
    'title' => __('Preventivo', 'woocommerce'), // TAB TITLE
    'priority' => 50, // TAB SORTING (DESC 10, ADD INFO 20, REVIEWS 30)
    'callback' => 'woo_new_product_tab_content_it', // TAB CONTENT CALLBACK
    );
    return $tabs;
    }

    function woo_new_product_tab_content_it()
    {
    // The new tab content
    global $product;
    echo 'richiesta noleggio volo per ' . $product->get_name();
    echo do_shortcode('[forminator_form id="1046"]');
    }
    }
    if ($current_locale == 'en_US') {
    add_filter('woocommerce_product_tabs', 'woo_new_product_tab_en', 9999);
    function woo_new_product_tab_en($tabs)
    {
    $tabs['docs'] = array(
    'title' => __('Quotation', 'woocommerce'), // TAB TITLE
    'priority' => 50, // TAB SORTING (DESC 10, ADD INFO 20, REVIEWS 30)
    'callback' => 'woo_new_product_tab_content_en', // TAB CONTENT CALLBACK
    );
    return $tabs;
    }

    function woo_new_product_tab_content_en()
    {
    // The new tab content
    global $product;
    echo 'rent request for ' . $product->get_name();
    echo do_shortcode('[forminator_form id="1059"]');
    }
    }
    }
    }
    Plugin Author sbouey

    (@sbouey)

    it’s the same but like i said before i wouldn’t have write my code like this

    don’t put an AND but OR you have to display it for noleggio OR rents

    Plugin Author sbouey

    (@sbouey)

    No threre are nothing about categories in the code but now the content is set correctly for each language ?

    Plugin Author sbouey

    (@sbouey)

    I wouldn’t have written my code like that but can you try this

    /* New Product Tab @ WooCommerce Single Product */
    if (class_exists( 'Falang' )) {
    $current_locale = Falang()->get_current_language()->locale;
    if ($current_locale == 'it_IT') {
    add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab_it', 9999 );
    function woo_new_product_tab_it( $tabs ) {
    $tabs['docs'] = array(
    'title' => __( 'Preventivo', 'woocommerce' ), // TAB TITLE
    'priority' => 50, // TAB SORTING (DESC 10, ADD INFO 20, REVIEWS 30)
    'callback' => 'woo_new_product_tab_content_it', // TAB CONTENT CALLBACK
    );
    return $tabs;
    }
    function woo_new_product_tab_content_it() {
    // The new tab content
    global $product;
    echo 'richiesta noleggio volo per ' . $product->get_name();
    echo do_shortcode( '[forminator_form id="1046"]' );
    }
    }
    if ($current_locale == 'en_US') {
    add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab_en', 9999 );
    function woo_new_product_tab_en( $tabs ) {
    $tabs['docs'] = array(
    'title' => __( 'Quotation', 'woocommerce' ), // TAB TITLE
    'priority' => 50, // TAB SORTING (DESC 10, ADD INFO 20, REVIEWS 30)
    'callback' => 'woo_new_product_tab_content_en', // TAB CONTENT CALLBACK
    );
    return $tabs;
    }
    function woo_new_product_tab_content_en() {
    // The new tab content
    global $product;
    echo 'rent request for ' . $product->get_name();
    echo do_shortcode( '[forminator_form id="1059"]' );
    }
    }
    }
    Plugin Author sbouey

    (@sbouey)

    Hi,

    The translation page show the original data but you can’t modified it, the title / slug are in readonly but i have problem to put the editor in readonly mode

    it’s only here to help you to make the translaion manually or with an translate engine .

    Perhaps i have not understand well your question if you can put a screenshot it can help

    Stéphane

    Plugin Author sbouey

    (@sbouey)

    Can you put back here the full code of function.php

    Plugin Author sbouey

    (@sbouey)

    Hi, it’s hard to help you more, i give you the logic and the code to add in function.php

    But without making it myself to see what’s wrong , it’s complicated. i have only some parts of the code

    with widget classic you can put a widget by language

    Plugin Author sbouey

    (@sbouey)

    the change i give you before are not in this code

    Plugin Author sbouey

    (@sbouey)

    it’s why i ask for the full php code , work only on part is not enought for you because you are not a dev

    you have to use a version of woo_new_product_tab_content by language in your case

    pub back all the code here not part of it

    Plugin Author sbouey

    (@sbouey)

    change the callback for us

    'callback' => 'woo_new_product_tab_content_us'

    for it

    'callback' => 'woo_new_product_tab_content_it'

    with

    function woo_new_product_tab_content_it() {
    // ITALIAN TAB CONTENT
    global $product;
    echo 'richiesta noleggio volo per ' . $product->get_name();
    echo do_shortcode( '[forminator_form id="1046"]' );
    }

    and

    function woo_new_product_tab_content_us() {
    // ENGLISH TAB CONTENT
    global $product;
    echo 'rent request for ' . $product->get_name();
    echo do_shortcode( '[forminator_form id="1059"]' );
    }
    Plugin Author sbouey

    (@sbouey)

    add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab', 9999 );

    from here $tabs is the parameter but it’s not necessary to add it because it’s only 1 parameter, the 9999 mean you will execute this after other filters

    Plugin Author sbouey

    (@sbouey)

    In this case

    /* NEW PRODUCT TAB IN WOOCOMMERCE SINGLE PRODUCT */
    function woo_new_product_tab($tabs)
    {
    if (class_exists('Falang')) {
    $current_locale = Falang()->get_current_language()->locale;
    if ($current_locale == 'en_US') {
    $tabs['docs'] = array(
    'title' => __('Quotation', 'woocommerce' ), // TAB TITLE
    'priority' => 50, // TAB SORTING (DESC 10, ADD INFO 20, REVIEWS 30)
    'callback' => 'woo_new_product_tab_content', // TAB CONTENT CALLBACK
    );
    }

    if ($current_locale == 'it_IT') {
    $tabs['docs'] = array(
    'title' => __('Preventivo', 'woocommerce' ), // TAB TITLE
    'priority' => 50, // TAB SORTING (DESC 10, ADD INFO 20, REVIEWS 30)
    'callback' => 'woo_new_product_tab_content', // TAB CONTENT CALLBACK
    );
    }
    }

    return $tabs;
    }

    add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab', 9999 );
Viewing 15 replies - 1 through 15 (of 599 total)