LLMS_Product::get_access_plan_limit()

Retrieve the max number of access plans that can be created for this product.


Return Return

(int)


Top ↑

Source Source

File: includes/models/model.llms.product.php

	public function get_access_plan_limit() {

		/**
		 * Determine the number of access plans allowed on the product.
		 *
		 * This is a (somewhat) arbitrary limit chosen mostly based on the following 2 factors:
		 *
		 * 1) It looks visually unappealing to have a pricing table with 7+ items on it.
		 * 2) Having 7+ pricing plans creates a lot of decision fatigue for users.
		 *
		 * If you disagree with either of these two factors you can quite easily change the
		 * limit using this filter.
		 *
		 * Keep in mind that increasing the limit will likely require you to add CSS to accommodate
		 * 7+ plans on the automatically generated pricing tables.
		 *
		 * Also, since plans are limited by the core to 6, we have no pagination built in for any queries that
		 * lookup or list access plans. This means that if you greatly increase the limit (say 200) you
		 * could very quickly run into issues where the default queries "do not scale" well. In which
		 * case you should first consider if you really need 200 plans and then start investigating other
		 * filters to add pagination (and probably caching) to these (now slow) queries.
		 *
		 * @since 3.0.0
		 *
		 * @param int          $limit Number of plans.
		 * @param LLMS_Proudct $this  Product object.
		 */
		return apply_filters( 'llms_get_product_access_plan_limit', 6, $this );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.