Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to hide <br> in Attributes


peteravu

Recommended Posts

Posted

There is no such HTML tag as </br>.

 

You can try putting \n in there but it may not work. I've had issues with not being able to insert newlines where I want them in some text, and never found a 100% reliable solution.

Posted
<br />....'<br>'    Tried, but not help.

 

 

I can only guess that html is not allowed in the fields of a pull down menu.

 

you could try stripping the <br> out of the currency string before the menu is drawn.

Treasurer MFC

Posted
I can only guess that html is not allowed in the fields of a pull down menu.

 

you could try stripping the <br> out of the currency string before the menu is drawn.

 

How to do that???? It comes from ?symbol_right? in the database. And the rest of the places the currency will show up in many funny ways without the <br>.

Posted
How to do that???? It comes from ?symbol_right? in the database. And the rest of the places the currency will show up in many funny ways without the <br>.

 

 

no no,

 

in product_info you will find this :

 

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

$products_options_array = array();

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

 

if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

}

?>

<tr>

<td class="main" align=center><?php echo $products_options_name['products_options_name'] . ':'; ?>

<?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

 

 

the statement :

 

$currencies->display_price($products_options['options_values_price']......

 

basically formats the price information with symbol_left and right and the like.

 

So you could use a string function that strips any '<br>' out of the string that is returned by the $currencies->display_price function.

Treasurer MFC

Posted
no no,

 

in product_info you will find this :

 

      $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

      while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

        $products_options_array = array();

        $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

        while ($products_options = tep_db_fetch_array($products_options_query)) {

          $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

          if ($products_options['options_values_price'] != '0') {

            $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

          }

        }

 

        if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

          $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

        } else {

          $selected_attribute = false;

        }

?>

            <tr>

            <td class="main" align=center><?php echo $products_options_name['products_options_name'] . ':'; ?>

              <?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

the statement :

 

$currencies->display_price($products_options['options_values_price']......

 

basically formats the price information with symbol_left and right and the like.

 

So you could use a string function that strips any '<br>' out of the string that is returned by the $currencies->display_price function.

 

 

that would strip it out "only" when displaying in an attribute situation because you leave the function in the class "currencies" alone.

Treasurer MFC

Posted
$currencies->display_price($products_options['options_values_price']......

 

basically formats the price information with symbol_left and right and the like.

 

So you could use a string function that strips any '<br>' out of the string that is returned by the $currencies->display_price function.

:huh:

Sorry but I don't know what or how to change???

Posted
any help would be much appreciated!

 

 

you see this code :

 

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

 

 

change it :

 

if ($products_options['options_values_price'] != '0') {

$attribute_price_info = $currencies->display_price ($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id']));

 

********************************************************

strip the <br> out of $attribute_price_info here........

********************************************************

 

$products_options_array[sizeof($products_options_array)-1]['text'] .=

 

' (' . $products_options['price_prefix'] .

 

$attribute_price_info .

 

') ';

}

Treasurer MFC

Posted
you see this code :

 

          if ($products_options['options_values_price'] != '0') {

            $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

          }

change it :

 

if ($products_options['options_values_price'] != '0') {

  $attribute_price_info = $currencies->display_price  ($products_options['options_values_price'],  tep_get_tax_rate($product_info['products_tax_class_id']));

 

********************************************************

strip the <br> out of $attribute_price_info here........

********************************************************

 

$products_options_array[sizeof($products_options_array)-1]['text'] .=

 

' (' . $products_options['price_prefix'] .

 

$attribute_price_info .

 

') ';

          }

 

 

 

for stripping you could use :

 

********************************************************

strip the <br> out of $attribute_price_info here........

 

$attribute_price_info = str_replace ('<br>', '', $attribute_price_info);

 

********************************************************

Treasurer MFC

Archived

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

×
×
  • Create New...