← All changes
|
app/Hooks/Handlers/BlockEditors/Checkout/InnerBlocks/InnerBlocks.php
+11
-0
1.5.3
→
1.7.1
View file →
| @@ -698,13 +698,15 @@ | ||
| 698 | 698 | 'class' => 'fct_checkout_payment_methods', |
| 699 | 699 | 'data-fluent-cart-checkout-payment-methods' => '' |
| 700 | 700 | ]); |
| 701 | 701 | ob_start(); ?> |
| 702 | + <?php do_action('fluent_cart/before_payment_methods', ['cart' => $cart]); ?> | |
| 702 | 703 | <div <?php echo $atts; ?>> |
| 703 | 704 | <?php |
| 704 | 705 | (new CheckoutRenderer($cart))->renderPaymentMethods(); |
| 705 | 706 | ?> |
| 706 | 707 | </div> |
| 708 | + <?php do_action('fluent_cart/after_payment_methods', ['cart' => $cart]); ?> | |
| 707 | 709 | <?php |
| 708 | 710 | return ob_get_clean(); |
| 709 | 711 | } |
| 710 | 712 | |
| @@ -971,8 +973,17 @@ | ||
| 971 | 973 | $cart = $this->getCart(); |
| 972 | 974 | if (empty(Arr::get($cart, 'cart_data', []))) { |
| 973 | 975 | return ''; |
| 974 | 976 | } |
| 977 | + | |
| 978 | + // A cart bound to an existing payment (custom payment link, renewal invoice, early | |
| 979 | + // installment) or already carrying an upgrade cannot take new items — the | |
| 980 | + // apply_order_bump handler refuses it, so rendering the bump would only offer a | |
| 981 | + // control that fails. Same predicate on both sides so they cannot drift. | |
| 982 | + if (!$cart->acceptsAdditionalItems()) { | |
| 983 | + return ''; | |
| 984 | + } | |
| 985 | + | |
| 975 | 986 | $atts = get_block_wrapper_attributes(); |
| 976 | 987 | $title = Arr::get($attributes, 'section_title'); |
| 977 | 988 | ob_start(); |
| 978 | 989 | ?> |