cancel
Showing results for 
Search instead for 
Did you mean: 

Secondary product in product View for Magento 2

Secondary product in product View for Magento 2

First of all thank you for you help. I'm trying to get a secondary product in the same product page by SKU which is assigned in the principal product attribute "ASSOCIATED_SKU".

What i need is to get the product and give the possibility to visitors to buy the first and/or the secondary product.

I'm trying in all the ways but i don't know how to get the secondary product by sku. 

To get the Sku i use this: 

$associated_sku = $_product->getData('associated_sku');

Thank you for your help

IT Manager/Full stack developer
6 REPLIES 6

Re: Secondary product in product View for Magento 2

Hi @alexgraf,

 

How is this requirment different of use Related or Upsells products?

I mean, how big is the difference between those features and your requirment?

Re: Secondary product in product View for Magento 2

Hi @Damian Culotta,

It's very different because for the associated product i have to show the quantity, variants, pistures, description ... Exactly as the other product, the customer will see first the product opened then the secondary product, exactly in the same way as the first. I will use related, and the other choices for other things because i see they don't do what i need.

IT Manager/Full stack developer

Re: Secondary product in product View for Magento 2

Hi @alexgraf,

 

Now I understand. Basically you're trying to show 2 products into 1 product page but both products should work as the main product. Right?

 

Re: Secondary product in product View for Magento 2

Exactly.
IT Manager/Full stack developer

Re: Secondary product in product View for Magento 2

Hi @alexgraf,

 

I understand your idea but I'm not sure how to handle it because is like trying to show 2 product pages into 1 page (I mean pages becasue the amount of functionality).

I'm out of ideas. I should start coding to try to write down an approach.

Re: Secondary product in product View for Magento 2

Hi @Damian Culotta,

i think the best way is to close the current product context and start another one to show the second product, then once showed the second, close the context of the second and reopen the current product context. This is what i found until today. If it works i'll let you know and share the code.

IT Manager/Full stack developer