| @@ -367,16 +367,8 @@ | ||
| 367 | 367 | if ( ! apply_filters( 'rtsb/module/badges/show', true ) ) { |
| 368 | 368 | return; |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | - // Ensure badge data is prepared for the current product. On the normal front end | |
| 372 | - // `the_post` / `rtsb_before_product_template_render` populate it, but those don't | |
| 373 | - // fire for the Product Badges Elementor widget (or Elementor editor), leaving | |
| 374 | - // `all_badges` empty. Cached per product id, so this is idempotent and cheap. | |
| 375 | - if ( empty( $this->all_badges ) ) { | |
| 376 | - $this->wc_setup_product_badge_data(); | |
| 377 | - } | |
| 378 | - | |
| 379 | 371 | $group_classes = [ 'rtsb-group-custom-position' ]; |
| 380 | 372 | |
| 381 | 373 | $group_position = ( $this->options['group_badge_position'] ?? 'top-left' ); |
| 382 | 374 | // group_badge_position. |
| @@ -397,12 +389,8 @@ | ||
| 397 | 389 | public function badges_position() { |
| 398 | 390 | // Single Page Badges Position. |
| 399 | 391 | $product_hook_priority = ( $this->options['product_page_group_hook_priority'] ?? null ); |
| 400 | 392 | |
| 401 | - if ( '' === $product_hook_priority ) { | |
| 402 | - $product_hook_priority = null; | |
| 403 | - } | |
| 404 | - | |
| 405 | 393 | $positions = apply_filters( |
| 406 | 394 | 'rtsb/module/product_page_badges/positions', |
| 407 | 395 | [ |
| 408 | 396 | 'before_add_to_cart' => [ |
| @@ -438,12 +426,8 @@ | ||
| 438 | 426 | add_action( $positions[ $product_page_position ]['hook'], [ $this, 'add_group_badges_for_product' ], isset( $positions[ $product_page_position ]['priority'] ) ? absint( $positions[ $product_page_position ]['priority'] ) : '' ); |
| 439 | 427 | } |
| 440 | 428 | |
| 441 | 429 | $loop_hook_priority = ( $this->options['group_position_hook_priority'] ?? null ); |
| 442 | - | |
| 443 | - if ( '' === $loop_hook_priority ) { | |
| 444 | - $loop_hook_priority = null; | |
| 445 | - } | |
| 446 | 430 | |
| 447 | 431 | // Shop Page/ Any Product Query loop. |
| 448 | 432 | $positions = apply_filters( |
| 449 | 433 | 'rtsb/module/shop_page_badges/positions', |