Questions tagged [related-products]

Denotes questions about Magentos related products feature.

Filter by
Sorted by
Tagged with
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 ...
9
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, ...
7
votes
2answers
804 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 ...
6
votes
1answer
6k 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-...
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
969 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....
5
votes
3answers
4k 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 ...
5
votes
3answers
16k 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
496 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
2answers
216 views

Magento 1.9.3.X: Get all related products of a product

I need to retrieve related products from a particular product with id. I tried using the getRelatedProductCollection method unsuccessfully, not sure if this method is. I need to get these related ...
4
votes
0answers
385 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
2answers
11k 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
2answers
683 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
1answer
171 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
631 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
744 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
30 views

Error: The same url in all products Magento 1.9

I've tried to show the related products under the images of products. Until here all is ok, but the URL of the products is showing always the same of the first related product How can I solve this? ...
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
798 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
360 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
2k 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
92 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
70 views

Need Related Products in bottom of product detailed page

I need to display related products below the description(bottom of the page) but in theme it is coming right side of the page(we are using Porto theme). Could anyone please tell me how to display ...
2
votes
1answer
80 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
868 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
498 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
343 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
784 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
4k 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
577 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
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
1answer
414 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
116 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
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
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
47 views

How to change product image on swatch selection on related product on product view page in Magento 2?

I have color swatches on related products list on product page. I want to change product image on the basis of swatch selection on view page. How can I change image?
1
vote
1answer
204 views

How can i disable Related Post tab on product page magento 2?

I want detail tab to active at first also related product tab to be hidden or disable.
1
vote
2answers
3k views

Magento 2: Get Related products from Product Id now showing Name and price

Below is my code to get related products from products id, It is working fine but not giving values for name and price it just gives SKU and id $objectManager = \Magento\Framework\App\ObjectManager::...
1
vote
2answers
1k 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
119 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
964 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
70 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
378 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
699 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('...