cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple product attributes with multiple swatches.

Multiple product attributes with multiple swatches.

Hello, I'm wondering if someone could help me please.

 

I've successfully created a simple product that has multiple colour swatches which change when a customer has selected however, I'd like to step it up a notch for some of our more complicated products.

 

One of our products has multiple variations, similar to a workbench with four drop-down options, Size, Under Drawer, Drawer Colour and worktop option. I have all configurations as 3D images so I'd like the product (swatches) image to change as the customer goes through the selection process. So there is some option dependency on what swatch image should show. It's already giving me a headache thinking about it and was wondering what would be the best approach.

 

I've had a shop round for extensions and the best one I can find with apparently good customer support is this https://www.itoris.com/magento-2-custom-options.html 

 

Is extensions the best way to go about this or is there a much simpler method, am I missing something?

 

Many thanks.

6 REPLIES 6

Re: Multiple product attributes with multiple swatches.

Happy New Year to you all.

Just wondering if any can still shed some light on this please?

 

Kind Regards

Re: Multiple product attributes with multiple swatches.

Try creating product images as follows:

/**
 *  Structure  data
 images  for  param1=[1,5]  :
product_name_p1v1.jpg
product_name_p1v2.jpg
product_name_p1v3.jpg
product_name_p1v4.jpg
product_name_p1v5.jpg

 *images  for param2=[1,3] :
product_name_p2v1.jpg
product_name_p2v1_p1v1.jpg
product_name_p2v1_p1v2.jpg
product_name_p2v1_p1v3.jpg
product_name_p2v1_p1v4.jpg
product_name_p2v1_p1v5.jpg

product_name_p2v2.jpg
product_name_p2v2_p1v1.jpg
product_name_p2v2_p1v2.jpg
product_name_p2v2_p1v3.jpg
product_name_p2v2_p1v4.jpg
product_name_p2v2_p1v5.jpg

product_name_p2v3.jpg
product_name_p2v3_p1v1.jpg
product_name_p2v3_p1v2.jpg
product_name_p2v3_p1v3.jpg
product_name_p2v3_p1v4.jpg
product_name_p2v3_p1v5.jpg

 */

function getImageName($product){
    $pref='';
    $product_name=$product->getName();
    $param1= $product->getParams1();
    $param2= $product->getParams2();
    if ($param1>0)$pref.="_p1v".$param1;
    if ($param2>0)$pref="_p2v".$param2.$pref;
       $image_name=$product_name.$pref;
    return $image_name;

}

Re: Multiple product attributes with multiple swatches.

Thank you very much for your reply but I'm afraid all this means to me is gobbledegook. I only operate on Magento 2 using what tools are available and stay clear of any coding as it's not my area. Nor anyone else's in the company I work for. 

Re: Multiple product attributes with multiple swatches.

Hi @richard_evans,

 

I think, you can use configurable products feature here. This will resolve your problem. If you still face any issue then please share your issue with me.

 

if issue solved,Click Kudos & Accept as Solution

Re: Multiple product attributes with multiple swatches.

Can you please elaborate it how can i use it when I have multiple type of colors for a single product then where and how can i put image for different variations.

 

Ex attributes:

Red , Green 

Round , collar

I want to put different images for all 4 variation ie. Red + round will be different and Red + Collar will have different product. Same for Green with all 2.

Re: Multiple product attributes with multiple swatches.

Hello! Did you found solution?