| @@ -277,9 +277,9 @@ | ||
| 277 | 277 | $couponDiscount = (int) Arr::get($this->cart->cart_data, '0.coupon_discount', 0); |
| 278 | 278 | $subtotalRaw = (int) Arr::get($this->cart->cart_data, '0.subtotal', 0); |
| 279 | 279 | $lineTotalRaw = (int) Arr::get($this->cart->cart_data, '0.line_total', 0); |
| 280 | 280 | $hasCouponDiscount = $couponDiscount > 0 && $lineTotalRaw < $subtotalRaw; |
| 281 | - $media = Arr::get($this->cart->cart_data, '0.featured_media', ''); | |
| 281 | + $media = Helper::productImageOrPlaceholder(Arr::get($this->cart->cart_data, '0.featured_media', '')); | |
| 282 | 282 | |
| 283 | 283 | // Mirror CartItemRenderer's event payload so the shared line-item hooks |
| 284 | 284 | // (e.g. the per-item tax breakdown) also fire in modal checkout. |
| 285 | 285 | $lineItemEventInfo = [ |
| @@ -688,8 +688,23 @@ | ||
| 688 | 688 | // reset() not [0] — array_filter above preserves keys, so key 0 may be gone. |
| 689 | 689 | $firstMethod = reset($activePaymentMethods); |
| 690 | 690 | $selectedPaymentMethod = $firstMethod ? $firstMethod->getMeta('route') : ''; |
| 691 | 691 | } |
| 692 | + | |
| 693 | + /** | |
| 694 | + * The payment method rendered as checked. An add-on that renders its own | |
| 695 | + * selector outside this list (e.g. saved payment methods) returns a route | |
| 696 | + * that is not in the list, so no gateway here is checked — the page then | |
| 697 | + * arrives with the add-on's choice already selected instead of a gateway | |
| 698 | + * being checked first and switched over by JS after load. | |
| 699 | + * | |
| 700 | + * @param string $selectedPaymentMethod | |
| 701 | + * @param array $context ['cart' => Cart, 'payment_methods' => array] | |
| 702 | + */ | |
| 703 | + $selectedPaymentMethod = (string) apply_filters('fluent_cart/checkout/selected_payment_method', $selectedPaymentMethod, [ | |
| 704 | + 'cart' => $this->cart, | |
| 705 | + 'payment_methods' => $activePaymentMethods | |
| 706 | + ]); | |
| 692 | 707 | |
| 693 | 708 | $checkoutMethodStyle = $this->storeSettings->get('checkout_method_style', 'logo'); |
| 694 | 709 | |
| 695 | 710 | ?> |