• Resolved milleniumdemo

    (@milleniumdemo)


    Hello Mr.Stephan
    I have created a page in my localhost wordpress site which uses a popular products and products widget.
    When I switch language, this page still displays the default language instead of the selected language.
    Please help.

    The page I need help with: https://snipboard.io/ejw2Rs.jpg

Viewing 7 replies - 16 through 22 (of 22 total)
  • Thread Starter milleniumdemo

    (@milleniumdemo)

    ok

    Plugin Author sbouey

    (@sbouey)

    Hi, it’s quite easy to fix , i will add it in the next release (free version)

    in the file src/Falang/Filter/Site/WooCommerce.php

    add this in the constructor

            //translate product name for the widget  (For products title is the product name )
            add_filter('woocommerce_product_get_name', array($this, 'translate_wc_product_title'), 10, 2);

    Stéphane

    Plugin Author sbouey

    (@sbouey)

    Did you see my message, i’m wating your feedback before putting this thread as resolved.

    Thread Starter milleniumdemo

    (@milleniumdemo)

    Hello Mr.Stephan
    Sorry for late reply.
    I changed the woocommerce.php as you wrote.
    and it works perfect. Thank you!!!
    Your language plugin is the best.

    • This reply was modified 2 years, 2 months ago by milleniumdemo.
    Plugin Author sbouey

    (@sbouey)

    Hi,

    What i can see you didn’t change it in the constructor of the file

    the file src/Falang/Filter/Site/WooCommerce.php

    it’s in the beginning the full constructore should look like this

    	public function __construct( ) {
    		//woocommerce attribute label support
    		add_filter( 'woocommerce_attribute_label', array( $this,'translate_wc_attribute_label'), 10, 3 );
    		//woocommerce the_excerpt short_description translation => wc don't use get_the_excerpt
    		add_filter('woocommerce_short_description', array($this, 'translate_wc_post_excerpt'), 9);
    		//translate product variation description
    		add_filter( 'woocommerce_available_variation', array($this,'translate_variation_descriptions'),10,3) ;
            //transate cart title
            add_filter( 'woocommerce_cart_item_name', array($this,'translate_cart_item_name'),10,3) ;
    
            //transate cart/checkout page permalink
            add_filter('woocommerce_get_cart_page_permalink',array($this,'translate_woocommerce_get_page_page_permalink'));
            add_filter('woocommerce_get_checkout_page_permalink',array($this,'translate_woocommerce_get_page_page_permalink'));
    
            //translate cart title in thank-you page
            add_filter('woocommerce_order_item_name', array($this,'translate_woocommerce_order_item_name'),10,3);
    
            //translate product title and permalink during ajax call (aws-search)
            if ( isset( $_REQUEST['wc-ajax'] ) ) {
                add_filter('woocommerce_product_title', array($this, 'translate_woocommerce_product_title'), 10, 2);
            }
            //translate product title for $product->get_title()
            add_filter('woocommerce_product_title', array($this, 'translate_wc_product_title'), 10, 2);
    
            //translate product name for the widget  (For products title is the product name )
            add_filter('woocommerce_product_get_name', array($this, 'translate_wc_product_title'), 10, 2);
    
        }
    

    i don’t know if i can attache a php file here

    Thread Starter milleniumdemo

    (@milleniumdemo)

    Hello Mr.Stephan
    Sorry for late reply.
    I changed the woocommerce.php as you wrote.
    and it works perfect. Thank you!!!!
    Your language plugin is the best.

    Plugin Author sbouey

    (@sbouey)

    Hi, Falang is not the best but in some case it’s must easier to use.

    Falang is not perfect if the site in differents languages is not the same

    Have a nice day.

Viewing 7 replies - 16 through 22 (of 22 total)

The topic ‘Issue with popular products and products widget’ is closed to new replies.