Custom field color

  • Posts: 390
  • Thank you received: 20
  • Hikashop Business
8 years 3 months ago #271075

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2

Im trying to set custom fields (for product) for color. I can do with text field, but then only text is displayed.

I want to achieve something like this:



Just to display color options.

Attachments:

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

  • Posts: 26284
  • Thank you received: 4046
  • MODERATOR
8 years 3 months ago #271076

Hello,

Did you follow that tutorial ?
www.hikashop.com/support/documentation/2...isplay-by-color.html

Regards,


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: 390
  • Thank you received: 20
  • Hikashop Business
8 years 3 months ago #271142

That is for characteristics. I have catalog mode and need custom fields.
I dont need select colors, I need just color selection show.

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

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
8 years 3 months ago #271146

Hello,

If the aim is to only display, I see 2 solutions the better one will be linked with your needs.
1°) If you have to display ALWAYS same colors for several products (or all), you can add divs with specifics color class, something like this :

<div class="red color_icon"></div>
<div class="yellow color_icon"></div>
<div class="green color_icon"></div>
<div class="orange color_icon"></div>

See this tutorial to edit override view files.
And on your front end css, add some Css command to define shape, size, and color of your elements, like :
div.icon {
    height: 20px;
    width: 20 px;
   border-radius: 8px;
}

div.red {
    background-color: red;
}

See this tutorials , to understand how to custom your front end Css.
And for repeat css command for each div colors.

2°) You need to have for each product, different color display, you can keep the first idea BUT you add this directly in product description WITH inline css.

Hope this will help you to achieved what you needs.

Regards

Last edit: 8 years 3 months ago by Philip.

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

  • Posts: 390
  • Thank you received: 20
  • Hikashop Business
8 years 3 months ago #271224

Need to have for each product, different color display.
Second option is not aceptable for average admin. So with custom fields, this is not posible?

Maybe if I can override field value output in block_custom_main?

<span id="hikashop_product_custom_value_60" class="hikashop_product_custom_value">
					white, black			</span>

with
<span id="hikashop_product_custom_value_60" class="hikashop_product_custom_value">
					<span class="white"></span>, <span class="black"></span>				</span>

Last edit: 8 years 3 months ago by mojweb.

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

  • Posts: 84426
  • Thank you received: 13723
  • MODERATOR
8 years 3 months ago #271236

Hi,

I don't see a problem doing that with custom fields.
Create a custom field of the table "product" and of the type "checkbox" and enter the different values like Philip explained.
Then, in each product edition page, you can check the values you want and on the frontend, you'll see the selected values on the product page for each product displayed like you want thanks to the CSS Philip gave.

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

  • Posts: 390
  • Thank you received: 20
  • Hikashop Business
8 years 3 months ago #271362

Dont know why html for field title didnt work, but now is working.

I set checkbox with name color. Then I set values 1,2,3,4... and titles <span class="white color_ico">White</span>.
All other is css magic ;)
Thank you

The following user(s) said Thank You: Jerome

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

Time to create page: 0.082 seconds
Powered by Kunena Forum