Custom field value in onBeforeCalculateProductPriceForQuantity handler

  • Posts: 29
  • Thank you received: 2
1 year 11 months 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 year 11 months ago by pjdevries.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
1 year 11 months 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 year 11 months ago by nicolas.

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

  • Posts: 29
  • Thank you received: 2
1 year 11 months 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.059 seconds
Powered by Kunena Forum