Skip to content

Commit

Permalink
Merge pull request #28 from Casper-O/master
Browse files Browse the repository at this point in the history
Fix combination images
  • Loading branch information
Casper-O authored May 17, 2017
2 parents a28488e + f2d4143 commit be03858
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gshoppingflux/gshoppingflux.php
Original file line number Diff line number Diff line change
Expand Up @@ -2263,11 +2263,11 @@ private function getItemXML($product, $lang, $id_curr, $id_shop, $combination =
if ($image_type == '') {
$image_type = 'large_default';
}

foreach ($images as $im) {
$cover_key = array_search('1', array_column($images, 'cover'));
foreach ($images as $im_key => $im) {
$image = $this->context->link->getImageLink($product['link_rewrite'], $product['id_product'].'-'.$im['id_image'], $image_type);
$image = preg_replace('*http://'.Tools::getHttpHost().'/*', $this->uri, $image);
if ($im['cover'] == 1) {
if ($im['cover'] == 1 || ($cover_key === false && $im_key == 0)) {
$xml_googleshopping .= '<g:image_link><![CDATA['.$image.']]></g:image_link>'."\n";
} else {
$xml_googleshopping .= '<g:additional_image_link><![CDATA['.$image.']]></g:additional_image_link>'."\n";
Expand Down

0 comments on commit be03858

Please sign in to comment.