custom item field dropdown value

  • Posts: 9
  • Thank you received: 0
11 years 4 months ago #152926

-- 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?

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

  • Posts: 84290
  • Thank you received: 13692
  • MODERATOR
11 years 4 months ago #152938

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:

if(!empty($product->ordered_weight)){
			$quantity = $quantity*$product->ordered_weight;
}
Similarily, you could add the support for another one like that:
if(!empty($product->ordered_weight)){
			$quantity = $quantity*$product->ordered_weight2;
}

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

  • Posts: 9
  • Thank you received: 0
11 years 4 months ago #153056

Thank you very much.

It is working..

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

Time to create page: 0.057 seconds
Powered by Kunena Forum