src/Common/Module_factory.php
public static function attach( $product, $modules ) {

		if ( ! isset( self::$modules_attached[ $product->get_slug() ] ) ) {
			self::$modules_attached[ $product->get_slug() ] = [];
		}

		foreach ( $modules as $module ) {
			$class = 'ThemeisleSDK\\Modules\\' . ucwords( $module, '_' );
			/**
			 * Module object.
			 *
			 * @var Abstract_Module $module_object Module instance.
			 */
			$module_object = new  $class( $product );

			if ( ! $module_object->can_load( $product ) ) {
				continue;
			}
			self::$modules_attached[ $product->get_slug() ][ $module ] = $module_object->load( $product );
		}
	}
public static function attach( $product, $modules ) {

		if ( ! isset( self::$modules_attached[ $product->get_slug() ] ) ) {
			self::$modules_attached[ $product->get_slug() ] = [];
		}

		foreach ( $modules as $module ) {
			$class = 'ThemeisleSDK\\Modules\\' . ucwords( $module, '_' );
			/**
			 * Module object.
			 *
			 * @var Abstract_Module $module_object Module instance.
			 */
			$module_object = new  $class( $product );

			if ( ! $module_object->can_load( $product ) ) {
				continue;
			}
			self::$modules_attached[ $product->get_slug() ][ $module ] = $module_object->load( $product );
		}
	}
public static function attach ( $ product , $ modules ) { if ( ! isset ( self :: $ modules_attached [ $ product -> get_slug ( ) ] ) ) { self :: $ modules_attached [ $ product -> get_slug ( ) ] = [ ] ; } foreach ( $ modules as $ module ) { $ class = 'ThemeisleSDK\\Modules\\' . ucwords ( $ module , '_' ) ; /**
			 * Module object.
			 *
			 * @var Abstract_Module $module_object Module instance.
			 */ $ module_object = new $ class ( $ product ) ; if ( ! $ module_object -> can_load ( $ product ) ) { continue ; } self :: $ modules_attached [ $ product -> get_slug ( ) ] [ $ module ] = $ module_object -> load ( $ product ) ; } }
Load availabe modules for the selected product.

@param Product $product Loaded product.
@param array   $modules List of modules.
Load availabe modules for the selected product .