Support GET for ordering. Closes #269.

This commit is contained in:
Mike Jolley 2012-01-07 17:36:32 +00:00
parent ca8523361b
commit 48d1fac0d4
2 changed files with 3 additions and 3 deletions

View File

@ -3,8 +3,8 @@
* Sorting
*/
?>
<form class="woocommerce_ordering" method="post">
<select name="catalog_orderby" class="orderby">
<form class="woocommerce_ordering" method="<?php if (get_option( 'permalink_structure' )=="") echo 'POST'; else echo 'GET'; ?>">
<select name="orderby" class="orderby">
<?php
$catalog_orderby = apply_filters('woocommerce_catalog_orderby', array(
'title' => __('Alphabetically', 'woocommerce'),

View File

@ -145,7 +145,7 @@ function woocommerce_nav_menu_items( $items, $args ) {
* Update catalog ordering if posted
*/
function woocommerce_update_catalog_ordering() {
if (isset($_POST['catalog_orderby']) && $_POST['catalog_orderby'] != '') $_SESSION['orderby'] = $_POST['catalog_orderby'];
if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] != '') $_SESSION['orderby'] = esc_attr($_REQUEST['orderby']);
}
/**