- Posts: 57
- Thank you received: 4
How to use float on Minimum quantity per order
- rfernandes
-
Topic Author
- Offline
Less
More
11 years 6 months ago #194141
by rfernandes
How to use float on Minimum quantity per order was created by rfernandes
Hi,
I need your help.
I want to change the Minimum quantity per order but the hikashop don't let me do that.
For example, like you can see in this next printscreen the hikashop only let me put the integer values and in my business I need to use float values.
For example, I have products when you can send parts of the product.
One example is that I need do send products with quantities like (0.001, 0.002, 0.003) and not only integers like (1, 2, 3).
But, like we can see in this pictures this don't let me do that.
I have created a plugin and I have something like that:
And in this product page the quantity really appears like I wan't but when i try to add to the cart this don't let me.
For example, if I put 0.2 this round the value to 0 and don't let me to add. But if I put something like 0.5 or 0.6 this round the value to 1 and add to the cart (1), but I don't want (1), I want (0.5).
Can you help me to solve that problem?
Thanks.
I need your help.
I want to change the Minimum quantity per order but the hikashop don't let me do that.
For example, like you can see in this next printscreen the hikashop only let me put the integer values and in my business I need to use float values.
For example, I have products when you can send parts of the product.
One example is that I need do send products with quantities like (0.001, 0.002, 0.003) and not only integers like (1, 2, 3).
But, like we can see in this pictures this don't let me do that.
I have created a plugin and I have something like that:
Code:
if($view->getLayout() == 'show')
{
$view->element->product_min_per_order = 0.05;
}
And in this product page the quantity really appears like I wan't but when i try to add to the cart this don't let me.
For example, if I put 0.2 this round the value to 0 and don't let me to add. But if I put something like 0.5 or 0.6 this round the value to 1 and add to the cart (1), but I don't want (1), I want (0.5).
Can you help me to solve that problem?
Thanks.
Please Log in or Create an account to join the conversation.
11 years 6 months ago #194149
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic How to use float on Minimum quantity per order
Hi,
HikaShop only work with integer quantity for his products.
In the code and in the database, the value will always be an integer, not a float.
Regards,
HikaShop only work with integer quantity for his products.
In the code and in the database, the value will always be an integer, not a float.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- rfernandes
-
Topic Author
- Offline
Less
More
- Posts: 57
- Thank you received: 4
11 years 6 months ago #194276
by rfernandes
Replied by rfernandes on topic How to use float on Minimum quantity per order
Hi,
Ok I understood.
But I really need to transform this integer in a float.
Can you help me please, showing where I need to change the source code and database to put this working with float values?
Thanks.
Ok I understood.
But I really need to transform this integer in a float.
Can you help me please, showing where I need to change the source code and database to put this working with float values?
Thanks.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
11 years 6 months ago #194283
by Mohamed Thelji
Replied by Mohamed Thelji on topic How to use float on Minimum quantity per order
Hello,
A solution can be to use an "item" custom field through your product page instead of the quantity field, and then develop a custom plugin which will multiply the price of your product regarding the value of that field.
A solution can be to use an "item" custom field through your product page instead of the quantity field, and then develop a custom plugin which will multiply the price of your product regarding the value of that field.
Please Log in or Create an account to join the conversation.
- rfernandes
-
Topic Author
- Offline
Less
More
- Posts: 57
- Thank you received: 4
11 years 6 months ago #194467
by rfernandes
Replied by rfernandes on topic How to use float on Minimum quantity per order
Hi, I'm sorry but I don't understood.
Can you explain with some example please?
Thanks
Can you explain with some example please?
Thanks
Please Log in or Create an account to join the conversation.
11 years 6 months ago #194470
by Xavier
Replied by Xavier on topic How to use float on Minimum quantity per order
Hi,
You have to create a custom item field via the menu Display > Custom fields, with the type "text", displayed on frontend, and all the desired settings.
This way on the product page the customer will be able to enter any values, then you have to create a plugin which will get this value and do a calculation like price * the_value to have the final price.
As example you can see how the plugin "custom_price" is working and edit it directly.
Here is the documentation for the custom fields:
www.hikashop.com/support/support/documen...shop-field-form.html
And here the one for the plugins:
www.hikashop.com/support/support/documen...r-documentation.html
You have to create a custom item field via the menu Display > Custom fields, with the type "text", displayed on frontend, and all the desired settings.
This way on the product page the customer will be able to enter any values, then you have to create a plugin which will get this value and do a calculation like price * the_value to have the final price.
As example you can see how the plugin "custom_price" is working and edit it directly.
Here is the documentation for the custom fields:
www.hikashop.com/support/support/documen...shop-field-form.html
And here the one for the plugins:
www.hikashop.com/support/support/documen...r-documentation.html
Please Log in or Create an account to join the conversation.
Time to create page: 0.176 seconds