Characteristics selection method Radio button

  • Posts: 59
  • Thank you received: 0
10 years 4 months ago #200440

-- HikaShop version -- : 4.2
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.2

Hi,

I can't find a way to edit this piece of code in product page, section characteristic (those are t-shirt sizes).

<table class="hikashop_product_characteristics_table"><tbody><tr><td>Taglia</td><td><div class="controls">
	<label for="hikashop_product_characteristic_13" id="hikashop_product_characteristic_13-lbl" class="radio">
	
	<input type="radio" name="hikashop_product_characteristic[1]" id="hikashop_product_characteristic_13" value="3" checked="checked" class="inputbox" size="1" onclick="return hikashopUpdateVariant(this);">XS
	</label>
	<label for="hikashop_product_characteristic_12" id="hikashop_product_characteristic_12-lbl" class="radio">
	
	<input type="radio" name="hikashop_product_characteristic[1]" id="hikashop_product_characteristic_12" value="2" class="inputbox" size="1" onclick="return hikashopUpdateVariant(this);">S
	</label>
	<label for="hikashop_product_characteristic_14" id="hikashop_product_characteristic_14-lbl" class="radio">
	
	<input type="radio" name="hikashop_product_characteristic[1]" id="hikashop_product_characteristic_14" value="4" class="inputbox" size="1" onclick="return hikashopUpdateVariant(this);">M
	</label>
	<label for="hikashop_product_characteristic_15" id="hikashop_product_characteristic_15-lbl" class="radio">
	
	<input type="radio" name="hikashop_product_characteristic[1]" id="hikashop_product_characteristic_15" value="5" class="inputbox" size="1" onclick="return hikashopUpdateVariant(this);">L
	</label>
	<label for="hikashop_product_characteristic_16" id="hikashop_product_characteristic_16-lbl" class="radio">
	
	<input type="radio" name="hikashop_product_characteristic[1]" id="hikashop_product_characteristic_16" value="6" class="inputbox" size="1" onclick="return hikashopUpdateVariant(this);">XL
	</label>
</div>
</td></tr></tbody></table>

Specifically I need to change the render code order for "input" and "label" tags.

Now code is like this:
<label for="hikashop_product_characteristic_15" id="hikashop_product_characteristic_15-lbl" class="radio">
	
	<input type="radio" name="hikashop_product_characteristic[1]" id="hikashop_product_characteristic_15" value="5" class="inputbox" size="1" onclick="return hikashopUpdateVariant(this);">L
	</label>

I need to have render code like this:
<input type="radio" name="hikashop_product_characteristic[1]" id="hikashop_product_characteristic_15" value="5" class="inputbox myclass" size="1" onclick="return hikashopUpdateVariant(this);">
<label for="hikashop_product_characteristic_15 myclass" id="hikashop_product_characteristic_15-lbl" class="radio">
L</label>

Do you have any suggestion about where to do it?
I found almost it in characteristic.php but don't really know if is the right file to do what I need.

Thanks for all your help

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 4 months ago #200480

Hi,

See: www.hikashop.com/forum/product-category-...hikashop-please.html

Regards,

PS : I think you wanted to write HikaShop 2.4 ; and not HikaShop 4.2 (which does not exist yet)


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 4 months ago #200502

Hi,

It's not HikaShop which displays these pieces of HTML, it's actually Joomla.
In the file administrator/components/com_hikashop/types/characteristic.php you can see this line:

$html = JHTML::_('select.'.$characteristic_display.'list',   $this->values, $map, 'class="inputbox" size="1"' . $this->options, 'value', 'text', (int)$value,$id );
That's the line which calls joomla for the display of these radios.
If you wanted to change there display, you would have to modify the core files of Joomla doing the display of radios everywhere on your website.

The following user(s) said Thank You: simonev

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

  • Posts: 59
  • Thank you received: 0
10 years 4 months ago #200576

Thanks for your answer, I made some css tricks to do what I wanted so I didn't change joomla core files.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum