ShaunB Posted August 18, 2010 Posted August 18, 2010 Hello, I have been trying to kind some code to edit that would let me display each product on a row instead of the columns or 2 products per row. Any suggestions? The store url: http://www.crimsontracelaser.com example of what I want it to look like: http://www.crimsontrace.com/Home/Products/1911/tabid/185/Default.aspx I guess I could just do Categories and list them as 1 per row but I would think there is a way to change the layout of the listings somewhere? Thank You
FIMBLE Posted August 18, 2010 Posted August 18, 2010 I have attached a file to start you off, you will need to edit it further to get it looking like you want, but it displays in rows as requested, if its no good then bin it, it is only a file i was playing with ages ago NIc new_products.php Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
Guest Posted August 18, 2010 Posted August 18, 2010 Shaun, It is unlikely the attached file will work with your template. IF the template creator used standard structure for the template then there should be an area under product listing in the admin to change the number of columns and rows displayed. If he/she did not use standard structure then you will have to edit the product info page to remove one column. HOPEFULLY, there are configuration settings in the admin for you. Chris
ShaunB Posted August 18, 2010 Author Posted August 18, 2010 Thank You, I am afraid the creator must not have done this or I might just be looking in the wrong area. Any suggestions on how to remove the other column manually through the code? <?php /* $Id: product_listing.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <?php echo tep_draw_title_top();?> <?php echo $breadcrumb->trail(' » ')?> <?php echo tep_draw_title_bottom();?> <?php echo tep_draw3_top();?> <?php $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <?php echo tep_draw_result1_top(); ?> <table border="0" cellspacing="0" cellpadding="0" class="result result_top_padd"> <tr> <td><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="result_right" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php echo tep_draw_result1_bottom(); ?> <?php } $info_box_contents = array(); $list_box_contents = array(); $my_row = 0; $my_col = 0; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_text = TABLE_HEADING_MODEL; $lc_align = ''; break; case 'PRODUCT_LIST_NAME': $lc_text = TABLE_HEADING_PRODUCTS; $lc_align = ''; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_text = TABLE_HEADING_MANUFACTURER; $lc_align = ''; break; case 'PRODUCT_LIST_PRICE': $lc_text = TABLE_HEADING_PRICE; $lc_align = 'right'; break; case 'PRODUCT_LIST_QUANTITY': $lc_text = TABLE_HEADING_QUANTITY; $lc_align = 'right'; break; case 'PRODUCT_LIST_WEIGHT': $lc_text = TABLE_HEADING_WEIGHT; $lc_align = 'right'; break; case 'PRODUCT_LIST_IMAGE': $lc_text = TABLE_HEADING_IMAGE; $lc_align = 'center'; break; case 'PRODUCT_LIST_BUY_NOW': $lc_text = TABLE_HEADING_BUY_NOW; $lc_align = 'center'; break; } if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) { $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text); } $list_box_contents[0][] = array('align' => $lc_align, 'params' => 'class="productListing-heading"', 'text' => ' ' . $lc_text . ' '); } if ($listing_split->number_of_rows > 0) { $rows = 0; $listing_query = tep_db_query($listing_split->sql_query); while ($listing = tep_db_fetch_array($listing_query)) { $rows++; if (($rows/2) == floor($rows/2)) { $list_box_contents[] = array('params' => 'class="productListing-even"'); } else { $list_box_contents[] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($list_box_contents) - 1; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = ''; $p_model = '<tr> <td><b><font>'.TABLE_HEADING_MODEL.' :</font></b></td> <td align="right"><font>' . $listing['products_model'] . '</font></td> </tr>'; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $p_name = $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; } else { $p_name = $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; } break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; $p_manufact = '<tr> <td><b><font>'.TABLE_HEADING_MANUFACTURER.' :</font></b></td> <td align="right"><font><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a></font></td> </tr>'; break; case 'PRODUCT_LIST_PRICE': $lc_align = 'right'; if (tep_not_null($listing['specials_new_products_price'])) { $p_price = $lc_text = '<div style="float:left;"><span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span></div><div style="float:left;"><s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s></div> '; } else { $p_price = $lc_text = '<span class="productSpecialPrice">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>'; } break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $p_qty = '<tr> <td><b><font>'.TABLE_HEADING_QUANTITY.' :</font></b></td> <td align="right"><font>' . $listing['products_quantity'] . '</font></td> </tr>'; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $p_weight = '<tr> <td><b><font>'.TABLE_HEADING_WEIGHT.' :</font></b></td> <td align="right"><font>' . $listing['products_weight'] . '</font></td> </tr>'; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; } else { $p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; } break; case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $p_button = $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now1.gif', IMAGE_BUTTON_BUY_NOW) . '</a>'; break; } $product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$listing['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); $p_desc = substr(strip_tags($product['products_description']), 0, MAX_DESCR_1).'...<br>'; if (PRODUCT_LIST_MODEL != 0 || PRODUCT_LIST_MANUFACTURER != 0 || PRODUCT_LIST_QUANTITY != 0 || PRODUCT_LIST_WEIGHT != 0) { $p_listing = '<table cellpadding="0" cellspacing="0" border="0" class="listing">'.$p_model.''.$p_manufact.'' . ''.$p_qty.'' . ''.$p_weight.'</table>'; } $p_id = $product['products_id']; /* $list_box_contents[$cur_row][] = array('align' => $lc_align, 'params' => '', 'text' => $lc_text); */ } $p_details = '<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button('button_details.gif', '', ' class="btn1"').'</a>'; $p_buy_now = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif', '', ' class="btn1"').'</a>'; $info_box_contents[$my_row][$my_col] = array('align' => 'center', 'params' => ' style="width:50%;"', 'text' => ''.tep_draw_prod2_top().' <table cellpadding="0" cellspacing="0" border="0"> <tr><td class="name name2_padd">'.$p_name.'</td></tr> <tr><td class="pic2_padd">'.tep_draw_prod_pic_top().''.$p_pic.''.tep_draw_prod_pic_bottom().'</td></tr> <tr><td class="desc desc2_padd">'.$p_desc.'</td></tr> <tr><td class="listing2_padd">'.$p_listing.'</td></tr> <tr><td style="padding:0px 0px 9px 0px;"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="button2_padd">'.$p_details.'</td> </tr> <tr> <td class="button_marg">'.$p_buy_now.'</td> </tr> </table> </td></tr> </table> '.tep_draw_prod2_bottom().''); $my_col ++; if ($my_col > 1) { $my_col = 0; $my_row ++; } } new contentBox($info_box_contents); // new productListingBox($list_box_contents); } else { ?> <?php /* echo tep_draw1_top(); */ ?> <table cellpadding="0" cellspacing="0" class="main"> <tr><td><?php echo TEXT_NO_PRODUCTS ?></td></tr> </table> <?php /* echo tep_draw1_bottom(); */ ?> <?php } if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <?php echo tep_draw_result2_top(); ?> <table border="0" cellspacing="0" cellpadding="0" class="result result_bottom_padd"> <tr> <td><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="result_right" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php echo tep_draw_result2_bottom(); ?> <?php } ?>
FIMBLE Posted August 18, 2010 Posted August 18, 2010 You can try this. Nic <?php /* $Id: product_listing.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <?php echo tep_draw_title_top();?> <?php echo $breadcrumb->trail(' » ')?> <?php echo tep_draw_title_bottom();?> <?php echo tep_draw3_top();?> <?php $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <?php echo tep_draw_result1_top(); ?> <table border="0" cellspacing="0" cellpadding="0" class="result result_top_padd"> <tr> <td><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="result_right" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php echo tep_draw_result1_bottom(); ?> <?php } $info_box_contents = array(); $list_box_contents = array(); $my_row = 0; $my_col = 0; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_text = TABLE_HEADING_MODEL; $lc_align = ''; break; case 'PRODUCT_LIST_NAME': $lc_text = TABLE_HEADING_PRODUCTS; $lc_align = ''; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_text = TABLE_HEADING_MANUFACTURER; $lc_align = ''; break; case 'PRODUCT_LIST_PRICE': $lc_text = TABLE_HEADING_PRICE; $lc_align = 'right'; break; case 'PRODUCT_LIST_QUANTITY': $lc_text = TABLE_HEADING_QUANTITY; $lc_align = 'right'; break; case 'PRODUCT_LIST_WEIGHT': $lc_text = TABLE_HEADING_WEIGHT; $lc_align = 'right'; break; case 'PRODUCT_LIST_IMAGE': $lc_text = TABLE_HEADING_IMAGE; $lc_align = 'center'; break; case 'PRODUCT_LIST_BUY_NOW': $lc_text = TABLE_HEADING_BUY_NOW; $lc_align = 'center'; break; } if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) { $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text); } $list_box_contents[0][] = array('align' => $lc_align, 'params' => 'class="productListing-heading"', 'text' => ' ' . $lc_text . ' '); } if ($listing_split->number_of_rows > 0) { $rows = 0; $listing_query = tep_db_query($listing_split->sql_query); while ($listing = tep_db_fetch_array($listing_query)) { $rows++; if (($rows/2) == floor($rows/2)) { $list_box_contents[] = array('params' => 'class="productListing-even"'); } else { $list_box_contents[] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($list_box_contents) - 1; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = ''; $p_model = '<tr> <td><b><font>'.TABLE_HEADING_MODEL.' :</font></b></td> <td align="right"><font>' . $listing['products_model'] . '</font></td> </tr>'; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $p_name = $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; } else { $p_name = $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; } break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; $p_manufact = '<tr> <td><b><font>'.TABLE_HEADING_MANUFACTURER.' :</font></b></td> <td align="right"><font><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a></font></td> </tr>'; break; case 'PRODUCT_LIST_PRICE': $lc_align = 'right'; if (tep_not_null($listing['specials_new_products_price'])) { $p_price = $lc_text = '<div style="float:left;"><span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span></div><div style="float:left;"><s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s></div> '; } else { $p_price = $lc_text = '<span class="productSpecialPrice">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>'; } break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $p_qty = '<tr> <td><b><font>'.TABLE_HEADING_QUANTITY.' :</font></b></td> <td align="right"><font>' . $listing['products_quantity'] . '</font></td> </tr>'; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $p_weight = '<tr> <td><b><font>'.TABLE_HEADING_WEIGHT.' :</font></b></td> <td align="right"><font>' . $listing['products_weight'] . '</font></td> </tr>'; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; } else { $p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; } break; case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $p_button = $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now1.gif', IMAGE_BUTTON_BUY_NOW) . '</a>'; break; } $product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$listing['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); $p_desc = substr(strip_tags($product['products_description']), 0, MAX_DESCR_1).'...<br>'; if (PRODUCT_LIST_MODEL != 0 || PRODUCT_LIST_MANUFACTURER != 0 || PRODUCT_LIST_QUANTITY != 0 || PRODUCT_LIST_WEIGHT != 0) { $p_listing = '<table cellpadding="0" cellspacing="0" border="0" class="listing">'.$p_model.''.$p_manufact.'' . ''.$p_qty.'' . ''.$p_weight.'</table>'; } $p_id = $product['products_id']; /* $list_box_contents[$cur_row][] = array('align' => $lc_align, 'params' => '', 'text' => $lc_text); */ } $p_details = '<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button('button_details.gif', '', ' class="btn1"').'</a>'; $p_buy_now = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif', '', ' class="btn1"').'</a>'; $info_box_contents[$my_row][$my_col] = array('align' => 'center', 'params' => ' style="width:100%;"', 'text' => ''.tep_draw_prod2_top().' <table cellpadding="0" cellspacing="0" border="0"> <tr><td class="name name2_padd">'.$p_name.'</td></tr> <tr><td class="pic2_padd">'.tep_draw_prod_pic_top().''.$p_pic.''.tep_draw_prod_pic_bottom().'</td></tr> <tr><td class="desc desc2_padd">'.$p_desc.'</td></tr> <tr><td class="listing2_padd">'.$p_listing.'</td></tr> <tr><td style="padding:0px 0px 9px 0px;"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="button2_padd">'.$p_details.'</td> </tr> <tr> <td class="button_marg">'.$p_buy_now.'</td> </tr> </table> </td></tr> </table> '.tep_draw_prod2_bottom().''); $my_col ++; if ($my_col > 0) { $my_col = 0; $my_row ++; } } new contentBox($info_box_contents); // new productListingBox($list_box_contents); } else { ?> <?php /* echo tep_draw1_top(); */ ?> <table cellpadding="0" cellspacing="0" class="main"> <tr><td><?php echo TEXT_NO_PRODUCTS ?></td></tr> </table> <?php /* echo tep_draw1_bottom(); */ ?> <?php } if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <?php echo tep_draw_result2_top(); ?> <table border="0" cellspacing="0" cellpadding="0" class="result result_bottom_padd"> <tr> <td><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="result_right" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php echo tep_draw_result2_bottom(); ?> <?php } ?> Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
FIMBLE Posted August 18, 2010 Posted August 18, 2010 You will also need to play with the table tags in this code <table cellpadding="0" cellspacing="0" border="0"> <tr><td class="name name2_padd">'.$p_name.'</td></tr> <tr><td class="pic2_padd">'.tep_draw_prod_pic_top().''.$p_pic.''.tep_draw_prod_pic_bottom().'</td></tr> <tr><td class="desc desc2_padd">'.$p_desc.'</td></tr> <tr><td class="listing2_padd">'.$p_listing.'</td></tr> <tr><td style="padding:0px 0px 9px 0px;"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="button2_padd">'.$p_details.'</td> </tr> <tr> <td class="button_marg">'.$p_buy_now.'</td> </tr> </table> </td></tr> </table> To actually get it in the correct format, if you need help give us a shout. Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
ShaunB Posted August 18, 2010 Author Posted August 18, 2010 On the code above I got a syntax error: Parse error: syntax error, unexpected '}' Is there a way to copy from this forum and keep the formatting? When I paste into Notepad++ it puts everything on one line.
FIMBLE Posted August 18, 2010 Posted August 18, 2010 i have attached the file for you Nic product_listing.php Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
ShaunB Posted August 19, 2010 Author Posted August 19, 2010 i have attached the file for you Nic that worked, thank you...now I just need to adjust the layout.
FIMBLE Posted August 19, 2010 Posted August 19, 2010 Yes, thats just a case of addingd rowspans and colspans etc.. Glad it worked Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
ShaunB Posted August 19, 2010 Author Posted August 19, 2010 Please have a look at my code, I got the layout pretty close to what I want but the product images are staggering as they go down and I can't find why the product name is being sent to a second line instead of being one long line. THANK YOU! here is a link to the products: http://www.crimsontracelaser.com/1911-c-15.html $p_details = '<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button('button_details.gif', '', ' class="btn1"').'</a>'; $p_buy_now = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif', '', ' class="btn1"').'</a>'; $info_box_contents[$my_row][$my_col] = array('align' => 'center', 'params' => ' style="width:100%;"', 'text' => ''.tep_draw_prod2_top().' <table cellpadding="0" cellspacing="0" border="0"> <tr><td class="name name2_padd">'.$p_name.'</td></tr> <tr><td class="pic2_padd">'.tep_draw_prod_pic_top().''.$p_pic.''.tep_draw_prod_pic_bottom().'</td> <td class="desc desc2_padd">'.$p_desc.'<br /><br /> '.$p_listing.' <table cellpadding="0" cellspacing="10" border="0"> <td align="left" >'.$p_details.'</td> <td align="right" class="button_marg">'.$p_buy_now.' </td> </table> </td></tr> </table> '.tep_draw_prod2_bottom().''); $my_col ++; if ($my_col > 0) { $my_col = 0; $my_row ++; } }
ShaunB Posted August 19, 2010 Author Posted August 19, 2010 well I was able to fix one issue but it is still messing with the images and the margins between the image and the description. any help? also is there away to adjust how many letters are aloud before trunciating the description? here is the current code: $info_box_contents[$my_row][$my_col] = array('align' => 'center', 'params' => ' style="width:100%;"', 'text' => ''.tep_draw_prod2_top().' <table cellpadding="0" cellspacing="0" border="0"> <tr><td class="pic2_padd">'.tep_draw_prod_pic_top().''.$p_pic.''.tep_draw_prod_pic_bottom().'</td> <td class="desc desc2_padd"> <td class="name name2_padd">'.$p_name.' <br /> '.$p_desc.' <br /> '.$p_listing.' <table cellpadding="0" cellspacing="10" border="0"> <tr> <td align="left" >'.$p_details.'</td> <td align="right" class="button_marg">'.$p_buy_now.' </td></td> </tr> </table> </td></tr> </table> '.tep_draw_prod2_bottom().''); $my_col ++; if ($my_col > 0) { $my_col = 0; $my_row ++; } }
FIMBLE Posted August 19, 2010 Posted August 19, 2010 looks like the description is controlled by a database entry MAX_DESCR_1 the caps indicates this anyhow, not sure where in the admin it could be thought without viewing the DB, have a search of your admin for it The logical place would be admin / configuration / Product listing Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
ShaunB Posted August 19, 2010 Author Posted August 19, 2010 looks like the description is controlled by a database entry MAX_DESCR_1 the caps indicates this anyhow, not sure where in the admin it could be thought without viewing the DB, have a search of your admin for it The logical place would be admin / configuration / Product listing Nic thank you, I will try looking for that. any suggestions on why the images are not uniform or inline with each other?
FIMBLE Posted August 19, 2010 Posted August 19, 2010 possibly you need to add width and height attributes to make it uniform Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
Recommended Posts
Archived
This topic is now archived and is closed to further replies.