← All changes
|
modules/frequently-bought-together/templates/frontend-widget.php
+2
-1
3.2.0
→
3.3.0
View file →
| @@ -8,8 +8,9 @@ | ||
| 8 | 8 | * |
| 9 | 9 | * @package cartflows |
| 10 | 10 | * @var array<int, WC_Product> $products Companion products, stock-filtered by the caller. |
| 11 | 11 | * @var array{enabled: string, source: string, product_ids: array<int, int>, add_separately: string, selection: string, position: string, custom_qty: string, product_qty: array<int, int>, ai_product_ids: array<int, int>} $fbt_settings Full FBT settings blob. |
| 12 | + * @var int $fbt_product_id Source product ID supplied by the renderer. | |
| 12 | 13 | */ |
| 13 | 14 | |
| 14 | 15 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | 16 | exit; |
| @@ -19,9 +20,9 @@ | ||
| 19 | 20 | return; |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | 23 | $fbt_frontend = Cartflows_Fbt_Frontend::get_instance(); |
| 23 | -$fbt_source = wc_get_product( get_the_ID() ); | |
| 24 | +$fbt_source = wc_get_product( ! empty( $fbt_product_id ) ? (int) $fbt_product_id : (int) get_the_ID() ); | |
| 24 | 25 | $fbt_source_id = $fbt_source ? (int) $fbt_source->get_id() : 0; |
| 25 | 26 | $fbt_source_price = $fbt_source ? (float) wc_get_price_to_display( $fbt_source ) : 0.0; |
| 26 | 27 | $fbt_show_qty = 'yes' === $fbt_settings['custom_qty']; |
| 27 | 28 | $fbt_qty_map = $fbt_settings['product_qty']; |