Skip to content

Conversation

@VincentMarmiesse
Copy link
Contributor

Description

Currently, the product image has an hardcoded class product-image-photo which can't be overriden when using the $attributes parameter of the imageBuilder->create() function.

Manual testing scenarios

  1. Display a product image using
$block->getImage($product, $image, ['class' => 'my-custom-class'])->toHtml();

=> The img tag has my-custom-class as class.

  1. Display a product image using
$block->getImage($product, $image)->toHtml();

=> The img tag has product-image-photo as class.

The aim here is to allow customization without breaking the default value.

I'm open to discussion about how to deal with this!

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@josefbehr
Copy link
Contributor

@VincentMarmiesse Thanks you for your contribution. I think this is a worthwhile change. Please remove the trailing whitespace in line 131 in file Magento/Catalog/Block/Product/ImageFactory.php an we're good to go :)

@VincentMarmiesse
Copy link
Contributor Author

@josefbehr it's done!

@magento-engcom-team
Copy link
Contributor

Hi @josefbehr, thank you for the review.
ENGCOM-3159 has been created to process this Pull Request

@magento-engcom-team magento-engcom-team merged commit 65b4bf1 into magento:2.3-develop Oct 27, 2018
@magento-engcom-team
Copy link
Contributor

Hi @VincentMarmiesse. Thank you for your contribution.
We will aim to release these changes as part of 2.3.1.
Please check the release notes for final confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants