ascii code

  • Posts: 512
  • Thank you received: 21
  • Hikashop Business
1 week 2 days ago #366237

-- url of the page with the problem -- : www.jouwnaambord.nl
-- HikaShop version -- : 5.1.5
-- Joomla version -- : latest
-- PHP version -- : latest
-- Browser(s) name and version -- : Firefox - latest
-- Error-message(debug-mod must be tuned on) -- : no error

Hi, when i make Characteristics and ad some values in the name i use text ans a ascii code.
When i save the values i see the text right and also i see the ascii code right.
But in the product on the frontpage i see the text right but the ascii code as ascii code.
What to do to see the ascii code on the frontpage right.

Please Log in or Create an account to join the conversation.

  • Posts: 83487
  • Thank you received: 13507
  • MODERATOR
1 week 2 days ago #366240

Hi,

This is handled by Joomla's HTML library for selects.
It comes from the line:

$html .= $options['option.text.toHtml'] ? htmlentities(html_entity_decode($text, ENT_COMPAT, 'UTF-8'), ENT_COMPAT, 'UTF-8') : $text;
in the file libraries/src/HTML/Helpers/Select.php
If you change it to:
$html .= $text;
it will allow for these codes to be displayed in the dropdowns. Note that this will affect all the dropdowns in Joomla.
I'm not sure if it could have consequences elsewhere.
Also, you would have to do the change again each time you update Joomla and this Select.php file is updated by Joomla.

A cleaner way to do it would be to modify the line:
$html = JHTML::_('select.'.$characteristic->characteristic_display_method.'list', $this->values, @$characteristic->characteristic_id, 'class="'.HK_FORM_SELECT_CLASS.'" size="1"' . $options, 'value', 'text', $selected, $id );
to be able to pass that option.text.toHtml option to Joomla in the file product / show_block_characteristic via the menu Display>Views.
However, I'm not sure how to change this code to allow for this.

Please Log in or Create an account to join the conversation.

  • Posts: 512
  • Thank you received: 21
  • Hikashop Business
1 week 1 hour ago #366287

Hi Nicolas,

Thx for your answer.
I think i must fix this another way.
Becouse Joomla! has freqently a update, and change this line every time that will be forget.

Fred

Please Log in or Create an account to join the conversation.

  • Posts: 83487
  • Thank you received: 13507
  • MODERATOR
6 days 20 hours ago #366289

Hi,

So, I've looked into it today. Change the line:

$html = JHTML::_('select.'.$characteristic->characteristic_display_method.'list', $this->values, @$characteristic->characteristic_id, 'class="'.HK_FORM_SELECT_CLASS.'" size="1"' . $options, 'value', 'text', $selected, $id );
to:
				$html = JHTML::_(
					'select.'.$characteristic->characteristic_display_method.'list',
					$this->values,
					@$characteristic->characteristic_id,
					array(
						'list.attr' => 'class="'.HK_FORM_SELECT_CLASS.'" size="1"' . $options,
						'list.select' => $selected,
						'id' => $id,
						'option.text.toHtml' => false,
					),
				);
in the file product / show_block_characteristic via the menu Display>Views and it will allow for HTML entities in the characteristic values.

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum
loading