Home › Forums › WoodMart support forum › WooCommerce plugin error › Reply To: WooCommerce plugin error
December 23, 2018 at 7:59 am
#97886
Artem Temos
Keymaster
Try to add the following PHP code snippet to the child theme functions.php file
function woodmart_get_products_per_page() {
if( ! class_exists('WC_Session_Handler') ) return;
$s = WC()->session; // WC()->session
if ( is_null( $s ) ) return;
if ( isset( $_REQUEST['per_page'] ) && ! empty( $_REQUEST['per_page'] ) ) :
return intval( $_REQUEST['per_page'] );
elseif ( $s->__isset( 'shop_per_page' ) ) :
$val = $s->__get( 'shop_per_page' );
if( ! empty( $val ) )
return intval( $s->__get( 'shop_per_page' ) );
endif;
return intval( woodmart_get_opt('shop_per_page') );
}