Hi there, hope you can help here.
I basically want to output my list of products into a table, but display 5 products per table row.
e.g.
"Product1, Product2, Product3, Product4, Product5"
"Product6, Product7, Product8, Product9, Product10"
At the moment the code works but I am outputting 1 product per row.
e.g.
"Product1"
"Product2"
"Product3" etc
Here is the PHP code I have got (I didn't write it so I need to customise it to do this).
Anyone have an idea?:
require_once "$ds_path/lib/database.inc";
$products = get_products($db, stripslashes($ds_query), '' , 1, get_post_meta($post->ID, 'ds_title', true), get_option('ds_clickref'));
$permalink = get_permalink();
echo get_post_meta($post->ID, 'ds_title', true);
echo('<div style="clear:both"><table class="pricebox">');
foreach ($products as $product) {
if (str_startswith($product['deep_link'], 'http')) {
$deep_link = $product['deep_link'];
} else {
if (! $ds_redirect_url) {
$ds_redirect_url = $ds_url;
}
$deep_link = $ds_redirect_url . '/' . $product['deep_link'];
}
echo <<<EOHTML
<td>
<a href="$deep_link"><img src="{$product['image_url']}" border="0" alt="" width="100" height="100" /></a>
<p><strong>{$product['name']}</strong><br /><a target="_{$product['mykey']}" href="$deep_link"><strong>$CURRENCY_PREFIX{$product['display_price']}</strong></a><br /><a href="$deep_link"><img src="http://www.myurl.com/images/more.gif" border="0"/></a>
</td>
EOHTML;
}
echo('</table></div>');
}
Many Thanks