Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Product Image Parent Product Thumbnail not working #17174

Closed
willwright111 opened this issue Jul 26, 2018 · 15 comments
Closed

Configurable Product Image Parent Product Thumbnail not working #17174

willwright111 opened this issue Jul 26, 2018 · 15 comments
Labels
Component: Checkout Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@willwright111
Copy link

willwright111 commented Jul 26, 2018

Preconditions

Magento 2.2.5 Community
PHP 7.1
Server Apache

Steps to reproduce

  1. Configuration > Sales > Checkout ensure that Configurable Product Image is set to Parent Product Thumbnail.
  2. Create a Configurable Product with a main image on the parent product.
  3. Add image to the First Child product.
  4. Add both child products to cart.

Expected result

  1. If Configuration > Sales > Checkout > Configurable Product Image is set to "Parent Product Thumbnail", parent product images should be shown on Mini-Cart, Shopping Cart and Checkout.
  2. If Configuration > Sales > Checkout > Configurable Product Image is set to "Product Thumbnail Itself", child product images should be shown on Mini-Cart, Shopping Cart and Checkout.

Actual result

Product images displaying is inconsistent on Mini-Cart, Shopping Cart and Checkout.

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Jul 26, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Jul 26, 2018

Hi @willwright111. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@willwright111 do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@ghost ghost self-assigned this Jul 27, 2018
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Jul 27, 2018
@ghost ghost added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: Checkout Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Jul 27, 2018
@ghost
Copy link

ghost commented Jul 27, 2018

@willwright111, thank you for your report.
We've acknowledged the issue and added to our backlog.

@ghost ghost removed their assignment Jul 27, 2018
@numan201
Copy link

numan201 commented Jul 28, 2018

It seems that fix #8168 added in Magento 2.2.5 introduced this issue.

My proposed solution is to change lines 125-130 of vendor/magento/module-catalog/Block/Product/ImageBuilder.php to the following:

    $simpleOption = $this->product->getCustomOption('simple_product');

    if ($simpleOption !== null) {

        $optionProduct = $simpleOption->getProduct();

        if ($optionProduct->getThumbnail() !== null) {

            $this->setProduct($optionProduct);

        }

    }

`

Not sure if this is the best approach, but it's working for now.

@ronak2ram
Copy link
Member

@willwright111
The issue has been fixed.

Related commit(s):

@numan201
Copy link

numan201 commented Jul 28, 2018

@ronak2ram Thanks for the reply.

I thought lines 125-130 of ImageBuilder.php are supposed to fix #8168.

It appears that the commit you referenced (108c2c5) breaks support for this. I believe that it is still supposed to be getCustomOption instead of getOptionById to be able to display the variation's image (if present). I think getOptionById() is a method for products with custom options setup, not configurable products.

However, there still needs to be a check if the variation even has a product image prior to using it as the Cart\Wishlist's image.

@ronak2ram
Copy link
Member

@numan201 You right,
My solution is not working for a wishlist image.
We have to find some better solution for it.

@numan201
Copy link

@ronak2ram, what're your thoughts on the potential solution I posted earlier?

@ronak2ram
Copy link
Member

@numan201
Your solution does not work on cart page.
Please test this(#16843 ) issue with your solution.

@numan201
Copy link

@ronak2ram My solution seems to be working fine on the cart page for me.

@ronak2ram
Copy link
Member

You checked with both option ?
Configuration > Sales > Checkout > Configurable Product Image

  1. Parent Product Thumbnail
  2. Product Thumbnail Itself

Check pages Cart page, Mini cart, Wishlist with both option.

If you solution work than you can create pull request for magento developer and developer will be test your code.

@apedicdev
Copy link
Contributor

apedicdev commented Aug 21, 2018

Would it be a good solution to check first checkout/cart/configurable_product_image configuration before retrieving the needed image? Please have a look at the proposed solution apedicdev@55a252d

@damjess
Copy link

damjess commented Sep 5, 2018

Noticing the same problem -- same preconditions and actual results: Parent image visible in minicart and checkout, but child image displaying on cart page, despite Configuration settings as "Configurable Product Image" 1. Parent Product Thumbnail

@kevinvarley
Copy link

Reproduced on 2.2.5

@damjess
Copy link

damjess commented Oct 4, 2018

Appears to be resolved in 2.2.6 with pull request #16863

@sdzhepa
Copy link
Contributor

sdzhepa commented Dec 27, 2018

Hello @willwright111 @kevinvarley @BubblegumAnarchy

As we can see from the comment above #17174 (comment) this issue is fixed in #16863

It is available in 2.2-develop now and should be availabe in 2.2.6

This ticket can be closed.
Please, feel free to reopen or create a new one if issue still exists or was not fully fixed

Thank you for feedback and collaboration

@sdzhepa sdzhepa closed this as completed Dec 27, 2018
@sdzhepa sdzhepa added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Checkout Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

8 participants