Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // WooCommerce - Change upsell arguments
- // remove upsells using same priority as original add_action()
- remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
- // add custom upsells function in the same place
- add_action( 'woocommerce_after_single_product_summary', 'custom_upsell_display', 15 );
- function custom_upsell_display() {
- // default parameters:
- // woocommerce_upsell_display( $limit = '-1', $columns = 4, $orderby = 'rand', $order = 'desc' )
- // call it with my parameters
- woocommerce_upsell_display( -1, 4, 'price', 'asc' );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement