- Posts: 61
- Thank you received: 0
Custom Fields
12 years 10 months ago #133961
by anlicor
Custom Fields was created by anlicor
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.
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.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 10 months ago #133980
by Mohamed Thelji
Replied by Mohamed Thelji on topic Custom Fields
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.
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.
12 years 10 months ago #134643
by anlicor
Replied by anlicor on topic Custom Fields
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.
12 years 10 months ago #134678
by nicolas
Replied by nicolas on topic Custom Fields
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.
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.
12 years 10 months ago #134703
by anlicor
Replied by anlicor on topic Custom Fields
Is there a way to make this pic clickable?
Please Log in or Create an account to join the conversation.
12 years 9 months ago #134796
by Xavier
Replied by Xavier on topic Custom Fields
Hi,
Yes it's possible I guess. But where do you want to make it clickable ?
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.
12 years 9 months ago #134799
by anlicor
Replied by anlicor on topic Custom Fields
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.
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.
12 years 9 months ago #134869
by nicolas
Replied by nicolas on topic Custom Fields
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
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.195 seconds