sbouey
Forum Replies Created
-
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] Woocommerce Post Meta disappearOk, 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
stéphane
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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,
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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"]');
}
}
}
}Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?No threre are nothing about categories in the code but now the content is set correctly for each language ?
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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"]' );
}
}
}Forum: Plugins
In reply to: [Falang multilanguage for WordPress] Woocommerce Post Meta disappearHi,
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
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?Can you put back here the full code of function.php
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?the change i give you before are not in this code
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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"]' );
}Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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
Forum: Plugins
In reply to: [Falang multilanguage for WordPress] translation of functions ?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 );