{"id":18950423,"date":"2026-06-28T19:30:44","date_gmt":"2026-06-28T19:30:44","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=18950423"},"modified":"2026-06-28T20:30:43","modified_gmt":"2026-06-28T20:30:43","slug":"shippingenabled-array-expected","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/shippingenabled-array-expected\/","title":{"rendered":"&#8220;shippingEnabled&#8221; array expected"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi there<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve got this error<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;28-Jun-2026 19:08:18 UTC] PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in \/home\/mysite\/public_html\/wp-content\/plugins\/side-cart-woocommerce\/includes\/class-xoo-wsc-frontend.php:150<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is the line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'shippingEnabled' =&gt; in_array( 'shipping' , $glSettings&#091;'scf-show'] ),<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and this error can be prevent by doing like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'shippingEnabled' =&gt; in_array(<br \/>'shipping',<br \/>is_array( $glSettings&#091;'scf-show'] ) ? $glSettings&#091;'scf-show'] : array( $glSettings&#091;'scf-show'] )<br \/>),<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'shippingEnabled' =&gt; is_array( $glSettings&#091;'scf-show'] ) &amp;&amp; in_array( 'shipping', $glSettings&#091;'scf-show'] ),<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Anyway, I&#8217;ve entered in Side Cart &gt; Settings and just Saved without making any change and now the Shop runs.<br \/>It seems that somehow some value vas null; maybe never stored or maybe lost.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fix is still recommended in case data where null. It&#8217; shouldn&#8217;t but it happened.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks<\/p>\n","protected":false},"template":"","class_list":["post-18950423","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18950423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18950423\/revisions"}],"predecessor-version":[{"id":18950446,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18950423\/revisions\/18950446"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18950423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}