Home Forums Theme Support Dokan Jupiter Theme compatibility

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  Mahi 4 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29842

    Roberto
    Member
    Post count: 59

    Hello

    I am getting this error with Jupiter Theme, which has full woocommerce compatibility.

    Trying to get property of non-object in C:\inetpub\wwwroot\fifth\wp-content\themes\jupiter\framework\functions\general-functions.php on line 578

    This is an error that i get on the Seller page (frontend) when the seller doesn't have any product.

    Instead, if he has at least one product, in the header section the name of the first product is showing.

    The error is pointing to

    if (!function_exists('global_get_post_id')) {
         function global_get_post_id()
         {
              if(function_exists('is_woocommerce') && is_woocommerce() && is_shop()) {
    
                  return wc_get_page_id( 'shop' );
    
              } else if(is_singular() || is_home()) {
    
                global $post;
    
    //line 578 -> return $post->ID;
    
              }else {
    
                return false;
              }
         }
    }

    I tried to change line 578 to “return false” and it works.
    So I think I am supposed to change some of the conditions in the second IF in order to exclude the possibility, in the store page, to have the post ID.

    Can you help me with this?

    Thanks

    #29855

    Roberto
    Member
    Post count: 59

    Here is the fixed code. I put it in my function.php
    Hopefully it helps

    if (!function_exists('global_get_post_id')) {
         function global_get_post_id()
         {
              if(function_exists('is_woocommerce') && is_woocommerce() && is_shop()) {
                  return wc_get_page_id( 'shop' );
    &&          } else if(is_singular() || is_home()) {
    //added ->	if(dokan_is_store_page()){
    		     return false;
    	}
                global $post;
    //line 578 -> return $post->ID;
              }else {
                return false;
              }
         }
    }
    #29892

    Mahi
    Member
    Post count: 135

    Awesome Roberto. Thank you for your contribution.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Jupiter Theme compatibility’ is closed to new replies.