Plugin Directory

Changeset 852684


Ignore:
Timestamp:
02/06/2014 04:18:11 PM (12 years ago)
Author:
AmirHelzer
Message:

WCML 3.2.1

Location:
woocommerce-multilingual/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-multilingual/trunk/inc/terms.class.php

    r851250 r852684  
    2222        add_filter('option_rewrite_rules', array($this, 'rewrite_rules_filter'), 3, 1); // high priority
    2323       
    24         add_filter('term_link', array($this, 'translate_category_base'), 3, 3); // high priority
     24        add_filter('term_link', array($this, 'translate_category_base'), 0, 3); // high priority
    2525        add_filter('term_link', array($this, 'translate_brand_link'), 10, 3);
    2626       
     
    208208       
    209209        // handles product categories, product tags and attributes
    210        
     210               
    211211        $wc_taxonomies = wc_get_attribute_taxonomies();
    212212        foreach($wc_taxonomies as $k => $v){
     
    219219            if($link = wp_cache_get($cache_key, 'terms')){
    220220                $termlink = $link;
    221                
    222221            }else{               
    223222           
     
    230229               
    231230                    $permalinks     = get_option( 'woocommerce_permalinks' );
    232                     $base           = $taxonomy == 'product_tag' ? $permalinks['tag_base'] : ($taxonomy == 'category_tag' ? $permalinks['category_base'] : $permalinks['attribute_base']);
     231                    $base           = $taxonomy == 'product_tag' ? $permalinks['tag_base'] : ($taxonomy == 'product_cat' ? $permalinks['category_base'] : $permalinks['attribute_base']);
    233232                   
    234233                    if($base === ''){
     
    260259                    }else{
    261260                       
    262                         $string_identifier = $taxonomy == 'product_tag' || $taxonomy == 'product_category' ? $taxonomy : 'attribute';
     261                        $string_identifier = ($taxonomy == 'product_tag' || $taxonomy == 'product_cat') ? $taxonomy : 'attribute';
    263262                       
    264263                        if($term_language->language_code != $strings_language){
     
    269268                                            WHERE s.value='". esc_sql($base)."'
    270269                                                AND s.language = '{$strings_language}'
    271                                                 AND s.name LIKE 'URL {$string_identifier} slug:%'
     270                                                AND s.name LIKE 'Url {$string_identifier} slug:%'
    272271                                                AND t.language = '{$term_language->language_code}'
    273272                            ");
     
    284283                        $no_recursion_flag = true;
    285284                        $termlink = get_term_link($term, $taxonomy);
    286                        
     285                                
    287286                        $wp_rewrite->extra_permastructs[$taxonomy]['struct'] = $buff;
    288287                       
     
    614613        if(isset( $attribute_taxonomies_arr ) && in_array($taxonomy, $attribute_taxonomies_arr)){
    615614
    616                 $wcml_settings = $woocommerce_wpml->get_settings();
    617 
    618                 // get term language
    619                 $term_language = $sitepress->get_element_language_details($tt_id, 'tax_' . $taxonomy);
    620 
    621                 if($term_language->language_code != $sitepress->get_default_language()){
    622                     // get term in the default language
    623                     $term_id = icl_object_id($term_id, $taxonomy, false, $sitepress->get_default_language());
    624 
    625                     //does it belong to any posts (variations)
    626                     $objects = get_objects_in_term($term_id, $taxonomy);
    627 
    628                     if(!isset($wcml_settings['variations_needed'][$taxonomy])){
    629                         $wcml_settings['variations_needed'][$taxonomy] = 0;
    630                     }
    631                     $wcml_settings['variations_needed'][$taxonomy] += count($objects);
    632 
    633                     $woocommerce_wpml->update_settings($wcml_settings);
    634 
    635                 }
    636         }
     615                $wcml_settings = $woocommerce_wpml->get_settings();
     616
     617                // get term language
     618                $term_language = $sitepress->get_element_language_details($tt_id, 'tax_' . $taxonomy);
     619
     620                if($term_language->language_code != $sitepress->get_default_language()){
     621                    // get term in the default language
     622                    $term_id = icl_object_id($term_id, $taxonomy, false, $sitepress->get_default_language());
     623
     624                    //does it belong to any posts (variations)
     625                    $objects = get_objects_in_term($term_id, $taxonomy);
     626
     627                    if(!isset($wcml_settings['variations_needed'][$taxonomy])){
     628                        $wcml_settings['variations_needed'][$taxonomy] = 0;
     629                    }
     630                    $wcml_settings['variations_needed'][$taxonomy] += count($objects);
     631
     632                    $woocommerce_wpml->update_settings($wcml_settings);
     633
     634                }
     635        }
    637636       
    638637    }
  • woocommerce-multilingual/trunk/inc/woocommerce-2.0-backward-compatibility.php

    r851250 r852684  
    5959    }
    6060
    61     add_filter('woocommerce_in_cart_product_title',array($this->products, 'translated_cart_item_name'), 10, 3);
     61    add_filter('woocommerce_in_cart_product_title',array($this->strings, 'translated_cart_item_name'), 10, 3);
    6262     
    6363     
  • woocommerce-multilingual/trunk/readme.txt

    r851250 r852684  
    66Requires at least: 3.0
    77Tested up to: 3.8
    8 Stable tag: 3.2
     8Stable tag: 3.2.1
    99
    1010Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
     
    7777
    7878== Changelog ==
     79
     80= 3.2.1 =
     81* Fixed bug related to product category urls translaiton
     82* Fixed bug related to back-compatibility with WooCommerce 2.0.20
    7983
    8084= 3.2 =
  • woocommerce-multilingual/trunk/woocommerce_wpml.class.php

    r851250 r852684  
    4141        }
    4242               
    43         $this->products   = new WCML_Products;
    44         $this->store      = new WCML_Store_Pages;
    45         $this->emails     = new WCML_Emails;
    46         $this->terms      = new WCML_Terms;
    47         $this->orders     = new WCML_Orders;
     43        $this->products         = new WCML_Products;
     44        $this->store            = new WCML_Store_Pages;
     45        $this->emails           = new WCML_Emails;
     46        $this->terms            = new WCML_Terms;
     47        $this->orders           = new WCML_Orders;
    4848        $this->troubleshooting  = new WCML_Troubleshooting();
    49         $this->compatibility = new WCML_Compatibility();
     49        $this->compatibility    = new WCML_Compatibility();
     50        $this->strings          = new WCML_WC_Strings;
    5051       
    5152        include WCML_PLUGIN_PATH . '/inc/woocommerce-2.0-backward-compatibility.php';           
    5253
    5354        new WCML_Ajax_Setup;
    54         new WCML_WC_Strings;
    5555
    5656        new WCML_Requests;
  • woocommerce-multilingual/trunk/wpml-woocommerce.php

    r851250 r852684  
    66  Author: ICanLocalize
    77  Author URI: http://wpml.org/
    8   Version: 3.2
     8  Version: 3.2.1
    99*/
    1010
    1111if(defined('WCML_VERSION')) return;
    12 define('WCML_VERSION', '3.2');
     12define('WCML_VERSION', '3.2.1');
    1313define('WCML_PLUGIN_PATH', dirname(__FILE__));
    1414define('WCML_PLUGIN_FOLDER', basename(WCML_PLUGIN_PATH));
Note: See TracChangeset for help on using the changeset viewer.