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.1.0 6.2.1 3.1.1 6.2.2 3.1.2 6.2.3 3.2.0 6.3.0 3.2.1 6.3.0-beta.1 3.2.2 6.3.0-rc.1 3.2.3 6.3.0-rc.2 3.2.4 6.3.1 3.2.5 6.3.2 3.2.6 6.4.0 3.3.0 6.4.0-beta.1 3.3.1 6.4.0-rc.1 3.3.2 6.4.1 3.3.2-rc.1 6.4.2 3.3.3 6.5.0 3.3.4 6.5.0-beta.1 3.3.5 6.5.0-rc.1 3.3.6 6.5.0-rc.2 3.4.0 6.5.1 3.4.0-beta.1 6.5.2 3.4.0-rc.2 6.6.0 3.4.1 6.6.0-beta.1 3.4.2 6.6.0-rc.1 3.4.3 6.6.0-rc.2 3.4.4 6.6.1 3.4.5 6.6.2 3.4.6 6.7.0 3.4.7 6.7.0-beta.1 3.4.8 6.7.0-beta.2 3.5.0 6.7.0-rc.1 3.5.0-beta.1 6.7.1 3.5.0-rc.1 6.8.0 3.5.0-rc.2 6.8.0-beta.1 3.5.1 6.8.0-beta.2 3.5.10 6.8.0-rc.1 3.5.2 6.8.1 3.5.3 6.8.2 3.5.4 6.8.3 3.5.5 6.9.0 3.5.6 6.9.0-beta.1 3.5.7 6.9.0-beta.2 3.5.8 6.9.0-rc.1 3.5.9 6.9.1 3.6.0 6.9.2 3.6.0-beta.1 6.9.3 3.6.0-rc.1 6.9.4 3.6.0-rc.2 6.9.5 3.6.0-rc.3 7.0.0 3.6.1 7.0.0-beta.1 3.6.2 7.0.0-beta.2 3.6.3 7.0.0-beta.3 3.6.4 7.0.0-rc.1 3.6.5 7.0.0-rc.2 3.6.6 7.0.1 3.6.7 7.0.2 3.7.0 7.1.0 3.7.0-beta.1 7.1.0-beta.1 3.7.0-rc.1 7.1.0-beta.2 3.7.0-rc.2 7.1.0-rc.1 3.7.1 7.1.0-rc.2 3.7.2 7.1.1
woocommerce / src / Blocks / BlockTypes / CheckoutOrderSummaryBlock.php
woocommerce / src / Blocks / BlockTypes Last commit date
Accordion 1 year ago AddToCartWithOptions 1 week ago OrderConfirmation 2 months ago ProductCollection 3 weeks ago Reviews 2 months ago AbstractBlock.php 4 weeks ago AbstractDynamicBlock.php 2 years ago AbstractInnerBlock.php 1 year ago AbstractProductGrid.php 3 months ago ActiveFilters.php 2 years ago AddToCartForm.php 4 weeks ago AddToWishlistButton.php 4 weeks ago AllProducts.php 2 years ago AllReviews.php 2 years ago AtomicBlock.php 2 years ago AttributeFilter.php 1 year ago Breadcrumbs.php 1 year ago Cart.php 2 months ago CartAcceptedPaymentMethodsBlock.php 2 years ago CartCrossSellsBlock.php 2 years ago CartCrossSellsProductsBlock.php 2 years ago CartExpressPaymentBlock.php 1 year ago CartItemsBlock.php 2 years ago CartLineItemsBlock.php 2 years ago CartLink.php 2 months ago CartOrderSummaryBlock.php 2 years ago CartOrderSummaryCouponFormBlock.php 2 years ago CartOrderSummaryDiscountBlock.php 2 years ago CartOrderSummaryFeeBlock.php 2 years ago CartOrderSummaryHeadingBlock.php 2 years ago CartOrderSummaryShippingBlock.php 2 years ago CartOrderSummarySubtotalBlock.php 2 years ago CartOrderSummaryTaxesBlock.php 2 years ago CartOrderSummaryTotalsBlock.php 2 years ago CartTotalsBlock.php 2 years ago CatalogSorting.php 4 weeks ago CategoryDescription.php 2 months ago CategoryTitle.php 2 months ago Checkout.php 2 months ago CheckoutActionsBlock.php 1 year ago CheckoutAdditionalInformationBlock.php 2 years ago CheckoutBillingAddressBlock.php 2 years ago CheckoutContactInformationBlock.php 2 years ago CheckoutExpressPaymentBlock.php 9 months ago CheckoutFieldsBlock.php 2 years ago CheckoutOrderNoteBlock.php 2 years ago CheckoutOrderSummaryBlock.php 2 years ago CheckoutOrderSummaryCartItemsBlock.php 2 years ago CheckoutOrderSummaryCouponFormBlock.php 2 years ago CheckoutOrderSummaryDiscountBlock.php 2 years ago CheckoutOrderSummaryFeeBlock.php 2 years ago CheckoutOrderSummaryShippingBlock.php 2 years ago CheckoutOrderSummarySubtotalBlock.php 2 years ago CheckoutOrderSummaryTaxesBlock.php 2 years ago CheckoutOrderSummaryTotalsBlock.php 2 years ago CheckoutPaymentBlock.php 2 years ago CheckoutPickupOptionsBlock.php 2 years ago CheckoutShippingAddressBlock.php 2 years ago CheckoutShippingMethodBlock.php 2 years ago CheckoutShippingMethodsBlock.php 2 years ago CheckoutTermsBlock.php 2 years ago CheckoutTotalsBlock.php 2 years ago ClassicShortcode.php 1 year ago ClassicTemplate.php 4 months ago ComingSoon.php 1 year ago CouponCode.php 2 months ago CustomerAccount.php 3 months ago Dropdown.php 4 weeks ago EmailContent.php 5 months ago EmptyCartBlock.php 2 years ago EmptyMiniCartContentsBlock.php 11 months ago EnableBlockJsonAssetsTrait.php 1 year ago FeaturedCategory.php 7 months ago FeaturedItem.php 7 months ago FeaturedProduct.php 7 months ago FilledCartBlock.php 2 years ago FilledMiniCartContentsBlock.php 4 months ago FilterWrapper.php 2 years ago HandpickedProducts.php 1 year ago MiniCart.php 4 weeks ago MiniCartCartButtonBlock.php 11 months ago MiniCartCheckoutButtonBlock.php 11 months ago MiniCartContents.php 3 months ago MiniCartFooterBlock.php 4 weeks ago MiniCartItemsBlock.php 11 months ago MiniCartProductsTableBlock.php 4 weeks ago MiniCartShoppingButtonBlock.php 9 months ago MiniCartTitleBlock.php 11 months ago MiniCartTitleItemsCounterBlock.php 11 months ago MiniCartTitleLabelBlock.php 11 months ago NextPreviousButtons.php 5 months ago PageContentWrapper.php 2 years ago PaymentMethodIcons.php 11 months ago PriceFilter.php 1 year ago ProceedToCheckoutBlock.php 2 years ago ProductAverageRating.php 1 year ago ProductBestSellers.php 2 years ago ProductButton.php 2 months ago ProductCategories.php 4 weeks ago ProductCategory.php 2 years ago ProductDescription.php 9 months ago ProductDetails.php 5 months ago ProductFilterActive.php 4 weeks ago ProductFilterAttribute.php 4 weeks ago ProductFilterCheckboxList.php 4 weeks ago ProductFilterChips.php 4 weeks ago ProductFilterClearButton.php 4 weeks ago ProductFilterPrice.php 4 weeks ago ProductFilterPriceSlider.php 4 weeks ago ProductFilterRating.php 4 weeks ago ProductFilterRemovableChips.php 4 weeks ago ProductFilterStatus.php 4 weeks ago ProductFilterTaxonomy.php 4 weeks ago ProductFilters.php 3 weeks ago ProductGallery.php 4 weeks ago ProductGalleryLargeImage.php 4 weeks ago ProductGalleryThumbnails.php 4 weeks ago ProductImage.php 4 weeks ago ProductImageGallery.php 7 months ago ProductMeta.php 1 year ago ProductNew.php 2 years ago ProductOnSale.php 2 years ago ProductPrice.php 2 months ago ProductQuery.php 4 weeks ago ProductRating.php 1 year ago ProductRatingCounter.php 1 year ago ProductRatingStars.php 1 year ago ProductResultsCount.php 2 months ago ProductSKU.php 2 months ago ProductSaleBadge.php 1 year ago ProductSearch.php 10 months ago ProductSpecifications.php 2 months ago ProductStockIndicator.php 2 months ago ProductSummary.php 7 months ago ProductTag.php 2 years ago ProductTemplate.php 2 months ago ProductTitle.php 1 year ago ProductTopRated.php 2 years ago ProductsByAttribute.php 2 years ago RatingFilter.php 2 years ago RelatedProducts.php 3 months ago ReviewsByCategory.php 2 years ago ReviewsByProduct.php 2 years ago SavedForLater.php 4 weeks ago SingleProduct.php 2 months ago StockFilter.php 2 years ago StoreNotices.php 1 year ago Wishlist.php 4 weeks ago
CheckoutOrderSummaryBlock.php
81 lines
1 <?php
2 namespace Automattic\WooCommerce\Blocks\BlockTypes;
3
4 /**
5 * CheckoutOrderSummaryBlock class.
6 */
7 class CheckoutOrderSummaryBlock extends AbstractInnerBlock {
8 /**
9 * Block name.
10 *
11 * @var string
12 */
13 protected $block_name = 'checkout-order-summary-block';
14
15 /**
16 * Get the contents of the given inner block.
17 *
18 * @param string $block_name Name of the order summary inner block.
19 * @param string $content The content to search.
20 * @return array|bool
21 */
22 private function get_inner_block_content( $block_name, $content ) {
23 if ( preg_match( $this->inner_block_regex( $block_name ), $content, $matches ) ) {
24 return $matches[0];
25 }
26 return false;
27 }
28
29 /**
30 * Get the regex that will return an inner block.
31 *
32 * @param string $block_name Name of the order summary inner block.
33 * @return string Regex pattern.
34 */
35 private function inner_block_regex( $block_name ) {
36 return '/<div data-block-name="woocommerce\/checkout-order-summary-' . $block_name . '-block"(.+?)>(.*?)<\/div>/si';
37 }
38
39 /**
40 * Render the Checkout Order Summary block.
41 *
42 * @param array $attributes Block attributes.
43 * @param string $content Block content.
44 * @param object $block Block object.
45 * @return string Rendered block.
46 */
47 protected function render( $attributes, $content, $block ) {
48 // The order-summary-totals block was introduced as a new parent block for the totals
49 // (subtotal, discount, fees, shipping and taxes) blocks.
50 $regex_for_checkout_order_summary_totals = '/<div data-block-name="woocommerce\/checkout-order-summary-totals-block"(.+?)>/';
51 $order_summary_totals_content = '<div data-block-name="woocommerce/checkout-order-summary-totals-block" class="wp-block-woocommerce-checkout-order-summary-totals-block">';
52
53 // We want to move these blocks inside a parent 'totals' block.
54 $totals_inner_blocks = array( 'subtotal', 'discount', 'fee', 'shipping', 'taxes' );
55
56 if ( preg_match( $regex_for_checkout_order_summary_totals, $content ) ) {
57 return $content;
58 }
59
60 foreach ( $totals_inner_blocks as $key => $block_name ) {
61 $inner_block_content = $this->get_inner_block_content( $block_name, $content );
62
63 if ( $inner_block_content ) {
64 $order_summary_totals_content .= "\n" . $inner_block_content;
65
66 // The last block is replaced with the totals block.
67 if ( count( $totals_inner_blocks ) - 1 === $key ) {
68 $order_summary_totals_content .= '</div>';
69 $content = preg_replace( $this->inner_block_regex( $block_name ), $order_summary_totals_content, $content );
70 } else {
71 // Otherwise, remove the block.
72 $content = preg_replace( $this->inner_block_regex( $block_name ), '', $content );
73 }
74 }
75 }
76
77 // Remove empty lines.
78 return preg_replace( '/\n\n( *?)/i', '', $content );
79 }
80 }
81