Hint about Characteristic table

  • Posts: 43
  • Thank you received: 0
7 years 3 months ago #276267

hi,

I would like to see Characteristic (color and size) in a table like this

.

Remark, this example are with S,M,XL size type, but it also have to support 36,38,40....... size type.

Is there any boy there have done it before or have seen a template there have this feature.

If not how hard will it be to do, if any one know.


Thanks in advanced

P.S. I am aware of the characteristic table but here it´s show radio bottons but i can´t see what there are in stock and what there not are.

Attachments:
Last edit: 7 years 3 months ago by apa2014.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 3 months ago #276271

Hi,

With the "characteristic selection method" setting set to "table" you'll indeed get something like that.
And you'll be able to see which ones are in stock and which ones aren't if you have the "Display out of stock products" setting turned off in the HikaShop configuration as only the cells with enough stock will have the radio selector and the variants without stock will have an icon instead showing that the choice is not available.

So as far as I can see, that's exactly what you want.

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

  • Posts: 43
  • Thank you received: 0
7 years 3 months ago #276316

I am agree it s a huge step in the right direction :-)

However there was one thing you mention i do not cant create. you said if Iset the display out of stock to off the system will show and image of the iterms ´there on are in stock. .

But it do not do see that you can see it here www.screencast.com/t/zhYkpyw1

Tried both on and off

Is there an easy way to change the radio buttons to an "css button" with the value insight the the button, in wich file is the table generatet and is it possible to call the value of one (size) of the characteristic table

reagrds

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

  • Posts: 4752
  • Thank you received: 644
  • MODERATOR
7 years 3 months ago #276371

Hello,

What you asking for will required some customization (via override view on the "show_block_characteristic" view.
Of course this will required advanced knowledge on html, php & HikaShop.

The plan is to modify the way is build the table html in order to put the characteristics value instead of radio button.
And for the display finish some Css will be to add in the front-end css file.
from this, 2 solutions :
- You have enough skill and you proceed yourself this customization.
- Or, you contact one of our Partner .

Regard

Last edit: 7 years 3 months ago by Philip.

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

  • Posts: 43
  • Thank you received: 0
7 years 3 months ago #276474

Hi and tanks for your reply

Most of the time it a matter of understanding the php code there are made, hope you have a hint to ensure that i am on the right path.

You mention i will some need customization (via override) in "show_block_characteristic" view where do you mean there need customization here due to i am pritty far the have made in the characteristic.php

I have change the type from radio to btn, and added $value->characteristic_value; in line 153 and to get the default selection to work i need to $value->characteristic_value in the line below, have tried servel ways but not work, have this something to with show_block_characteristic ?

if($this->characteristics[$value->characteristic_parent_id]->default->characteristic_id == $value->characteristic_id && !empty($this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id) && $this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id == $value2->characteristic_id)

My intention was to give $value->characteristic_value it own class, then i can manage the rest in CSS

But if the show_block_characteristic also need some change i might not be on the right path.

Reagrds

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 3 months ago #276502

Hi,

If you know CSS, then you can follow our tutorial here and you should be able to do it on your own:
www.hikashop.com/support/documentation/1...ize-the-display.html

For example, such CSS would do what you want:
.hikashop_product_variant_out_of_stock_span{
background: url(../images/delete2.png) no-repeat;
}
.hikashop_product_variant_out_of_stock{
display: none;
}

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

  • Posts: 43
  • Thank you received: 0
7 years 3 months ago #276683

Hi and thanks for your reply.

Right now is how to set the default. With a name in this line

have made a name2 = ''.$value->characteristic_value;

if($this->characteristics[$value->characteristic_parent_id]->default->characteristic_id == $value->characteristic_id && !empty($this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id) && $this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id == $value2->characteristic_id)

I surpose that is the reason that the first box is with no name and

You can see it her www.screencast.com/t/eWr9sFxAzP

when that is done can 1 made a class for the $name2 and hide the vaule of other classes


Reagrds

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 3 months ago #276695

Hi,

I'm not sure what you mean but the solution I proposed should definitely do what you want.
For example:
monosnap.com/file/mTCzNWu8jtnxMnXppoFITgOr2ie1wG

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

  • Posts: 43
  • Thank you received: 0
7 years 3 months ago #276760

Hmm that´s wird i do not get the delete2.png in my table if a prodouct not are on stock - see image ?

How ever what i want is replace the radio button with a box with the size in as showed eairler.

And as told i am pitty close, just need to inset the $name2 = ''.$value->characteristic_value; in the lines below so it shows the name i the default color/size combination.

if($this->characteristics[$value->characteristic_parent_id]->default->characteristic_id == $value->characteristic_id && !empty($this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id) && $this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id == $value2->characteristic_id)

Have tried some combination with out success

Regards

Attachments:

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 3 months ago #276787

Hi,

You should have that result if you added the CSS code I told you about and you didn't make any change to the code which might break the way it is supposed to work regarding that. Otherwise, please provide a link so that we can check on that.

Regarding your code modification, I don't understand why you're giving the code of that if.
You said that you wanted to " to give $value->characteristic_value it own class".
So if I understand correctly, you want to add $value->characteristic_value in the class of either the span or the input in that line of code:

$radio = "\n\t<span class=\"hikashop_product_characteristic_span".$classspan."\"><input type=\"radio\" class=\"hikashop_product_characteristic".$class."\" name=\"hikashop_product_characteristic\" id=\"hikashop_product_characteristic".$name."\" value=\"".$name."\" ".$this->options;

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

  • Posts: 43
  • Thank you received: 0
7 years 3 months ago #276805

Hi

Here is what my founding are so far.

Have added the line $name2 = ''.$value->characteristic_value;

And added this in $name = '_'.$value->characteristic_id.'_'.$value2->characteristic_id .$name2;

Then i have change the input type from "radio" to "btn"

$radio = "\n\t<span class=\"hikashop_product_characteristic_span".$classspan."\"><input type=\"btn\" class=................

By this i got the reasult as you can see on the image.

As you can see at the image now is show the value of the characteristic (size) inside the btn, however, as you see in the first one there are no characteristic, and i suppose the reason for that there is there are missing the value field in this line.

if($this->characteristics[$value->characteristic_parent_id]->default->characteristic_id == $value->characteristic_id && !empty($this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id) && $this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id == $value2->characteristic_id) {
$radio .= ' checked';

If i am right can is give the $name2 it own class, the by that ajust the btn with css

I know it might not be the classic way but i might works until you come with html table solution as you concider to do

Regards

Attachments:

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 2 months ago #277118

Hi,

I don't think that the modifications you're proposing are adapted to what you want...
As I said, you want to change the line:

$radio = "\n\t<span class=\"hikashop_product_characteristic_span".$classspan."\"><input type=\"radio\" class=\"hikashop_product_characteristic".$class."\" name=\"hikashop_product_characteristic\" id=\"hikashop_product_characteristic".$name."\" value=\"".$name."\" ".$this->options;
For example:
$radio = "\n\t<span class=\"hikashop_product_characteristic_span".$classspan." btn\"><input type=\"radio\" class=\"hikashop_product_characteristic".$class."\" style=\"display:none;\" name=\"hikashop_product_characteristic\" id=\"hikashop_product_characteristic".$name."\" value=\"".$name."\" ".$this->options;
									if($this->characteristics[$value->characteristic_parent_id]->default->characteristic_id == $value->characteristic_id && !empty($this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id) && $this->characteristics[$value2->characteristic_parent_id]->default->characteristic_id == $value2->characteristic_id) {
										$radio .= ' checked';
									}
									$radio .= " />".$value->characteristic_value."</label></span>";
That should do what you want.

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

Time to create page: 0.094 seconds
Powered by Kunena Forum