Custom Fields

  • Posts: 61
  • Thank you received: 0
11 years 8 months ago #133961

There are 2 scenarios I would like to create a custom field for right now.

Firstly I would like to have the user be able to type a name to be engraved on a trophy. As they type the name I would like the price to increase or decrease depending on how many characters are typed. So lets say the product costs $10 and each character they type costs 10 cent.

Secondly I would like to allow a user to upload an image for the product they are purchasing. Lets say its a T-Shirt with 3 size variants. I want the user to be able to upload an image for each size they select.

Thanks in advance.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 8 months ago #133980

Hi,
For both custom field you'll have to create custom fields with the table option set to Item :
1. For your first custom field, if you want to change your product price regarding the number of character that your customer have set for your custom field, you'll have to use some code customization but that won't be that easy and some developer skills will be required.

Note that you can use characteristics to set a "character range" selection.

2. For your second field, you'll just have to set the Field type to File.

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

  • Posts: 61
  • Thank you received: 0
11 years 7 months ago #134643

When the user uploads the image where is it stored? i checked the order page and I haven't seen it there.

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

  • Posts: 84142
  • Thank you received: 13647
  • MODERATOR
11 years 7 months ago #134678

It is stored in media/com_hikashop/upload/safe
A link to it is available next to the product name on the order edition page and in the emails provided that you turned on the "backend listing" option of the custom item field.

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

  • Posts: 61
  • Thank you received: 0
11 years 7 months ago #134703

Is there a way to make this pic clickable?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #134796

Hi,

Yes it's possible I guess. But where do you want to make it clickable ?

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

  • Posts: 61
  • Thank you received: 0
11 years 7 months ago #134799

I want to be able to click the image so I can view it larger or download it.
Currently I have to right click and select view image in order to download it.

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

  • Posts: 84142
  • Thank you received: 13647
  • MODERATOR
11 years 7 months ago #134869

When you right click on it you can directly download it. No need to select view image.

Nevertheless, if you really want to make it clickable, you'll have to change the line:
return '<img class="'.$class.'" src="'.hikashop_completeLink('order&task=download&field_table='.$field->field_table.'&field_namekey='.urlencode(base64_encode($field->field_namekey)).'&name='.urlencode(base64_encode($value))).'" alt="'.htmlspecialchars($value, ENT_COMPAT, 'UTF-8').'" />';
of the file administrator/components/com_hikashop/classes/field.php

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

Time to create page: 0.071 seconds
Powered by Kunena Forum