forked from qreuz/woocommerce-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomize-woocommerce-cross-sells-output.php
35 lines (31 loc) · 1.76 KB
/
customize-woocommerce-cross-sells-output.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
*
* ██████╗ ██████╗ ███████╗██╗ ██╗███████╗
*██╔═══██╗██╔══██╗██╔════╝██║ ██║╚══███╔╝
*██║ ██║██████╔╝█████╗ ██║ ██║ ███╔╝
*██║▄▄ ██║██╔══██╗██╔══╝ ██║ ██║ ███╔╝
*╚██████╔╝██║ ██║███████╗╚██████╔╝███████╗
* ╚══▀▀═╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚══════╝
*
* QREUZ SNIPPET FOR WOOCOMMERCE
* This file is part of a collection of snippets to be used on your WooCommerce store.
* !! Do not put this file in your Wordpress installation !!
*
* Copy/paste the code below and add it to the functions.php of your child theme.
* Don't know what a child theme is? Read this post: https://qreuz.com/how-to-use-a-child-theme-on-wordpress-and-woocommerce/
*
* COPY AND PASTE EVERYTHING BELOW THIS LINE TO YOUR FUNCTIONS.PHP **/
/**
* QREUZ SNIPPET FOR WOOCOMMERCE
* @TITLE: Customize Woocommerce Cross-Sells Output
* @DESCRIPTION: modify output of cross-sell products on WooCommerce cart page
* @DOCUMENTATION AND DISCUSSION: https://qreuz.com/snippets/customize-woocommerce-cross-sells-output/
* @AUTHOR: Qreuz GmbH
* @VERSION: 1.0
*/
add_filter( 'woocommerce_cross_sells_total', 'qreuz_modify_cross_sells_count', 20 );
function qreuz_modify_cross_sells_count( $columns ) {
$cross_sells = 4;
return $cross_sells; // define how many cross sell products shall max. be shown on the cart page
}