- Posts: 9
- Thank you received: 0
custom item field dropdown value
- anitaagarwal
-
Topic Author
- Offline
Less
More
12 years 5 months ago #152926
by anitaagarwal
custom item field dropdown value was created by anitaagarwal
-- url of the page with the problem -- :
egrammandi.com/index.php/category/fruits
-- HikaShop version -- : 2.3.0
-- Joomla version -- :2.5.19
-- PHP version -- :5.3.13
-- Browser(s) name and version -- : Firefox
-- Error-message(debug-mod must be tuned on) -- : Error_message
We are using ordered_weight as custom item field to display weight of fruits & vegetables.
Weight is a dropsown field with values (100 gm, 250 gm, 500 gm, 1 Kg, 1.25 Kg, 1.5 Kg, 2 Kg etc). For some fruits, we want to show only values 1 KG, 2 KG, 3 Kg etc , not 100 gm, 200 gm.
Is there any way to do this?
-- HikaShop version -- : 2.3.0
-- Joomla version -- :2.5.19
-- PHP version -- :5.3.13
-- Browser(s) name and version -- : Firefox
-- Error-message(debug-mod must be tuned on) -- : Error_message
We are using ordered_weight as custom item field to display weight of fruits & vegetables.
Weight is a dropsown field with values (100 gm, 250 gm, 500 gm, 1 Kg, 1.25 Kg, 1.5 Kg, 2 Kg etc). For some fruits, we want to show only values 1 KG, 2 KG, 3 Kg etc , not 100 gm, 200 gm.
Is there any way to do this?
Please Log in or Create an account to join the conversation.
12 years 5 months ago #152938
by nicolas
Replied by nicolas on topic custom item field dropdown value
Hi,
You would have to create two custom item fields and restrict them by category so that they only display for one type of products or the other.
Then, you'll probably want to modify the code of the custom price by weight plugin that you're using (I think), to handle either the order_weight field or the other one based on the one which has a value for the current product.
You have that code in the plugin:
Similarily, you could add the support for another one like that:
You would have to create two custom item fields and restrict them by category so that they only display for one type of products or the other.
Then, you'll probably want to modify the code of the custom price by weight plugin that you're using (I think), to handle either the order_weight field or the other one based on the one which has a value for the current product.
You have that code in the plugin:
Code:
if(!empty($product->ordered_weight)){
$quantity = $quantity*$product->ordered_weight;
}
Code:
if(!empty($product->ordered_weight)){
$quantity = $quantity*$product->ordered_weight2;
}
Please Log in or Create an account to join the conversation.
- anitaagarwal
-
Topic Author
- Offline
Less
More
- Posts: 9
- Thank you received: 0
12 years 5 months ago #153056
by anitaagarwal
Replied by anitaagarwal on topic custom item field dropdown value
Thank you very much.
It is working..
It is working..
Please Log in or Create an account to join the conversation.
Time to create page: 0.163 seconds