woocommerce_upsells_total

woocommerce_upsells_total

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_upsells_total') is found 1 times:

  • /includes/wc-template-functions.php line 2128
    		 *
    		 * @param int $limit number of upsell products.
    		 * @since 3.0.0
    		 */
    		$limit = intval( apply_filters( 'woocommerce_upsells_total', $args['posts_per_page'] ?? $limit ) );
    
    		// Get visible upsells then sort them at random, then limit result set.
    		$upsells = wc_products_array_orderby( array_filter( array_map( 'wc_get_product', $product->get_upsell_ids() ), 'wc_products_array_filter_visible' ), $orderby, $order );
    		$upsells = $limit > 0 ? array_slice( $upsells, 0, $limit ) : $upsells;
    
    		wc_get_template(