Shopping Basket

 x 

Cart empty


Log In

Find Us Elsewhere

SSL

Forum Search

Keyword

Mod VM Featured Product Grid - Image Display

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
4 years 4 months ago #3118 by 4FootyFans
Hi

I don't think I've missed a setting option but, if you see the attached screenshot, I do not wish to display multiple images in this module.

Are you able to advise an edit so that the selector does not display?

TIA


Attachments:

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

More
4 years 4 months ago - 4 years 4 months ago #3120 by boggler
Replied by boggler on topic Mod VM Featured Product Grid - Image Display
helper.php, line starting 131:
$productModel->addImages($products);
	$i = 0;
	foreach($products as &$product ){
	if($checkImages && self::countProductImages($product->images) == 0)
	{
			continue;	
	}
							
	$lists[$i] = modFeatureProdGridHelper::product_snapshot($product, $params);
	$i++;
	if($i >= $maxitems){break;}				
				
}

add some extra code
$productModel->addImages($products);
	$i = 0;
	foreach($products as &$product ){
	if($checkImages && self::countProductImages($product->images) == 0)
	{
		continue;	
	}
	$product->images = array_slice($product->images,0,1);
	$lists[$i] = modFeatureProdGridHelper::product_snapshot($product, $params);
	$i++;
	if($i >= $maxitems){break;}				
				
}

In case it is not clear, the extra line is:
$product->images = array_slice($product->images,0,1);
Last edit: 4 years 4 months ago by boggler.

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

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
4 years 4 months ago #3121 by 4FootyFans
Replied by 4FootyFans on topic Mod VM Featured Product Grid - Image Display
Thanks, Boggler.

Worked a treat.

Best

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

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
4 years 3 months ago #3185 by 4FootyFans
Replied by 4FootyFans on topic Mod VM Featured Product Grid - Image Display
Hi

I'd now like the grid images to align center rather than float left.

Kindly advise the required edit(s)

TIA

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

More
4 years 3 months ago - 4 years 3 months ago #3186 by boggler
Replied by boggler on topic Mod VM Featured Product Grid - Image Display
Probably line 35 in the file tmpl/default.php,
<div style="width:<?php echo $list->imgwidth; ?>px;height:<?php echo $list->imgheight; ?>px;text-align:center;float:left;">

Try removing float:left, replace with
margin-left:auto;margin-right:auto;

But you may have to do some experimentation to get this right. There is some useful info about centering things here: http://www.w3.org/Style/Examples/007/center.en.html#block

So you have
<div style="width:<?php echo $list->imgwidth; ?>px;height:<?php echo $list->imgheight; ?>px;text-align:center;margin-left:auto;margin-right:auto;">
Last edit: 4 years 3 months ago by boggler.

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

Moderators: boggler
Time to create page: 0.341 seconds

Donate to Us

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