Jupiter Theme compatibility

This topic contains 2 reply and 2 voices, and was last updated by Mahi 10 years ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
November 6, 2014 at 5:24 pm 29842
Mahi 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
November 6, 2014 at 7:22 pm 29855
Roberto Roberto

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;
          }
     }
}
November 7, 2014 at 6:57 am 29892
Mahi Mahi

Awesome Roberto. Thank you for your contribution.

Viewing 2 Posts - 1 through 2 (of 2 total)