Shopping Basket

 x 

Cart empty


Log In

Find Us Elsewhere

SSL

Forum Search

Keyword

Remove images from the feed

  • m.davide82
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 year 11 months ago #4005 by m.davide82
Remove images from the feed was created by m.davide82
Hi,

is there any way to have only the main image of the product in the feed generated from the component?

Thanks a lot!

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago - 1 year 11 months ago #4011 by boggler
Replied by boggler on topic Remove images from the feed
At the moment there is no option to do this. You can edit the views/googlebasexml/view.xml.php file, just remove the code that generates the additional images, which is this:-
//additional images
$productAdditionalImages = array();
$i=0;
foreach($item->additionalImages as $image)
{
	$productAdditionalImages[$i] = $product->addChild($tags->additionalImages);
	$productAdditionalImages[$i]->setData(rtrim($imagebase,'/').'/'.ltrim($image->file_url,'/'));	
	$i++;
	if($i > 10){ break; }
}
Last edit: 1 year 11 months ago by boggler.

Please Log in or Create an account to join the conversation.

  • m.davide82
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 year 11 months ago #4012 by m.davide82
Replied by m.davide82 on topic Remove images from the feed
Thank you, wonderful!

But if I would like to have all the additionatl images and not the first one (because I have watermarks)?


Thanks a lot!

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #4013 by boggler
Replied by boggler on topic Remove images from the feed
You mean all the additional images but not the main one? That is the exact opposite of what you originally asked for.

I think that Amazon require the main image to be the one displayed on your product page,so it is probably not a good idea.

Please Log in or Create an account to join the conversation.

  • m.davide82
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 year 11 months ago #4014 by m.davide82
Replied by m.davide82 on topic Remove images from the feed
Yes, yes, I know that this is the opposite.

I was thinking in high voice.

I think that google too, needs it to be the same of the landing page.

But if not, is that any way to do it?


Thanks!

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #4015 by boggler
Replied by boggler on topic Remove images from the feed
In the same file, you can change line 101
$productImage->setData(rtrim($imagebase,'/').'/'. ltrim($item->file_url,'/'));

to
$main_image = array_shift($item->additionalImages);
 $productImage->setData(rtrim($imagebase,'/').'/'. ltrim($main_image,'/'));

It just pops the first of the additional images off the start of the array and sets it as the main image.

I think you would do better to just sort out your images though.

Please Log in or Create an account to join the conversation.

  • m.davide82
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 year 11 months ago #4016 by m.davide82
Replied by m.davide82 on topic Remove images from the feed
Thank you very much, I will do some tests!

Please Log in or Create an account to join the conversation.

Moderators: boggler
Time to create page: 0.170 seconds

Donate to Us

If you like our extensions, consider making a donation to say thanks.