This commit is contained in:
Mike Jolley 2011-12-11 01:10:24 +00:00
parent d4452dcb18
commit 58572bf97e
2 changed files with 39 additions and 34 deletions

View File

@ -0,0 +1,18 @@
<?php
/**
* Sorting
*/
?>
<form class="woocommerce_ordering" method="post">
<select name="catalog_orderby" class="orderby">
<?php
$catalog_orderby = apply_filters('woocommerce_catalog_orderby', array(
'title' => __('Alphabetically', 'woothemes'),
'date' => __('Most Recent', 'woothemes'),
'price' => __('Price', 'woothemes')
));
foreach ($catalog_orderby as $id => $name) echo '<option value="'.$id.'" '.selected( $_SESSION['orderby'], $id, false ).'>'.$name.'</option>';
?>
</select>
</form>

View File

@ -52,6 +52,8 @@ if (!function_exists('woocommerce_get_sidebar')) {
}
}
/** Loop ******************************************************************/
/**
* Products Loop
**/
@ -111,6 +113,25 @@ if (!function_exists('woocommerce_check_product_visibility')) {
}
}
/**
* Pagination
**/
if (!function_exists('woocommerce_pagination')) {
function woocommerce_pagination() {
woocommerce_get_template('loop/pagination.php', false);
}
}
/**
* Sorting
**/
if (!function_exists('woocommerce_catalog_ordering')) {
function woocommerce_catalog_ordering() {
if (!isset($_SESSION['orderby'])) $_SESSION['orderby'] = apply_filters('woocommerce_default_catalog_orderby', 'title');
woocommerce_get_template('loop/sorting.php', false);
}
}
/** Single Product ********************************************************/
/**
@ -238,41 +259,7 @@ if (!function_exists('woocommerce_quantity_input')) {
}
}
/** Loop ******************************************************************/
/**
* Pagination
**/
if (!function_exists('woocommerce_pagination')) {
function woocommerce_pagination() {
woocommerce_get_template('loop/pagination.php', false);
}
}
/**
* Sorting
**/
if (!function_exists('woocommerce_catalog_ordering')) {
function woocommerce_catalog_ordering() {
if (!isset($_SESSION['orderby'])) $_SESSION['orderby'] = apply_filters('woocommerce_default_catalog_orderby', 'title');
?>
<form class="woocommerce_ordering" method="post">
<select name="catalog_orderby" class="orderby">
<?php
$catalog_orderby = apply_filters('woocommerce_catalog_orderby', array(
'title' => __('Alphabetically', 'woothemes'),
'date' => __('Most Recent', 'woothemes'),
'price' => __('Price', 'woothemes')
));
foreach ($catalog_orderby as $id => $name) echo '<option value="'.$id.'" '.selected( $_SESSION['orderby'], $id, false ).'>'.$name.'</option>';
?>
</select>
</form>
<?php
}
}
/**
* Product page tabs