diff --git a/README.md b/README.md index 327034b..f3e16fd 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,9 @@ Addthis share buttons: Customize the admin scheme: https://gist.github.com/nicomollet/7fd3e2e5334ef352abe0 +Shortcodes +----------- +[woocommerce_cart_link] Display a link to the Woocommerce cart Major components ----------- diff --git a/inc/plugins/woocommerce.php b/inc/plugins/woocommerce.php index 4d4779e..578a607 100644 --- a/inc/plugins/woocommerce.php +++ b/inc/plugins/woocommerce.php @@ -463,3 +463,16 @@ function woocommerce_cart_count_shortcode( $atts ) { } add_shortcode( 'woocommerce_cart_link', 'woocommerce_cart_count_shortcode' ); +/** + * Woocommerce: Related products number + * + * @param $args + * + * @return mixed + */ +function stormbringer_related_products_args( $args ) { + $args['posts_per_page'] = 3; // 3 related products + $args['columns'] = 3; // arranged in 3 columns + return $args; +} +add_filter( 'woocommerce_output_related_products_args', 'stormbringer_related_products_args' );