Created
June 3, 2021 05:50
-
-
Save wbcomdev/b88f0275edb4652249a5eb7b80d2155a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Change upsells product display. | |
| * | |
| */ | |
| function wbcom_change_upsells_product_display( $args ) { | |
| $args['posts_per_page'] = 4; // 4 display 4 products. | |
| $args['columns'] = 2; // display product in 2 columns. | |
| $args['orderby'] = 'rand'; | |
| $args['order'] = 'desc'; | |
| return $args; | |
| } | |
| add_filter( 'woocommerce_upsell_display_args', 'wbcom_change_upsells_product_display', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment