if then help

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

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?

Got it. Thanks anyway...

on this page: 

http://www.axislighting.com/CMS/search_products.php, I can further sort by selecting quickship and viewing only items that are quickship like this:

http://www.axislighting.com/CMS/search_products.php?quickship=quickship 

Now, I want that if quickship is selected, I can organize the listings by mountings. Can this be done with an if then statement. Here are the files.

Now important to note, this should be sorted only when quickship is selected. Otherwise should look like the search_products.php page.