Web Design Forum: display products in a single colum - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

display products in a single colum Rate Topic: -----

#1 User is offline   gfxpixeldesigns 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 492
  • Joined: 29-October 07
  • Reputation: 1
  • Gender:Male
  • Location:United Kingdom, Mossley
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 01 July 2009 - 03:56 PM

Hi,
Im working with CRELOADED ecommerce and im trying to list the products below one another rather than have them listed in colums but im not sure what file(s) i should be editing.
Is anyone familiar with customising CRELOADED or OSCOMMERCE (creloaded is based on oscommerce) and could help me out ?
The site im working on link as you can see the products are listed side by side id like to change this so there listed below one another e.g.
  • 0800774424 £10.00 Buy Now
  • 0800774424 £10.00 Buy Now

0

#2 User is offline   Wickham 

  • Web Guru
  • View gallery
  • Group: Moderators
  • Posts: 2,682
  • Joined: 11-June 09
  • Reputation: 233
  • Gender:Male
  • Location:Salisbury UK
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 01 July 2009 - 04:29 PM

At present you have a table with one tr tag (row) and three td tags (cells) which are always in the same row; so what you have to do is to add in more <tr> and </tr> tags between the cells to split them into different rows:-

<table border="0" width="100%" cellspacing="0" cellpadding="" class="productListing">
  <tr>
    <td align="center" class="productListing-data">&nbsp;<a href="http://www.dialnumbers.co.uk/secure/product_info.php?cPath=1&amp;products_id=1&amp;osCsid=85186e9e6694375b8727baae354cad52"></a>&nbsp;<br>&nbsp;<a href="http://www.dialnumbers.co.uk/secure/product_info.php?cPath=1&amp;products_id=1&amp;osCsid=85186e9e6694375b8727baae354cad52">0800774424</a>&nbsp; &nbsp;£10.00&nbsp; <a href="http://www.dialnumbers.co.uk/secure/index.php?action=buy_now&amp;products_id=1&amp;cPath=1&amp;osCsid=85186e9e6694375b8727baae354cad52"><span class="nowrap"><span class="template-button-left">&nbsp;</span><span class="template-button-middle">Buy Now</span><span class="template-button-right">&nbsp;</span></span></a>&nbsp;</td>

</tr><tr> <!--these have been added-->

    <td align="center" class="productListing-data">&nbsp;<a href="http://www.dialnumbers.co.uk/secure/product_info.php?cPath=1&amp;products_id=2&amp;osCsid=85186e9e6694375b8727baae354cad52"></a>&nbsp;<br>&nbsp;<a href="http://www.dialnumbers.co.uk/secure/product_info.php?cPath=1&amp;products_id=2&amp;osCsid=85186e9e6694375b8727baae354cad52">0800774425</a>&nbsp; &nbsp;£10.00&nbsp; <a href="http://www.dialnumbers.co.uk/secure/index.php?action=buy_now&amp;products_id=2&amp;cPath=1&amp;osCsid=85186e9e6694375b8727baae354cad52"><span class="nowrap"><span class="template-button-left">&nbsp;</span><span class="template-button-middle">Buy Now</span><span class="template-button-right">&nbsp;</span></span></a>&nbsp;</td>

</tr><tr> <!--these have been added-->

    <td align="center" class="productListing-data">&nbsp;<a href="http://www.dialnumbers.co.uk/secure/product_info.php?cPath=1&amp;products_id=3&amp;osCsid=85186e9e6694375b8727baae354cad52"></a>&nbsp;<br>&nbsp;<a href="http://www.dialnumbers.co.uk/secure/product_info.php?cPath=1&amp;products_id=3&amp;osCsid=85186e9e6694375b8727baae354cad52">0800774426</a>&nbsp; &nbsp;£10.00&nbsp; <a href="http://www.dialnumbers.co.uk/secure/index.php?action=buy_now&amp;products_id=3&amp;cPath=1&amp;osCsid=85186e9e6694375b8727baae354cad52"><span class="nowrap"><span class="template-button-left">&nbsp;</span><span class="template-button-middle">Buy Now</span><span class="template-button-right">&nbsp;</span></span></a>&nbsp;</td>
  </tr>
</table>


That will put them one above the other, but the width will be too great; with table width="100%" you will probably get the same total width of table but each cell will fill the whole width (and normally it will be in the center) so you may have to do some more work to get it to look good.

Delete the <br> tags in each td cell which cause the next part to go to the next line, then each item will only form one line (I've done it in my code above between the number and the price and Buy Now but there is another <br> tag in each cell which may also need deleting).

You may also find that there isn't enough height to have them one above the other unless you delete the <br> tags like I have, affecting items underneath, but experiment.

I'm not sure how the above links with CRELOADED; perhaps you have to do the edits in that program.
0

#3 User is offline   gfxpixeldesigns 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 492
  • Joined: 29-October 07
  • Reputation: 1
  • Gender:Male
  • Location:United Kingdom, Mossley
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 01 July 2009 - 04:47 PM

Thanks for the reply,
id add those extra tr tags but i cant figure out which file i should be editing. I think its somewhere in includes/modules/product_listing.php but i dont see any tr tags the code seems to be fetching the products from the database but i cant see any code creating the tables to list them. Link to text version of product_listing.php. Its my first time working with an ecommerce script so im new to this but im hoping someone thats used creloaded or oscommerce before can point me in the right direction.
0

#4 User is offline   gfxpixeldesigns 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 492
  • Joined: 29-October 07
  • Reputation: 1
  • Gender:Male
  • Location:United Kingdom, Mossley
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 01 July 2009 - 06:14 PM

I finally managed to figure it out :yahoo:
Incase of anyone else looking to do this you need to open templates/content/index_products.tpl.php
find
$listing_method = FILENAME_PRODUCT_LISTING_COL;
and replace with
$listing_method = FILENAME_PRODUCT_LISTING;

0

#5 User is offline   gfxpixeldesigns 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 492
  • Joined: 29-October 07
  • Reputation: 1
  • Gender:Male
  • Location:United Kingdom, Mossley
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 02 July 2009 - 09:19 PM

Id like to do the same thing again, only this time with the featured products link. See the 3 boxes id like to change the layout of them to be like
  • 0800774424 £10.00 Buy Now
  • 0800774424 £10.00 Buy Now
  • 0800774424 £10.00 Buy Now

the code that controls this
$featured_str  = '';
$featured_str  .= '<table width="280" border="0" cellspacing="0" cellpadding="0">' . "\n";
$featured_str  .= '  <tr>' . "\n";
$featured_str  .= '    <td width="6">' . tep_image(DIR_WS_TEMPLATE_IMAGES . 'mainpage_left.png') . '</td>' . "\n";
$featured_str  .= '    <td width="110" align="center" style="background:url(' . DIR_WS_TEMPLATE_IMAGES . 'mainpage_mid.png)"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products4_array[$i]['id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $featured_products4_array[$i]['image'], $featured_products4_array[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . "\n";
$featured_str  .= '    <td valign="top" style="background:url(' . DIR_WS_TEMPLATE_IMAGES . 'mainpage_mid.png)"><table width="100%" border="0" cellspacing="0" cellpadding="0">' . "\n";
$featured_str  .= '        <tr>' . "\n";
$featured_str  .= '          <td height="60"><div  class="pageHeading"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products4_array[$i]['id'], 'NONSSL') . '">' . $featured_products4_array[$i]['name'] . '</a></div></td>' . "\n";
$featured_str  .= '        </tr>' . "\n";
$featured_str  .= '        <tr>' . "\n";
$featured_str  .= '          <td height="70" valign="top">' . cre_product_short_description_template($featured_products4_array[$i]['id'], '100') . '</td>' . "\n";
$featured_str  .= '        </tr>' . "\n";
$featured_str  .= '        <tr>' . "\n";
$featured_str  .= '          <td>' . tep_image(DIR_WS_TEMPLATE_IMAGES . 'h-dots.png') . '</td>' . "\n";
$featured_str  .= '        </tr>' . "\n";
$featured_str  .= '        <tr>' . "\n";
$featured_str  .= '          <td><table width="158" border="0" cellspacing="0" cellpadding="0">' . "\n";
$featured_str  .= '              <tr>' . "\n";
$featured_str  .= '                <td width="69" align="center" class="price_mainpage">' . $products_price . '</td>' . "\n";
$featured_str  .= '                <td width="1" align="center">' . tep_image(DIR_WS_TEMPLATE_IMAGES . 'gray-div.png') . '</td>' . "\n";
$featured_str  .= '                <td width="88" align="center"><a href="' . tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action','products_id')) . 'action=buy_now&products_id=' . $featured_products4_array[$i]['id']) . '">' . tep_image(DIR_WS_TEMPLATE_IMAGES . 'buy-now.png') . '</a></td>' . "\n";
$featured_str  .= '              </tr>' . "\n";
$featured_str  .= '            </table></td>' . "\n";
$featured_str  .= '        </tr>' . "\n";
$featured_str  .= '      </table></td>' . "\n";
$featured_str  .= '    <td width="6" align="right">' . tep_image(DIR_WS_TEMPLATE_IMAGES . 'mainpage_right.png') . '</td>' . "\n";
$featured_str  .= '  </tr>' . "\n";
$featured_str  .= '</table>' . "\n";

Im not the best at coding and its not helping being new to creloaded, id appreciate it if someone could take a quick look and just point me in the right direction.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users