Automattic\WooCommerce\Blocks\BlockTypes

AbstractProductGrid::get_products_limit()protectedWC 1.0

Works out the item limit based on rows and columns, or returns default.

Method of the class: AbstractProductGrid{}

No Hooks.

Return

Int.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_products_limit();

AbstractProductGrid::get_products_limit() code WC 9.4.2

protected function get_products_limit() {
	if ( isset( $this->attributes['rows'], $this->attributes['columns'] ) && ! empty( $this->attributes['rows'] ) ) {
		$this->attributes['limit'] = intval( $this->attributes['columns'] ) * intval( $this->attributes['rows'] );
	}
	return intval( $this->attributes['limit'] );
}