Home Forums WoodMart support forum explode() expects parameter 2 to be string, object given in Woodmart Layered Nav

explode() expects parameter 2 to be string, object given in Woodmart Layered Nav

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #168781

    perelview
    Participant

    Hello,
    We have identified an issue with Woodmart Layered Nav producing an E_Warning in PHP:

    PHP message: PHP Warning: explode() expects parameter 2 to be string, object given in /home/customer/domains/domain.ext/public_html/wp-includes/functions.php on line 1097″ while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: e-shetach.co.il, request: “GET /sale/?filter_color=%D7%9C%D7%91%D7%9F&filter_brand=%d7%aa%d7%9e%d7%94,dakar HTTP/1.1”, upstream: “fastcgi://unix:/usr/local/php72/sockets/eshetach.sock:”, host: “www.domain.ext”
    2020/01/19 14:41:13 [error] 21331#0: *135263 FastCGI sent in stderr: “rning: stripos() expects parameter 1 to be string, object given in /home/customer/domains/domain.ext/public_html/wp-includes/functions.php on line 1086
    PHP message: PHP Warning: stripos() expects parameter 1 to be string, object given in /home/customer/domains/domain.ext/public_html/wp-includes/functions.php on line 1089
    PHP message: PHP Warning: strpos() expects parameter 1 to be string, object given in /home/customer/domains/domain.ext/public_html/wp-includes/functions.php on line 1096
    PHP message: PHP Warning: explode() expects parameter 2 to be string, object given in /home/customer/domains/domain.ext/public_html/wp-includes/functions.php on line 1097
    PHP message: PHP Warning: strstr() expects parameter 1 to be string, object given in /home/customer/domains/domain.ext/public_html/wp-includes/functions.php on line 1079
    PHP message: PHP Warning: stripos() expects parameter 1 to be string, object given in /home/customer/domains/domain.ext/public_html/wp-includes/functions.php on line 1086
    PHP message: PHP Warning: stripos() expects parameter 1 to be string, object given in /home/customer/domains/domain.ext/public_html/wp-includes/functions.php on line 1089
    PHP message: PHP Warning: strpos() expects parameter 1 to be string, object given in /home/customer/domains/domain.ext/public_html/wp-includes/functions.php on line 1096

    This seems to be happening only in a /sale page which is a custom page. The page has products and Woodmart Layered Nav widget in sidebar – it is the same sidebar that is used in the /shop

    * The problem only occurs in the /sale (custom page)
    ** A filter must be selected (any filter will do) to reproduce the error.
    *** We noticed all the counters are showing shop-scope numbers and not limited to the items on the page.

    We have created a dedicated stage environment for this case, disabled all plugins and problem persists.

    Without getting too technical the question is –
    Is the “Woodmart Layered Nav” supposed to work in a custom page (not /shop) showing products?
    How can we make a custom page (like products on sale) + woodmart ajax filters?

    Thank you!

    #168862

    Artem Temos
    Keymaster

    Hello,

    Layered nav widget, as well as default WooCommerce filters, can be used on the shop page only. You can’t add them to your custom pages. To fix PHP warnings, please, add the following code to the file woodmart/inc/widgets/class-widget-layered-nav.php as it shown on the screenshot http://prntscr.com/qq3glk

    if ( ! is_shop() && ! is_product_taxonomy() ) {
       return;
    }

    Kind Regards

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