Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Name field size?


araferejian

Recommended Posts

Posted

My site is www.rustileearts.com, On the lest column I have a What's new area. Some of my product names get cutoff. Why is that? Any help would be much appreciated.

When you click on the item the full name shows up on the product page.

Posted

Ara,

 

The column width is normally only 125px wide. So, extended text gets truncated.

 

 

 

Chris

Posted

Your template has code that limits the length so it doesn't (possibly) "break" the page format.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Post the code from /includes/boxes/whats_new.php

 

The text will automatically wrap - It doesn't need to be truncated.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

<?php

/*

$Id: whats_new.php,v 1.31 2003/02/10 22:31:09 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {

?>

<!-- whats_new //-->

<tr>

<td class="">

<?php

$random_product['products_name'] = tep_get_products_name($random_product['products_id']);

$random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);

 

new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));

 

if (tep_not_null($random_product['specials_new_products_price'])) {

 

$name_prod = '

<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . substr( $random_product['products_name'],0,MAX_DESCR_NAME_BOX) . '</a></span>

';

 

$whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s>     ';

$whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';

} else {

$whats_new_price = '<span class="productSpecialPrice">'.$currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])).'</span>';

 

$name_prod = '

<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . substr( $random_product['products_name'],0,MAX_DESCR_NAME_BOX) . '</a></span>

';

}

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center ',

'text' => '

<table cellspacing="0" cellpadding="0" align="center" border="0">

<tr><td height="86" align="center">'.tep_draw_prod_top().'

<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'.tep_draw_prod_bottom().'</td></tr>

<tr><td height="42" align="center"><br style="line-height:1px;"><br style="line-height:5px;">

'.$name_prod.'<br><br style="line-height:10px">

'.$whats_new_price.'

</td></tr>

</table>

');

 

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- whats_new_eof //-->

<?php

}

?>

Posted

This code (which containe the length limit code I spoke of):

 

$name_prod = '
<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . substr( $random_product['products_name'],0,MAX_DESCR_NAME_BOX) . '</a></span>';

 

Needs changed to:

 

$name_prod = '
<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a></span>';

 

THE CODE APPEARS IN THE FILE TWICE.

 

Before you go changing anything I should tell you that we can't predict where it will wrap to the next line. It might do it in the middle of a word.

 

BACKUP THE FILE BEFORE YOU CHANGE IT.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Thank you germ. That fixed the problem.

 

Do you know how to fix similar problem in the product description on the main page?

 

I really appreciate all your help.

 

Ara

Posted

The code for that is in /includes/modules/new_products.php

 

But I warn you. If the description is longer than about 236 characters displaying it all will "break" the page format.

 

It will make that particular box longer vertically than the one next to it.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...