if then help

4 posts by 2 authors in: Forums > CMS Builder
Last Post: April 14, 2017   (RSS)

By dccreatives - April 5, 2017

If search results are an item that is quickship, I want it to show that a quickship image, otherwise, it should show main image. Here is my code. I dont think i have tags nestled correctly.

<?php if ($record['quick_ship']): ?> <?php foreach ($record['quickship_image'] as $upload): ?>
<?php if ($upload['isImage']): ?>
<a href="<?php echo $record['link'] ?>"><img src="<?php echo $upload['urlPath'] ?>" alt="" class="img-bord" width="150" height="150" border="0" /></a>
<?php endif ?> <?php endforeach ?>
<?php else: ?>

<?php foreach ($record['main_image'] as $upload): ?>
<?php if ($upload['isImage']): ?>
<a href="<?php echo $record['link'] ?>"><img src="<?php echo $upload['urlPath'] ?>" alt="" class="img-bord" width="150" height="150" border="0" /></a> <?php endif ?>
<?php break; ?>
<?php endforeach ?>

What is wrong with my code?

By dccreatives - April 5, 2017

Got it. Thanks anyway...

By ross - April 14, 2017

Thanks for posting your solution :)

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/