Questions tagged [related-products]

Denotes questions about Magentos related products feature.

16
votes
5answers
2k views

Error on product page when you have related products and full page cache is on

I get this error on some products that have related products: Warning: Invalid argument supplied for foreach() in vendor/magento/module-catalog/Block/Product/ProductList/Related.php on line 129 This ...
8
votes
1answer
2k views

CSV Import: How can I import related products in Magento 2?

How can I import related products via csv in Magento 2? In my csv file I have a row with attribute related_skus with example data "11-111,22-222" for a product. But in admin Products->Catalog in this ...
7
votes
3answers
1k views

how to add default products to related products list

I want to add default products of certain ids(example- 1,5,7,3) to be added to the list of related products always with all the products at the end for the product page and need not store in database, ...
6
votes
3answers
2k views

Configurable Options in Related Products - Fatal error: Call to a member function getAttributeCode() on a > non-object

I'm trying to show configurable product options for each related product on a product page, so that the user can select options and add a related product to the basket without navigating to that ...
6
votes
0answers
743 views

Magento 2 Admin- Invalid data provided for linked products

Getting an error " Invalid data provided for linked products " when adding related products to a product from the admin panel and saving Indexer crons, already setup Magento CLI version is : 2.1....
6
votes
2answers
666 views

Magento2 Extending Magento\Catalog\Block\Product\AbstractProduct Class

I wanted to add some extra custom methods to the block classes: Related Upsell Cross-sell Each of these extends the Magento\Catalog\Block\Product\AbstractProduct But using di.xml preference I was ...
5
votes
3answers
12k views

How to show related products in product view page in Magento 2?

How can I show related products on bottom section of the product view page? I want to show 3 related products in bottom part of product view page in Magento 2
5
votes
1answer
5k views

Magento 2 How to add custom product relations?

I am needing to add another related products attribute to associate multiple other products. I have found a solution for Magento 1: http://inchoo.net/magento/how-to-add-custom-product-relations-in-...
5
votes
1answer
286 views

Need to show related products of simple product in configurable product

I need to show related products block on configurable product page (as it is by deflault), but instead of related products of configurable product i need to show related products of simple products ...
4
votes
3answers
3k views

set related/upsell products programatically only works for 1 product

I am trying to update products programatically and I'm having issues with the related/upsell section. It updates only with the last product sku. So if I am trying to link 3 products with a parent ...
3
votes
2answers
670 views

Change $this to different block in related.phtml

I am working in related.phtml in app/design/frontend/[package]/default/template/catalog/product/list/. Here there is a foreach loop: <?php foreach($this->getItems() as $_item): ?> which loops ...
3
votes
2answers
10k views

How to get the thumbnail image with getAttributeRawValue

I have a script to show related products in order confirmation emails but it gets the large, main image and not the thumbnail. In some emails clients this splatters these gigantic images and messes up ...
3
votes
1answer
114 views

Get Configurable Product options, Price And Add to cart Button On Related Product Section

How to get Configurable Products options, price on related products sections. Also, put add to cart button on each product. right now related products show only the price as low as but want to add ...
3
votes
1answer
596 views

Magento related products disappears with item max qty in cart

In Magento we have set "Display Out of Stock Products" => "Yes" On product pages, we have a "Related products" section (related.phml => if($this->getItems()->getSize()):) However when Maximum ...
3
votes
1answer
712 views

Export Related Products in Magento

I am using Magento 1.9.0.1 and i want to export the products along with the related products in the csv.In the magento export sheet i am not getting the related products column. I had googled but not ...
3
votes
0answers
342 views

Getting Configurable Options to Show for Related Products

A the title suggests, I am trying to get configurable product options to show for products in the upsell and related products lists on the product view page. So far, Google has come up empty handed ...
3
votes
0answers
108 views

Configurable Drop-down options in related products (related.phtml) - error Call to a member function getSortedChildren() on a non-object [duplicate]

I am trying to give the related products on each product page, the ability to show the drop-down options of configurable products; so that the user can select options and add to basket without ...
2
votes
1answer
2k views

Magento 2 - Quantity Field on Related Products Listing

I'm trying to add a quantity field to the related products section on my product page. I'm overriding module-catalog/view/frontend/templates/product/list/items.phtml in my theme. So far, here is my '...
2
votes
1answer
732 views

Magento 1.9 not able to save upsell/related/cross sell products

I upgrade my store to last Magento version 1.9.2.4 and I add ssl, When I try save a new product or edit an existing product in Magento everything is saved correctly except upsell/related/cross sell ...
2
votes
1answer
1k views

Related Products are not visible in Product view page

I am facing an issue that related products are not visible in product view page. I have called related products in view page like below, In template/catalog/product/view.phtml, <?php echo $this-&...
2
votes
1answer
1k views

Crosssell Products on Product Page with Magento 2

I have been trying to get crosssell products to show on the product pages. however adding the block does not work as it relies on the product being in the cart. I have tried to overcome this by ...
2
votes
1answer
3k views

Related and upsell products not showing

Hi am currently attempting to code my own view.phtml for my products, but the related products and upsell are not showing, why could this be ? My local.xml: http://pastebin.com/ZEr51avR My view....
2
votes
1answer
89 views

Re-save entire catalog's related products field via SSH php script?

I'm trying to re-save the "related products" field for each item in the catalog via SSH. I've seen other answers do something similar so I've attempted to replicate it with what little understanding I ...
2
votes
1answer
59 views

How to fix the related product issue in admin after migrated to magento 1 to magento 2.3

I am using Magento 2.3.0 I have migrated products from Magento 1 to Magento 2. I can see related products in product detail page in the front end and it is proper and also I can find related products ...
2
votes
1answer
30 views

How can I add an attribute to related products?

I would like to Add the sku to the related products. I am in the template Magento_Catalog/templates/product/list/items.phtml. This is what it looks like now- <?php /** * Copyright © Magento, Inc. ...
2
votes
2answers
1k views

Ultimo - 'Related products' owl Carousel

I am using Ultimo theme. Does anybody know how to change the scrolling direction of the 'related products' slider? The slider is based on the popular Owl Carousel. I would assume the code for this ...
2
votes
1answer
841 views

Magento RWD Theme: How to move related products to a new tab?

I am fairly new to developing in Magento, and currently on a local server developing a custom theme. Now, what I want is to move the related products from it's current default location, to residing in ...
2
votes
0answers
453 views

Magento related products get category

I want to edit my /catalog/product/list/related.phtml file. I want to define all related products based on their main category. So for example that all mices are displayed in their category "Mices" ...
2
votes
2answers
330 views

Related Product

i am New In Magento. I want to add related product tab in my product page after review tab. i am working in RWD 1 column default theme can any one help. I have already add related product in Product ...
2
votes
1answer
725 views

Magento Rule Based Related Products

We are attempting to set up Rule Based Relations, a feature of Magento Enterprise. Specific Magento version is EE 1.13.1.0 So basically you set which products are the related products, and which ...
1
vote
4answers
3k views

Magento 2 : How to display swatches in related products?

I added related products list in product details page. I see there all related products list are display but now i need to display swatches in this list. How can it possible for related products list. ...
1
vote
1answer
382 views

Custom Block generating an error on template: Magento

I have CMS block in magento admin and it included the following code: <div id="featured-products" class="tab">{{block type="featuredproducts/listing" template="featured/featuredproducts/...
1
vote
2answers
112 views

Missing cross-selling and related products option in admin

I notice in several websites about Magento mentioning the "Related Products", "Up-Sells" and "Cross-Sells" options in the admin backend under the "Manage Products" section. However, when I log into ...
1
vote
1answer
55 views

Magento 2.3: Error Assigning Related Products

Trying to add some related / cross-sell and upsells to products in the admin but receiving the following error after saving the product: The linked products data is invalid. Verify the data and try ...
1
vote
2answers
1k views

How to select Related product random collection Magento 2.1.2 [duplicate]

How to get a random collection of related products, using the below code, protected function _prepareData() { $product = $this->_coreRegistry->registry('product'); /* @var $product \...
1
vote
1answer
2k views

Where is related product place in Magento2?

In product view xml , i found that <referenceContainer name="content.aside"> <block class="Magento\Catalog\Block\Product\ProductList\Related" name="catalog.product.related" ...
1
vote
2answers
2k views

product collection still show not in stock products

Hi I'm going crazy with this function. Although I added In stock Filter, it still return Not in Stock products. Where I'm wrong ? public function getRelatedProducts($limit = false) { $product ...
1
vote
1answer
987 views

Show related product in cart page Magento 2

I want to show related product in cart page, each product at least will have 3 or more related product, is there a way to do this?
1
vote
1answer
107 views

Get related products per attributeset ID

My products have a bunch of related products, some of which are in a separate attribute set. I want to split these out in two different views on view.phtml. I figured to need addAttributeToFilter and ...
1
vote
2answers
789 views

How to get load related products of simple product using ajax

I have a configurable product and on selection of its simple product I need its respective related products loaded via ajax. Any help will be highly appreciated. This is how I call my ajax: <...
1
vote
1answer
63 views

i want product page sidebar as related products instant of upsell products

here is my catalog.xml block: <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml" /> here is my view.xml &...
1
vote
1answer
55 views

Related products select button missing and Size attribute in related products

On this page I have added Related products. where is the select button, to select a product? those shirts are in different sizes. How can I display the Size attribute here? So users are able to ...
1
vote
1answer
362 views

Where is location of “Related Products” and “Cross-sells” collection of function

I am working admin backend module. I want to know location of Related Products and Cross-sells product-collections which open when we add a new product from admin panel.
1
vote
2answers
636 views

Display new attribute in related Products

I have a new attribute, and I want to display the new attributes, those related to the product, why this code does not work ?? What is wrong? <?php echo $this->escapeHtml($_item->getData('...
1
vote
0answers
17 views

How to show configurable product as related product with their options in Magento

The problem is that when I add a configurable product as a related product, it shows the product but there is no checkbox. I have read that in Magento2 when the related product is a configurable one ...
1
vote
1answer
49 views

How to show both at same time Upsell and Related Products In Product View Page Magento 2

I want to show Related and Upsell both at the same time in my product view page. I tried to change catalog_product_view.xml many times, but it displays me only upsell products not related. anyone, ...
1
vote
1answer
66 views

How to override product model files in Magento 2?

I am using Magento 2.3 I have override below core file. vendor/magento/module-catalog/Model/ProductLink/CollectionProvider.php To override this file I have created a new custom module in app/code ...
1
vote
0answers
25 views

Magento 2: Backend Related, Upp-Sell and Cross-Sell Product Tab Filter Issue

When I filter Product By Name in related product tab product filter Working Completed, but without product add called save function directly and page redirect to the Catalogue page.Any idea,please ...
1
vote
0answers
24 views

Show Product Out of Stock if Related Item Out of Stock

Is there a way in Magento 2.2.1 to mark a product out of stock if the related item is out of stock?
1
vote
0answers
16 views

Product page (Related.php) error in Magento 2.1.16

I override the page Related.php and add my extra custom function in this class it works perfectly on 2.2.X but in 2.1.16 it shows me this error Warning: Invalid argument supplied for foreach() in /...