WC_Abstract_Legacy_Product::get_related()publicWC 1.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. Use wc_get_related_products instead.

Get and return related products.

Method of the class: WC_Abstract_Legacy_Product{}

No Hooks.

Return

Array.

Usage

$WC_Abstract_Legacy_Product = new WC_Abstract_Legacy_Product();
$WC_Abstract_Legacy_Product->get_related( $limit );
$limit(int)
-
Default: 5

Changelog

Deprecated since 3.0.0 Use wc_get_related_products instead.

WC_Abstract_Legacy_Product::get_related() code WC 7.7.0

public function get_related( $limit = 5 ) {
	wc_deprecated_function( 'WC_Product::get_related', '3.0', 'wc_get_related_products' );
	return wc_get_related_products( $this->get_id(), $limit );
}