- Posts: 7
- Thank you received: 1
Product custom fields
11 years 2 weeks ago #214663
by estmorph
Product custom fields was created by estmorph
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
Hi,
with product characteristics, is it possible to do the following?
For the sale of cabinets of custom sizes, I need the user to be able to enter desired width value.
Once the user enters the width he desires, this width needs to be checked against min and max possible width for this product. Then given the desired width, a weight for the product is passed to the cart checked against range of widths. For example:
A cabinet can have width min 300mm and max 600mm.
A customers enters the value for the width he wants in the product page, lets say 450mm.
Now hikashop should check that it is within the min-max width allowed, and then calculate the weight of the product based on: for width 300-400 weight is 28kg, from 401-600 weight is 38kg.
I hope this makes sense.
-- Joomla version -- : 3.4.3
Hi,
with product characteristics, is it possible to do the following?
For the sale of cabinets of custom sizes, I need the user to be able to enter desired width value.
Once the user enters the width he desires, this width needs to be checked against min and max possible width for this product. Then given the desired width, a weight for the product is passed to the cart checked against range of widths. For example:
A cabinet can have width min 300mm and max 600mm.
A customers enters the value for the width he wants in the product page, lets say 450mm.
Now hikashop should check that it is within the min-max width allowed, and then calculate the weight of the product based on: for width 300-400 weight is 28kg, from 401-600 weight is 38kg.
I hope this makes sense.
Please Log in or Create an account to join the conversation.
11 years 2 weeks ago #214696
by nicolas
Replied by nicolas on topic Product custom fields
Hi,
Characteristics are displayed as radios or dropdowns on the product page. So the customer has to select among a set of defined values. It won't be practical to setup.
I suppose that what you're looking for is to create instead a custom field of the table "item" via the menu Display>Views so that the customer can enter the width value himself on the product page.
For the min-max width, you can use the "regular expression check" option of the custom item field.
Finally, with a custom hikashop shipping plugin to do the weight calculation instead of the standard one, that's not a problem to have the weight of the product depending on the value entered by the customer.
Characteristics are displayed as radios or dropdowns on the product page. So the customer has to select among a set of defined values. It won't be practical to setup.
I suppose that what you're looking for is to create instead a custom field of the table "item" via the menu Display>Views so that the customer can enter the width value himself on the product page.
For the min-max width, you can use the "regular expression check" option of the custom item field.
Finally, with a custom hikashop shipping plugin to do the weight calculation instead of the standard one, that's not a problem to have the weight of the product depending on the value entered by the customer.
Please Log in or Create an account to join the conversation.
11 years 2 weeks ago #214714
by estmorph
Replied by estmorph on topic Product custom fields
Thanks for the reply,
so I create custom fields under Display->Custom Fields which will apply to a certain category. I will need to come up with the expression checks though. I mean, it will need to check against other product characteristics.
Is there any documentation on how to create these expressions?
Are there any examples on validation rules and writing expressions? This will help me as I have never done this before.
This is my first attempt at hikashop.
thanks
so I create custom fields under Display->Custom Fields which will apply to a certain category. I will need to come up with the expression checks though. I mean, it will need to check against other product characteristics.
Is there any documentation on how to create these expressions?
Are there any examples on validation rules and writing expressions? This will help me as I have never done this before.
This is my first attempt at hikashop.
thanks
Please Log in or Create an account to join the conversation.
11 years 2 weeks ago #214814
by nicolas
Replied by nicolas on topic Product custom fields
The regular expression check uses standard regex.
For example, to allow only a value between 300 and 600 you can write this regex:
I you need something dynamic Then it's more complex and will require that you write your own hikashop plugin implementing the fields API :
www.hikashop.com/support/support/documen...entation.html#fields
You can see an example of that with the advanced date picker type plugin in the folder plugins/hikashop/datepickerfield/ of your website.
For example, to allow only a value between 300 and 600 you can write this regex:
Code:
/^([345][0-9][0-9]|600)$/
You can see an example of that with the advanced date picker type plugin in the folder plugins/hikashop/datepickerfield/ of your website.
Please Log in or Create an account to join the conversation.
11 years 1 week ago #215521
by estmorph
Replied by estmorph on topic Product custom fields
Thanks, this worked. Without the /
and I got an understanding of how these regex work.
Now I need to be able to get a price and weight value based on value entered in the custom field. So for example if the customer enters a value between 300-350 then the price will be "$300" and weight "28kg"
I created a new post in the forum for this.
and I got an understanding of how these regex work.
Now I need to be able to get a price and weight value based on value entered in the custom field. So for example if the customer enters a value between 300-350 then the price will be "$300" and weight "28kg"
I created a new post in the forum for this.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 60
- Thank you received: 0
10 years 8 months ago #227005
by fardinfard
Replied by fardinfard on topic Product custom fields
Hi,
I need validation code for telephone field, it just should get digits and not alphabetic character. (I want enter this in Regular expression check field)/
Thanks
I need validation code for telephone field, it just should get digits and not alphabetic character. (I want enter this in Regular expression check field)/
Thanks
Please Log in or Create an account to join the conversation.
10 years 8 months ago #227008
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Product custom fields
Hi,
Please see the Nicolas' message for a sample of regex.
For more about regex
us3.php.net/manual/en/pcre.pattern.php
regex101.com/
regexr.com/
Regards,
Please see the Nicolas' message for a sample of regex.
For more about regex
us3.php.net/manual/en/pcre.pattern.php
regex101.com/
regexr.com/
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.186 seconds