public function actionAddAdditional(int $productId, int $languageId)
    {
        $additionalProductsCategories = Category::find()->with('products')
            ->where(['additional_products' => true])->all();

        $productAdditionalProducts = ProductAdditionalProduct::find()->where(['product_id' => $productId])->all();
        return $this->render('../product/save', [
            'viewName' => '../additional-product/add-additional',
            'selectedLanguage' => Language::findOne($languageId),
            'product' => Product::findOne($productId),
            'languages' => Language::find()->all(),

            'params' => [
                'additionalProductsCategories' => $additionalProductsCategories,
                'productAdditionalProducts' => $productAdditionalProducts,
                'productId' => $productId
            ]
        ]);
    }
public function actionAddAdditional(int $productId, int $languageId)
    {
        $additionalProductsCategories = Category::find()->with('products')
            ->where(['additional_products' => true])->all();

        $productAdditionalProducts = ProductAdditionalProduct::find()->where(['product_id' => $productId])->all();
        return $this->render('../product/save', [
            'viewName' => '../additional-product/add-additional',
            'selectedLanguage' => Language::findOne($languageId),
            'product' => Product::findOne($productId),
            'languages' => Language::find()->all(),

            'params' => [
                'additionalProductsCategories' => $additionalProductsCategories,
                'productAdditionalProducts' => $productAdditionalProducts,
                'productId' => $productId
            ]
        ]);
    }
public function actionAddAdditional ( int $ productId , int $ languageId ) { $ additionalProductsCategories = Category :: find ( ) -> with ( 'products' ) -> where ( [ 'additional_products' => true ] ) -> all ( ) ; $ productAdditionalProducts = ProductAdditionalProduct :: find ( ) -> where ( [ 'product_id' => $ productId ] ) -> all ( ) ; return $ this -> render ( '../product/save' , [ 'viewName' => '../additional-product/add-additional' , 'selectedLanguage' => Language :: findOne ( $ languageId ) , 'product' => Product :: findOne ( $ productId ) , 'languages' => Language :: find ( ) -> all ( ) , 'params' => [ 'additionalProductsCategories' => $ additionalProductsCategories , 'productAdditionalProducts' => $ productAdditionalProducts , 'productId' => $ productId ] ] ) ; }
Adds additional products

@param int $productId
@param int $languageId

@return mixed
Adds additional products