Skip to content

related-products

Auto Added by WPeMatico

How to get related product collection in block

I use this way to get related product collection /** * Prepare and return product collection * * @return MagentoCatalogModelResourceModelProductCollection */ public function createCollection() { /** @var $collection MagentoCatalogModelResourceModelProductCollection */ $myBlock = MagentoFrameworkAppObjectManager::getInstance()->get(‘AntonStudioStockUpdateBlockRelatedProducts’); $currentProduct = $myBlock->getCurrentProduct(); $relatedProducts = $currentProduct->getRelatedProductCollection(); /**… Read More »How to get related product collection in block

Show Related products in the popup modal

I am using this code to show the modal when product add to cart /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ ‘jquery’, ‘mage/translate’, ‘underscore’, ‘Magento_Catalog/js/product/view/product-ids-resolver’, ‘Magento_Catalog/js/product/view/product-info-resolver’, ‘jquery-ui-modules/widget’ ], function ($,… Read More »Show Related products in the popup modal

Magento 2 + Add inlineEdit feature in related products grid on admin product edit page

I want to add an inlineEdit feature same as admin customer grid, in related products grid on admin product edit page. For that I extended MagentoCatalogUiDataProviderProductFormModifierRelated class and overridden getGrid() function in following way: <?php class DisplayProductLinksAdmin extends MagentoCatalogUiDataProviderProductFormModifierRelated {… Read More »Magento 2 + Add inlineEdit feature in related products grid on admin product edit page