related products / upsets. closes #7873

This commit is contained in:
James Koster 2015-05-19 13:06:57 -04:00
parent c01bc43369
commit 6389e5defa
4 changed files with 7 additions and 27 deletions

File diff suppressed because one or more lines are too long

View File

@ -115,26 +115,6 @@
/**
* Product loops
*/
.related,
.upsells.products {
@include clearfix();
clear: both;
ul.products,
ul {
float: none;
li.product {
width: 48%;
img {
width: 100%;
height: auto;
}
}
}
}
ul.products {
clear: both;
@include clearfix();

View File

@ -779,8 +779,8 @@ class WC_Shortcodes {
*/
public static function related_products( $atts ) {
$atts = shortcode_atts( array(
'posts_per_page' => '2',
'columns' => '2',
'posts_per_page' => '4',
'columns' => '4',
'orderby' => 'rand'
), $atts );

View File

@ -1059,9 +1059,9 @@ if ( ! function_exists( 'woocommerce_output_related_products' ) ) {
function woocommerce_output_related_products() {
$args = array(
'posts_per_page' => 2,
'columns' => 2,
'orderby' => 'rand'
'posts_per_page' => 4,
'columns' => 4,
'orderby' => 'rand'
);
woocommerce_related_products( apply_filters( 'woocommerce_output_related_products_args', $args ) );
@ -1111,7 +1111,7 @@ if ( ! function_exists( 'woocommerce_upsell_display' ) ) {
* @param int $columns (default: 2)
* @param string $orderby (default: 'rand')
*/
function woocommerce_upsell_display( $posts_per_page = '-1', $columns = 2, $orderby = 'rand' ) {
function woocommerce_upsell_display( $posts_per_page = '-1', $columns = 4, $orderby = 'rand' ) {
wc_get_template( 'single-product/up-sells.php', array(
'posts_per_page' => $posts_per_page,
'orderby' => apply_filters( 'woocommerce_upsells_orderby', $orderby ),