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
3k 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
942 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
1k 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
4answers
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
19k 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
864 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
0answers
417 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
4answers
7k 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. ...
3
votes
2answers
12k 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
691 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
644 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 ...
3
votes
1answer
215 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
653 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
791 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
34 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
110 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
7k views

Related Products template customize

How do you change the related products template output. Instead select all I would like to add a "add to cart" button to all related products and remove checkboxes.
2
votes
1answer
3k 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
845 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
556 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
2answers
2k views

How to remove related products check boxes on magento2

I've used app/design/frontend/<your_vendor_name>/<your_theme_name>/Magento_Catalog/templates/product/list/items.phtml to set $showCart = true; so that an Add to Cart button is used for ...
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
99 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
52 views

How can I increase the number of related products shown on product detail page in Magento 2? [duplicate]

I am running Magento 2.3.3 and currently show 4 products on the product detail page. Where do I go to increase that number to 6? I have found nothing in the admin panel.
2
votes
1answer
387 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
145 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
873 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
12 views

Show/Link variation

Just want to start by saying thank you for taking the time to read this. I'm wondering if there is any possible way to link or show variation/simple products tied to a configurable product? Like when ...
2
votes
0answers
113 views

Magento 2: how to get Custom Options in custom product list on detail page?

This is my Custom Collection, I want custom options in this collection below the price. I have custom product collection like related, upsell products, the collection is properly displaying on the ...
2
votes
0answers
56 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 ...
2
votes
0answers
526 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
353 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
844 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
1answer
1k 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
92 views

Magento 2.3 - Get category of item related foreach

I want to load the category name and category url of the item that is displayed as a related item on the productpage. So inside the foreach element, I want to load the category name and url of the ...
1
vote
2answers
471 views

Magento : Add product qty box in related product

I have a related product list in product detail page. Default there is not qty box available to edit qty i want to add qty box and also it's qty add to checkout/cart page while add specific qty.
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
419 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
120 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
2k 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
39 views

Magento 2 : which tables is used for Related Products, Up-Sells, and Cross-Sells?

I'm trying to get which table saves the Related Products for items and order-items? Is there any way to know how many items sold by these property. I try to check this table sales_order_item but I don'...
1
vote
1answer
319 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?