Skip to content

Commit

Permalink
Merged PR 9738: fix alt tag for edc template
Browse files Browse the repository at this point in the history
fix alt tag for edc template

Related work items: #75918
  • Loading branch information
Calin Diacon committed Sep 12, 2018
1 parent 28124f5 commit 91dedc9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions code/Dotdigitalgroup/Email/Block/Basket.php
Expand Up @@ -159,4 +159,20 @@ public function getProductImage($product)
return $this->helper('catalog/image')->init($product, 'small_image')->resize(85);
}

/**
* @param $product
* @param string $code
* @return mixed
*/
public function getProductLabel($product, $code = 'small_image')
{
$label = $product->getData( $code . '_label');

if (empty($label)) {
$label = $product->getName();
}

return $label;
}

}
Expand Up @@ -135,7 +135,7 @@
<?php foreach($items as $item):?>
<tr>
<td style="padding: 5px; border-bottom: 1px solid #cbd3d4; border-right: 1px solid #cbd3d4;">
<img alt="<?php echo $this->stripTags($this->getImageLabel($item['product'], 'small_image'), null, true) ?>"
<img alt="<?php echo $this->stripTags($this->getProductLabel($item['product'], 'small_image'), null, true);?>"
src="<?php echo $this->getProductImage($item['product']); ?>" width="85" height="85"
align="middle"
border="0">
Expand Down

0 comments on commit 91dedc9

Please sign in to comment.