Issue when GET method is set
-
Hello.
I have noticed that there is small issue when the plugin is set to use ‘get’ method. It ignores selected filters. In order to sort this out I have made a small fix and added it to my theme functions. Maybe this will be helpful for someone. This is fast fix, possibly can be optimized.
add_action('wppp_before_dropdown', 'woocommerce_products_per_page_dropdown_get_fix', 10); function woocommerce_products_per_page_dropdown_get_fix(){ $method = in_array( get_option( 'wppp_method', 'post' ), array( 'post', 'get' ) ) ? get_option( 'wppp_method', 'post' ) : 'post'; if($method === 'get'){ $filters = $_GET; if(isset($filters) && !empty($filters)){ foreach($filters as $key => $value){ if(substr($key, 0, 6) === 'filter') { echo '<input type="hidden" name="'.$key.'" value="'.$value.'">'; } } } } }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Issue when GET method is set’ is closed to new replies.