Hello,
I am trying to set one of my attributes automatically on listing submission. It’s called first_price and it’s not shown to the user at all. What it should do is just to be set to the same value that is price attribute is set to.
I am using this code snippet to set the value:
add_action(
'hivepress/v1/models/listing/create',
function( $object_id, $object ) {
update_post_meta($object_id, 'hp_firstprice', 1000);
},
10,
2
);
It works perfectly fine. However, I need to set it to a specific value provided by user. The listing object ($object) does not have the attribute values at the point when code is executed. Same way, I don’t see them anywhere in the request context.
So the question is, how do I get the price value at the point when this hook is called?
Thank you in advance!