cancel
Showing results for 
Search instead for 
Did you mean: 

Product Page product picture overlay using custom attribute text

Product Page product picture overlay using custom attribute text

Hello

I have a custom product attribute for product label text.

Everything is working correctly and I have the attribute value (label text) that appears on the product page just under the product photo (gallery).

In my catalog_product_view.xml file I have this:

<referenceContainer name="product.info.media">

<block class="Magento\Catalog\Block\Product\View" name="product.attribute.image_overlay" template="Magento_Catalog::product/view/image_overlay_product.phtml">

What should I be using instead of name="product.info.media"

 

I want the text to appear as an overlay over the main product photo instead of below the product gallery.

main_product_photo.jpg

Thank you

Andy

2 REPLIES 2

Re: Product Page product picture overlay using custom attribute text

Hi @Andy_Acute 
Can you please share the snapshot of current product page. Please confirm if you want the attribute value over the product image.
According to the snapshot of product page I will suggest you the solution.
Thank you.

Re: Product Page product picture overlay using custom attribute text

Hello Rakhi -

Thank you for replying to my post.

Please see attached images.

I think it is down to the block I am targeting.

I'm using <block class="Magento\Catalog\Block\Product\View" which must be wrong.

https://prnt.sc/13cc2h4 

https://prnt.sc/13cc38h 

https://prnt.sc/13cc3nk 

https://prnt.sc/13cc40t 

 

Thank you

Andy