0

I would like to show the product data sheet in a modal popup. I intend to add the data sheet to the product image gallery, keep it hidden and then recall it in the popup.

Create the modal popup is not difficult, I need help only to display the image product.

To do this I created a new image attribute "datasheet", so I would like to use a similar code to show the attributes but in this case it will shows the datasheet image and that it can dynamically change for configurable products.

Can you help me?

Joso
  • 317
  • 2
  • 12
  • show your code that you tried. – Sohel Rana Apr 19 '20 at 05:08
  • Hi, I used this code to call image: Show me popup blank – Joso Apr 19 '20 at 05:53
  • try this code may be help you : -- <img class="col data datasheet" data-th="<?= $product->getResource()->getAttribute('datasheet')->getFrontend()->getValue($product); ?>" src="<?= $product->getResource()->getAttribute('datasheet')->getFrontend()->getValue($product)->getImageUrl(); ?>" /> – Mohit Patel Apr 19 '20 at 12:19
  • Hi Mohit, the code show error: Exception #0 (Exception): Notice: Undefined variable: product in – Joso Apr 19 '20 at 12:27
  • <img class="col data datasheet" data-th="<?= $_product->getResource()->getAttribute('datasheet')->getFrontend()->getValue($product); ?>" src="<?= $_product->getResource()->getAttribute('datasheet')->getFrontend()->getValue($product)->getImageUrl(); ?>" /> – Mohit Patel Apr 19 '20 at 13:03
  • Hi, again an error: Exception #0 (Exception): Notice: Undefined variable: product in – Joso Apr 19 '20 at 13:20
  • Hi, I solved follow some step in this post: https://magento.stackexchange.com/a/253668/12071 , edit with my data and it works – Joso Apr 19 '20 at 15:41

0 Answers0