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.