WPML Plugin Error - by ppeixoto - on WordPress WooCommerce support

This topic has 10 replies, 3 voices, and was last updated 8 years ago ago by Eva Kemp

  • Avatar: ppeixoto
    ppeixoto
    Participant
    November 9, 2016 at 19:16

    I installed the WPML plugin and it gave a problem in my urls. They are now in category 404 error not found. Could you help me?
    I uninstalled the plugin and it did not work. I also resubmitted the woocommerce plugin which had been backup before installation, but the error still continues.

    Print Screen: http://prntscr.com/d56xw2

    thanks

    9 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    November 9, 2016 at 20:43

    Hello,

    Try to resave permalinks settings in wp-admin panel > Settings > Permalinks and clear browser cache.

    Regards,
    Eva Kemp.

    Avatar: ppeixoto
    ppeixoto
    Participant
    November 11, 2016 at 02:03

    Hello Eva,

    This did not work, but as I put it in my other forum thread, the code you gave me to functions.php in child theme worked to return the categories with the link in Portuguese, but did not want to go back to the mobile version.
    Do I need to enter any more code?

    Thank you very much

    Avatar: Eva
    Eva Kemp
    Support staff
    November 11, 2016 at 10:53

    Hello,

    Sorry, but your last reply is unclear. What do you mean saying “but did not want to go back to the mobile version”? Please clarify with more details.

    Regards,
    Eva Kemp.

    Avatar: ppeixoto
    ppeixoto
    Participant
    November 11, 2016 at 11:46

    Sorry Eva, I guess I was not very clear at all.
    I’ll try to explain it better here.
    I had a other problem with the links in my categories in the frontend, they were in English. After I inserted the code that you passed me to put in functions.php in the child theme, the links returned to Portuguese. The code is as follows: The code is as follows:

    Function et_get_main_menu ($ menu_id = ‘main-menu’) {
        $ Custom_menu_slug = ‘custom_nav’;
        $ Cache_slug = ‘et_get_’. $ Menu_id;
        If ($ menu_id == ‘main-menu-right’) $ custom_menu_slug = ‘custom_nav_right’;
        $ Custom_menu = etheme_get_custom_field ($ custom_menu_slug);
        $ One_page_menu = ”;
        If (etheme_get_custom_field ( ‘one_page’)) $ one_page_menu = ‘one-page-menu’;
        If (! Empty ($ custom_menu) && $ custom_menu! = ”) {
            $ Output = false;
            // $ output = wp_cache_get ($ custom_menu, $ cache_slug);
            If (! $ Output) {
                Ob_start ();
                
                Wp_nav_menu (array (
                    ‘Menu’ => $ custom_menu,
                    ‘Before’ => ”,
                    ‘Container_class’ => ‘menu-main-container’ $ one_page_menu,
                    ‘After’ => ”,
                    ‘Link_before’ => ”,
                    ‘Link_after’ => ”,
                    ‘Depth’ => 4,
                    ‘Fallback_cb’ => false,
                    ‘Walker’ => new Et_Navigation
                ));
                
                $ Output = ob_get_contents ();
                Ob_end_clean ();
                
                Wp_cache_add ($ custom_menu, $ output, $ cache_slug);
            }
            
            Echo $ output;
            return;
        }
        If (has_nav_menu ($ menu_id)) {
            $ Output = false;
            // $ output = wp_cache_get ($ menu_id, $ cache_slug);
            If (! $ Output) {
                Ob_start ();
                
                Wp_nav_menu (array (
                    ‘Theme_location’ => $ menu_id,
                    ‘Before’ => ”,
                    ‘Container_class’ => ‘menu-main-container’,
                    ‘After’ => ”,
                    ‘Link_before’ => ”,
                    ‘Link_after’ => ”,
                    ‘Depth’ => 4,
                    ‘Fallback_cb’ => false,
                    ‘Walker’ => new Et_Navigation
                ));
                
                $ Output = ob_get_contents ();
                Ob_end_clean ();
                
                Wp_cache_add ($ menu_id, $ output, $ cache_slug);
            }
            
            Echo $ output;
        } Else {
            ?>
                Home
                <H4 class = “a-center”> Set your main menu in Appearance> Menus </ em> </ h4>
            <? Php
        }
    }

    This code solved the problem of the English links, leaving them in Portuguese again. But in the mobile version of my site, the links continue in English and when clicked, show the 404 error page. See in print screen:

    Mobile version: http://prntscr.com/d5vxne

    Desktop version: http://prntscr.com/d5vy39

    Is there any code that I can add to this to appear the links in Portuguese also in the mobile?

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    November 11, 2016 at 13:40

    Hello,

    Try to use this code instead of the current one:

    function et_get_main_menu($menu_id = 'main-menu') {
            $custom_menu_slug = 'custom_nav';
            $cache_slug = 'et_get_' . $menu_id;
            if($menu_id == 'main-menu-right') $custom_menu_slug = 'custom_nav_right';
    		$custom_menu = etheme_get_custom_field( $custom_menu_slug );
            $one_page_menu = '';
            if(etheme_get_custom_field('one_page')) $one_page_menu = ' one-page-menu';
            if(!empty($custom_menu) && $custom_menu != '') {
                $output = false;
                if ( !$output ) {
                    ob_start(); 
                    
                    wp_nav_menu(array(
                        'menu' => $custom_menu,
                        'before' => '',
                        'container_class' => 'menu-main-container'.$one_page_menu,
                        'after' => '',
                        'link_before' => '',
                        'link_after' => '',
                        'depth' => 4,
                        'fallback_cb' => false,
                        'walker' => new Et_Navigation
                    ));
                    
                    $output = ob_get_contents();
                    ob_end_clean();
                    
                }
                
                echo $output;
                return;
            }
    		if ( has_nav_menu( $menu_id ) ) {
    	    	$output = false;
    		    if ( !$output ) {
    			    ob_start(); 
    			    
    		    	wp_nav_menu(array(
    					'theme_location' => $menu_id,
    					'before' => '',
    					'container_class' => 'menu-main-container',
    					'after' => '',
    					'link_before' => '',
    					'link_after' => '',
    					'depth' => 4,
    					'fallback_cb' => false,
    					'walker' => new Et_Navigation
    				));
    				
    				$output = ob_get_contents();
    				ob_end_clean();
    				
    		    }
    		    
    	        echo $output;
    		} else {
    			?>
    				<br>
    				<h4 class="a-center">Set your main menu in <em>Appearance > Menus</em></h4>
    			<?php
    		}
    	}
    
    	function et_get_mobile_menu($menu_id = 'mobile-menu') {
    
            $custom_menu = etheme_get_custom_field('custom_nav_mobile');
    
            $one_page_menu = '';
    
            if(etheme_get_custom_field('one_page')) $one_page_menu = ' one-page-menu';
            
            if(!empty($custom_menu) && $custom_menu != '') {
                $output = false;
                if ( !$output ) {
                    ob_start(); 
                    
                    wp_nav_menu(array(
                        'menu' => $custom_menu,
                        'before' => '',
                        'container_class' => 'menu-mobile-container'.$one_page_menu,
                        'after' => '',
                        'link_before' => '',
                        'link_after' => '',
                        'depth' => 4,
                        'fallback_cb' => false,
                        'walker' => new Et_Navigation_Mobile
                    ));
                    
                    $output = ob_get_contents();
                    ob_end_clean();
                    
                }
                
                echo $output;
                return;
            }
    
    		if ( has_nav_menu( $menu_id ) ) {
    	    	$output = false;
                
    		    if ( !$output ) {
    			    ob_start(); 
    			    
    				wp_nav_menu(array(
                        'container_class' => $one_page_menu,
    					'theme_location' => 'mobile-menu',
                        'walker' => new Et_Navigation_Mobile
    				)); 
    				
    				$output = ob_get_contents();
    				ob_end_clean();
    				
    		    }
    		    
    	        echo $output;
    		} else {
    			?>
    				<br>
    				<h4 class="a-center">Set your main menu in <em>Appearance > Menus</em></h4>
    			<?php
    		}
    	}

    Best regards,
    Jack Richardson.

    Avatar: ppeixoto
    ppeixoto
    Participant
    November 11, 2016 at 14:22

    Thank you so much Jack! Now it worked!

    I wanted to ask you two questions.

    This error occurred after I installed WPML. I’m afraid to re-enable this plugin and the error will come back. Do you think this is a problem that will happen every time I install this plugin?
    I really wanted to use the WPML plugin as it translates the urls, but if it’s to get buggy, I’d rather not use it and try some other alternative.

    In addition to this error, now the messages of the orders that are sent to customers are going with the title in English. How can I do to appear again translated?

    thanks

    Avatar: Eva
    Eva Kemp
    Support staff
    November 11, 2016 at 15:27

    Hello,

    Don’t worry, you can enable WPML plugin again. That code was modified so mobile menu cache is cleared too.

    Regards,
    Eva Kemp.

    Avatar: ppeixoto
    ppeixoto
    Participant
    November 15, 2016 at 13:46

    Thanks Eva!!!

    Avatar: Eva
    Eva Kemp
    Support staff
    November 15, 2016 at 14:00

    Hello,

    You’re welcome.

    Regards,
    Eva Kemp.

  • Viewing 10 results - 1 through 10 (of 10 total)

The issue related to '‘WPML Plugin Error’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.