close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Product Results Layout

Thread began 6/30/2009 6:54 pm by anitah355532 | Last modified 1/21/2010 5:47 pm by mick106153 | 10895 views | 23 replies |

anitah355532

Product Results Layout

On the products_Results page I would like the products to display 3 across and then continue to the next row, another 3 across, etc.

I've reduced the size of the WADAResultInfoArea so that the products will fit on the page, but I'm not sure where the code is that tells it what order to display the results.

Can anyone assist please?

Sign in to reply to this post

Ray BorduinWebAssist

The order is controlled by the ORDER BY statement in the Recordset itself.

Sign in to reply to this post
Did this help? Tips are appreciated...

anitah355532

I'm new to all this, and although your instruction sounds simple enough, I still have no idea what to do. Can you please give me a little more detail? Where do I find the ORDER BY statement, and what do you mean by "the Recordset itself"?

Sign in to reply to this post

anitah355532

Having just done a bit of research via Google, and I think you mean I can order the products using SQL. Doesn't this just order alphabetically, numerically, etc. Can this tell Product_Results.php to display in columns and rows?

Sign in to reply to this post

Ray BorduinWebAssist

That is correct, you can only order alphabetically or numerically and as a result the data is organized into rows and not columns. Column display is not currently supported and would require loading the information into an array and building the table dynamically instead of simple looping as it currently uses.

Sign in to reply to this post
Did this help? Tips are appreciated...

anitah355532

As it's too late to re-create my site using someone else's software, and my client has specifically asked for columns of products ..... is there anyone out there who can help me? If you've found a way of getting Powerstore to display the products in columns and rows can you please respond to me via this forum.

I had no idea that Powerstore is not as customisable as I'd hoped, and I've now got myself in a bit of a fix. Any assistance would be gratefully received.

In the meantime I'll attempt to learn the process of "loading the information into an array and building the table dynamically" via other sites.

Sign in to reply to this post

anitah355532

Jason Byrnes from Web Assist support has come to my rescue and sent me the required code to insert into the product_results page. Needs tidying up with css, but it works perfectly.

Thank you Jason !!!

Sign in to reply to this post

larsentim278054

Could you post his instructions? I'm interested in something similar.

Originally Said By: anitah355532
  Jason Byrnes from Web Assist support has come to my rescue and sent me the required code to insert into the product_results page. Needs tidying up with css, but it works perfectly.

Thank you Jason !!!  
Sign in to reply to this post

anitah355532

Here are the instructions Jason sent me. It needed tidying up, but here's the code. If you want to see how it looks my URL is test/

Posted By: jbyrnes@webassist.com (Jason Byrnes) Message 4 in Log
Date: 07/02/2009 03:35 pm No Attachments
Title: RE: Columns and Rows

Well you can get the horizontal looper on the results page by changing lines 431 - 464 of the stock results page:
<?php $cellCount = 0; ?>
<?php do { ?>
<?php if($cellCount == 0) { ?><tr><?php }?>
<td class="WADAResultsEntry"><div class="WADAResultThumbArea"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" title="<?php echo $row_WADAProducts["ProductName"]; ?>"><img class="WADAResultThumb" border="0" src="Images/Upload/<?php echo $row_WADAProducts["ProductThumb"]; ?>" alt="<?php echo $row_WADAProducts["ProductName"]; ?>" /></a></div>
<div class="WADAResultInfoArea">
<div class="WADAResultPrice">$<?php echo number_format($row_WADAProducts["ProductPrice"],2); ?></div>
<div class="WADARecordNavigationButtons">
<table width="100%" class="WADAEditButton_Table">
<tr>
<td align="right"><?php
if ($row_WADAProducts["NumLeft"] > 0 || $row_WADAProducts["ProductUnlimited"] != 0) {
?>
<form name="WA_Store_Cart_1_ATC_<?php echo $row_WADAProducts["ProductID"]; ?>" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="WA_Store_Cart_1_ID_Add" value="<?php echo $row_WADAProducts["ProductID"]; ?>" >
<input type="hidden" name="WA_Store_Cart_1_Quantity_Add" value="1" size="4" style="margin-bottom:2px"/>
<input type="image" src="WA_eCart/Images/Slate/Btn2_EN_addtocart.gif" border="0" value="Add to Cart" name="WA_Store_Cart_1_ATC" alt="Add to cart" style="vertical-align:bottom;">
</form>
<?php
} else {
?>
Sold out!
<?php
}
?></td>
<td valign="top"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" title="View"><img border="0" name="View<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" id="View<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" alt="View" src="WA_DataAssist/images/Slate/Traditional_zoom.gif" style="vertical-align:bottom" /></a></td>
</tr>
</table>
</div>
</div>
<div class="WADAResultInfoArea2">
<div class="WADAResultTitle"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>"><?php echo $row_WADAProducts["ProductName"]; ?></a></div>
<div class="WADAResultDescription"><?php echo $row_WADAProducts["ProductShortDesc"]; ?> <a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>">More...</a></div>
</div></td>
<?php $cellCount ++; ?>
<?php if($cellCount == 3) { ?></tr><?php $cellCount = 0; } ?>
<?php } while ($row_WADAProducts = mysql_fetch_assoc($WADAProducts)); ?>


to:
<?php $cellCount = 0; ?>
<?php do { ?>
<?php if($cellCount == 0) { ?><tr><?php }?>
<td class="WADAResultsEntry"><div class="WADAResultThumbArea"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" title="<?php echo $row_WADAProducts["ProductName"]; ?>"><img class="WADAResultThumb" border="0" src="Images/Upload/<?php echo $row_WADAProducts["ProductThumb"]; ?>" alt="<?php echo $row_WADAProducts["ProductName"]; ?>" /></a></div>
<div class="WADAResultInfoArea">
<div class="WADAResultPrice">$<?php echo number_format($row_WADAProducts["ProductPrice"],2); ?></div>
<div class="WADARecordNavigationButtons">
<table width="100%" class="WADAEditButton_Table">
<tr>
<td align="right"><?php
if ($row_WADAProducts["NumLeft"] > 0 || $row_WADAProducts["ProductUnlimited"] != 0) {
?>
<form name="WA_Store_Cart_1_ATC_<?php echo $row_WADAProducts["ProductID"]; ?>" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="WA_Store_Cart_1_ID_Add" value="<?php echo $row_WADAProducts["ProductID"]; ?>" >
<input type="hidden" name="WA_Store_Cart_1_Quantity_Add" value="1" size="4" style="margin-bottom:2px"/>
<input type="image" src="WA_eCart/Images/Slate/Btn2_EN_addtocart.gif" border="0" value="Add to Cart" name="WA_Store_Cart_1_ATC" alt="Add to cart" style="vertical-align:bottom;">
</form>
<?php
} else {
?>
Sold out!
<?php
}
?></td>
<td valign="top"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" title="View"><img border="0" name="View<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" id="View<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" alt="View" src="WA_DataAssist/images/Slate/Traditional_zoom.gif" style="vertical-align:bottom" /></a></td>
</tr>
</table>
</div>
</div>
<div class="WADAResultInfoArea2">
<div class="WADAResultTitle"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>"><?php echo $row_WADAProducts["ProductName"]; ?></a></div>
<div class="WADAResultDescription"><?php echo $row_WADAProducts["ProductShortDesc"]; ?> <a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>">More...</a></div>
</div></td>
<?php $cellCount ++; ?>
<?php if($cellCount == 3) { ?></tr><?php $cellCount = 0; } ?>
<?php } while ($row_WADAProducts = mysql_fetch_assoc($WADAProducts)); ?>



You will run into display problems with the css however, this is the part we will not be able to assist with.

Sign in to reply to this post

larsentim278054

Thank you so much! What did he mean by the CSS would be messed up? Did you have to fix the CSS code at all to get it to look how you have it on your site? By the way, I think you did a great job on that. Looks really nice.

Originally Said By: anitah355532
  Here are the instructions Jason sent me. It needed tidying up, but here's the code. If you want to see how it looks my URL is test/

Posted By: jbyrnes@webassist.com (Jason Byrnes) Message 4 in Log
Date: 07/02/2009 03:35 pm No Attachments
Title: RE: Columns and Rows

Well you can get the horizontal looper on the results page by changing lines 431 - 464 of the stock results page:
<?php $cellCount = 0; ?>
<?php do { ?>
<?php if($cellCount == 0) { ?><tr><?php }?>
<td class="WADAResultsEntry"><div class="WADAResultThumbArea"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" title="<?php echo $row_WADAProducts["ProductName"]; ?>"><img class="WADAResultThumb" border="0" src="Images/Upload/<?php echo $row_WADAProducts["ProductThumb"]; ?>" alt="<?php echo $row_WADAProducts["ProductName"]; ?>" /></a></div>
<div class="WADAResultInfoArea">
<div class="WADAResultPrice">$<?php echo number_format($row_WADAProducts["ProductPrice"],2); ?></div>
<div class="WADARecordNavigationButtons">
<table width="100%" class="WADAEditButton_Table">
<tr>
<td align="right"><?php
if ($row_WADAProducts["NumLeft"] > 0 || $row_WADAProducts["ProductUnlimited"] != 0) {
?>
<form name="WA_Store_Cart_1_ATC_<?php echo $row_WADAProducts["ProductID"]; ?>" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="WA_Store_Cart_1_ID_Add" value="<?php echo $row_WADAProducts["ProductID"]; ?>" >
<input type="hidden" name="WA_Store_Cart_1_Quantity_Add" value="1" size="4" style="margin-bottom:2px"/>
<input type="image" src="WA_eCart/Images/Slate/Btn2_EN_addtocart.gif" border="0" value="Add to Cart" name="WA_Store_Cart_1_ATC" alt="Add to cart" style="vertical-align:bottom;">
</form>
<?php
} else {
?>
Sold out!
<?php
}
?></td>
<td valign="top"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" title="View"><img border="0" name="View<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" id="View<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" alt="View" src="WA_DataAssist/images/Slate/Traditional_zoom.gif" style="vertical-align:bottom" /></a></td>
</tr>
</table>
</div>
</div>
<div class="WADAResultInfoArea2">
<div class="WADAResultTitle"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>"><?php echo $row_WADAProducts["ProductName"]; ?></a></div>
<div class="WADAResultDescription"><?php echo $row_WADAProducts["ProductShortDesc"]; ?> <a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>">More...</a></div>
</div></td>
<?php $cellCount ++; ?>
<?php if($cellCount == 3) { ?></tr><?php $cellCount = 0; } ?>
<?php } while ($row_WADAProducts = mysql_fetch_assoc($WADAProducts)); ?>


to:
<?php $cellCount = 0; ?>
<?php do { ?>
<?php if($cellCount == 0) { ?><tr><?php }?>
<td class="WADAResultsEntry"><div class="WADAResultThumbArea"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" title="<?php echo $row_WADAProducts["ProductName"]; ?>"><img class="WADAResultThumb" border="0" src="Images/Upload/<?php echo $row_WADAProducts["ProductThumb"]; ?>" alt="<?php echo $row_WADAProducts["ProductName"]; ?>" /></a></div>
<div class="WADAResultInfoArea">
<div class="WADAResultPrice">$<?php echo number_format($row_WADAProducts["ProductPrice"],2); ?></div>
<div class="WADARecordNavigationButtons">
<table width="100%" class="WADAEditButton_Table">
<tr>
<td align="right"><?php
if ($row_WADAProducts["NumLeft"] > 0 || $row_WADAProducts["ProductUnlimited"] != 0) {
?>
<form name="WA_Store_Cart_1_ATC_<?php echo $row_WADAProducts["ProductID"]; ?>" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="WA_Store_Cart_1_ID_Add" value="<?php echo $row_WADAProducts["ProductID"]; ?>" >
<input type="hidden" name="WA_Store_Cart_1_Quantity_Add" value="1" size="4" style="margin-bottom:2px"/>
<input type="image" src="WA_eCart/Images/Slate/Btn2_EN_addtocart.gif" border="0" value="Add to Cart" name="WA_Store_Cart_1_ATC" alt="Add to cart" style="vertical-align:bottom;">
</form>
<?php
} else {
?>
Sold out!
<?php
}
?></td>
<td valign="top"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" title="View"><img border="0" name="View<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" id="View<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>" alt="View" src="WA_DataAssist/images/Slate/Traditional_zoom.gif" style="vertical-align:bottom" /></a></td>
</tr>
</table>
</div>
</div>
<div class="WADAResultInfoArea2">
<div class="WADAResultTitle"><a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>"><?php echo $row_WADAProducts["ProductName"]; ?></a></div>
<div class="WADAResultDescription"><?php echo $row_WADAProducts["ProductShortDesc"]; ?> <a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?>">More...</a></div>
</div></td>
<?php $cellCount ++; ?>
<?php if($cellCount == 3) { ?></tr><?php $cellCount = 0; } ?>
<?php } while ($row_WADAProducts = mysql_fetch_assoc($WADAProducts)); ?>



You will run into display problems with the css however, this is the part we will not be able to assist with.  
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...