Custom element add_filter / add_action - $this returns wrong? object

I’m making a custom element for woocommerce checkout (splitting shipping, payment etc.) and having an issue with making fragments refresh. Inside element class I have this functions:

public function add_filters() {
    add_filter('woocommerce_update_order_review_fragments', [$this,'update_order_review_fragments'], 99 );
}
public function update_order_review_fragments( $fragments ) {
	$data = Helpers::get_element_data( $this->post_id, $this->id );
	$fragments['.brxe-woocommerce-shippment'] = \Bricks\Frontend::render_element( $data['element'] );
    return $fragments;
}

$this->id outputs randomized ID different from one on frontend (changes on page refresh) and post_id do nothing.

Hi @Erehr,

as this is custom code, I’ve moved it outside of the Bugs category, as I think Developers category is more suitable for this kind of questions

Additionally, I tried to understand the issue, but I’m still not sure where you have the code and how you call it. For anyone that will help you, it will be good if you post all of the relevant code. That will make solving this easier.

Matej