WPML
Status
Resolved by author
Related plugin/theme
Avada
Topic tags
Compatibility

Overview of the issue

If you are using Avada theme, you may encounter issues with translating Portfolio posts. Post translations will display a loading icon and you will find a similar error in your debug information:


Call to a member function get_cart_contents_count() on null .../wp-content/themes/Avada/includes/avada-functions.php:662

Workaround

Please, make sure of having a full backup of your site before proceeding.


  • Open …/wp-content/themes/Avada/includes/avada-functions.php file.

  • Change:
    	function fusion_add_woo_cart_to_widget_html() {
    		$items = '';
    
    		if ( class_exists( 'WooCommerce' ) && ! is_admin() ) {

  • For:
    	function fusion_add_woo_cart_to_widget_html() {
    		$items = '';
    
    		if ( class_exists( 'WooCommerce' ) && ! is_admin()  && ! ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {

All known issues →