• ResolvedPlugin Author RealMag777

    (@realmag777)


    Hi Folks!
    There is one bug in v.1.1.2 with custom labels.
    It is resolvable:
    * go to classes/helper.php
    * find function wpml_translate
    * replace it with the code below:


    public static function wpml_translate($taxonomy_info, $string = '')
    {
    if (empty($string))
    {
    $string = $taxonomy_info->label;
    }
    //***
    $check_for_custom_label = false;
    if (class_exists('SitePress'))
    {
    $lang = ICL_LANGUAGE_CODE;
    $woof_settings = get_option('woof_settings');
    if (isset($woof_settings['wpml_tax_labels']) AND ! empty($woof_settings['wpml_tax_labels']))
    {
    $translations = $woof_settings['wpml_tax_labels'];
    //$translations = unserialize($translations);
    /*
    $translations = array(
    'es' => array(
    'Locations' => 'Ubicaciones',
    'Size' => 'Tamaño'
    ),
    'de' => array(
    'Locations' => 'Lage',
    'Size' => 'Größe'
    ),
    );
    */

    if (isset($translations[$lang]))
    {
    if (isset($translations[$lang][$string]))
    {
    $string = $translations[$lang][$string];
    } else
    {
    $check_for_custom_label = TRUE;
    }
    } else
    {
    $check_for_custom_label = TRUE;
    }
    } else
    {
    $check_for_custom_label = TRUE;
    }
    } else
    {
    $check_for_custom_label = TRUE;
    }

    //+++
    if (empty($string))
    {
    $check_for_custom_label = FALSE;
    }
    //+++

    if ($check_for_custom_label)
    {
    global $WOOF;
    if (isset($WOOF->settings['custom_tax_label'][$taxonomy_info->name]) AND ! empty($WOOF->settings['custom_tax_label'][$taxonomy_info->name]))
    {
    $string = $WOOF->settings['custom_tax_label'][$taxonomy_info->name];
    }
    }

    return $string;
    }

    https://wordpress.org/plugins/woocommerce-products-filter/

Viewing 1 replies (of 1 total)
  • Plugin Author RealMag777

    (@realmag777)

    public static function wpml_translate($taxonomy_info, $string = '')
        {
            if (empty($string))
            {
                $string = $taxonomy_info->label;
            }
            //***
            $check_for_custom_label = false;
            if (class_exists('SitePress'))
            {
                $lang = ICL_LANGUAGE_CODE;
                $woof_settings = get_option('woof_settings');
                if (isset($woof_settings['wpml_tax_labels']) AND ! empty($woof_settings['wpml_tax_labels']))
                {
                    $translations = $woof_settings['wpml_tax_labels'];
                    //$translations = unserialize($translations);
                    /*
                      $translations = array(
                      'es' => array(
                      'Locations' => 'Ubicaciones',
                      'Size' => 'Tamaño'
                      ),
                      'de' => array(
                      'Locations' => 'Lage',
                      'Size' => 'Größe'
                      ),
                      );
                     */
    
                    if (isset($translations[$lang]))
                    {
                        if (isset($translations[$lang][$string]))
                        {
                            $string = $translations[$lang][$string];
                        } else
                        {
                            $check_for_custom_label = TRUE;
                        }
                    } else
                    {
                        $check_for_custom_label = TRUE;
                    }
                } else
                {
                    $check_for_custom_label = TRUE;
                }
            } else
            {
                $check_for_custom_label = TRUE;
            }
    
            //+++
            if (empty($string))
            {
                $check_for_custom_label = FALSE;
            }
            //+++
    
            if ($check_for_custom_label)
            {
                global $WOOF;
                if (isset($WOOF->settings['custom_tax_label'][$taxonomy_info->name]) AND ! empty($WOOF->settings['custom_tax_label'][$taxonomy_info->name]))
                {
                    $string = $WOOF->settings['custom_tax_label'][$taxonomy_info->name];
                }
            }
    
            return $string;
        }
Viewing 1 replies (of 1 total)
  • The topic ‘Custom labels bug in 1.1.2’ is closed to new replies.