Commerce product images are not available to the block

Created on 27 February 2024, 11 months ago
Updated 30 September 2024, 4 months ago

Problem/Motivation

Image fields on commerce products are not used by the block.

Steps to reproduce

Create a product variation and add a 'field_product_image' field on the product variation. Create a product of the variation. Place advanced_title_block and you would not find the 'field_product_image' field as an option to use for image background. What would show is the default 'field_image'. Now create a 'field_image' field on the product variation since that was the field name available to the block, yet no image background is displayed.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇳🇬Nigeria chike Nigeria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @chike
  • @chike opened merge request.
  • 🇳🇬Nigeria chike Nigeria
  • 🇳🇬Nigeria chike Nigeria

    After the release of Drupal 11 version, the MR here which I use in my sites became unmergeable and thus the patch wasn't applying anymore. I tried to rebase the MR but seems I mistakenly committed to the main branch. I am sorry about that. I am not a programmer hence the mistake.

    @hatuhay please discard the changes I made if not okay by you. I will henceforth be manually patching my sites as I really need those features in the MR.

    Thanks.

  • 🇳🇬Nigeria chike Nigeria

    Here is a patch that works with the latest version.

    This patch will add the following features to the module:

    1) Make possible to show image fields on products, taxonomy terms and users. Without this patch you can't show image fields of products, users and taxonomy terms, you can only show image fields of nodes.

    2) Make possible to add the site breadcrumb inside the block. With a checkbox you can choose to add the breadcrumb or not.

    3) Make possible to choose overlay colors. You can choose two colors for the overlay color gradient, choose the gradient direction and choose overlay opacity, all in the UI.

    4) Make possible to choose to show or hide the image title of the image field or the alternative text for the "Default background image" if image field is not used.

    As I said earlier, AI helped me write these features so perhaps I (sorry, 'we') could have missed one or two Drupal coding standards.

Production build 0.71.5 2024