Custom field value in onBeforeCalculateProductPriceForQuantity handler

  • Posts: 23
  • Thank you received: 1
1 week 1 day ago #341488

-- HikaShop version -- : 4.4.5
-- Joomla version -- : 4.1
-- PHP version -- : 7.4

Hi,

For testing purposes I created a "Single Dropdown" custom field for table "item". The field shows up nicely in the front end on the product order form. I need the value in an onBeforeCalculateProductPriceForQuantity event handler but the field is not available in the parameter object. What am I doing wrong here?

Last edit: 1 week 1 day ago by pjdevries.

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

  • Posts: 75473
  • Thank you received: 11742
  • MODERATOR
1 week 22 hours ago #341489

Hi,

I'm surprised that it would be the case.
The donation plugin, which is preinstalled with HikaShop Business, actually uses that same event to use the value of a custom item field as price for the product in the cart.
So it does what you're trying to do.
So what that means is that the problem is probably with your code somewhere and not with the principle itself and that you're on the right track.
Now, without being able to check your code, it will be hard to say anything more precise to help you.

Last edit: 1 week 11 hours ago by nicolas.

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

  • Posts: 23
  • Thank you received: 1
1 week 11 hours ago #341496

Hi Nicolas,

Thanks. I'll try to figure out what's going wrong and get back to you if I can't find it.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.055 seconds
Powered by Kunena Forum