Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Add DiscountsMeta slot to Checkout sidebar #4310

Merged
merged 2 commits into from
Jun 11, 2021
Merged

Conversation

opr
Copy link
Contributor

@opr opr commented Jun 4, 2021

Following on from #4248 this PR will add the same Slot to the Checkout sidebar.

Screenshots

How to test the changes in this Pull Request:

  1. Check out feature/add-inputs-for-points-redemption from https://github.com/woocommerce/woocommerce-points-and-rewards/ and ensure you've run npm run build in that project.
  2. Go to the file includes/class-wc-points-rewards-extend-store-endpoint.php in Points and Rewards and comment out the following lines (66-72):
self::$extend->register_update_callback(
  array(
    'endpoint'          => CartExtensionsSchema::IDENTIFIER,
    'namespace'         => self::IDENTIFIER,
    'callback_function' => array( 'WC_Points_Rewards_Cart_Checkout', 'rest_apply_discount' ),
  )
);
  1. Ensure you have added points to your user account ( WooCommerce -> Points and Rewards) and that you're logged in
  2. Add items to your cart and visit the Checkout block. See that the Points and Rewards input is present. Note that it won't function on this branch. This PR is just to get the display working.

Changelog

Add Slot in the Discounts section of the Checkout sidebar to allow third party extensions to render their own components there.

@opr opr added status: needs review category: extensibility Work involving adding or updating extensibility. Useful to combine with other scopes impacted. focus: components Work that introduces new or updates existing components. focus: blocks Specific work involving or impacting how blocks behave. block: checkout Issues related to the checkout block. labels Jun 4, 2021
@opr opr self-assigned this Jun 4, 2021
@opr opr requested a review from a team as a code owner June 4, 2021 14:27
@opr opr requested review from frontdevde and senadir and removed request for a team June 4, 2021 14:27
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2021

Size Change: +441 B (0%)

Total Size: 988 kB

Filename Size Change
build/active-filters-frontend.js 7.98 kB +1 B (0%)
build/active-filters.js 7.53 kB +1 B (0%)
build/all-products-frontend.js 34.7 kB +1 B (0%)
build/all-products.js 36.5 kB -1 B (0%)
build/all-reviews.js 9.29 kB +134 B (+1%)
build/atomic-block-components/image-frontend.js 1.66 kB -1 B (0%)
build/atomic-block-components/sale-badge-frontend.js 469 B -1 B (0%)
build/attribute-filter-frontend.js 17.7 kB +2 B (0%)
build/attribute-filter.js 11.4 kB +1 B (0%)
build/cart-frontend.js 77.9 kB +3 B (0%)
build/checkout-frontend.js 81.9 kB +22 B (0%)
build/checkout.js 46.6 kB +24 B (0%)
build/featured-category.js 7.23 kB -1 B (0%)
build/featured-product.js 9.4 kB -5 B (0%)
build/price-filter-frontend.js 14.3 kB +2 B (0%)
build/price-filter.js 9.3 kB -1 B (0%)
build/product-best-sellers.js 6.12 kB +1 B (0%)
build/product-categories.js 3.38 kB +140 B (+4%)
build/product-category.js 6.99 kB +1 B (0%)
build/product-on-sale.js 6.62 kB +1 B (0%)
build/product-search.js 2.68 kB +118 B (+5%) 🔍
build/product-tag.js 6.11 kB +2 B (0%)
build/products-by-attribute.js 7.22 kB +2 B (0%)
build/reviews-by-product.js 12.7 kB -2 B (0%)
build/reviews-frontend.js 8.94 kB +1 B (0%)
build/single-product-frontend.js 38.1 kB +2 B (0%)
build/single-product.js 9.65 kB -1 B (0%)
build/vendors.js 242 kB -5 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js 2.39 kB 0 B
build/atomic-block-components/add-to-cart--atomic-block-components/button.js 1.95 kB 0 B
build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js 334 B 0 B
build/atomic-block-components/add-to-cart-frontend.js 8.74 kB 0 B
build/atomic-block-components/add-to-cart.js 7.8 kB 0 B
build/atomic-block-components/button-frontend.js 1.73 kB 0 B
build/atomic-block-components/button.js 844 B 0 B
build/atomic-block-components/category-list-frontend.js 469 B 0 B
build/atomic-block-components/category-list.js 478 B 0 B
build/atomic-block-components/image.js 1.3 kB 0 B
build/atomic-block-components/price-frontend.js 1.98 kB 0 B
build/atomic-block-components/price.js 2.01 kB 0 B
build/atomic-block-components/rating-frontend.js 521 B 0 B
build/atomic-block-components/rating.js 525 B 0 B
build/atomic-block-components/sale-badge.js 474 B 0 B
build/atomic-block-components/sku-frontend.js 389 B 0 B
build/atomic-block-components/sku.js 393 B 0 B
build/atomic-block-components/stock-indicator-frontend.js 569 B 0 B
build/atomic-block-components/stock-indicator.js 572 B 0 B
build/atomic-block-components/summary-frontend.js 906 B 0 B
build/atomic-block-components/summary.js 910 B 0 B
build/atomic-block-components/tag-list-frontend.js 464 B 0 B
build/atomic-block-components/tag-list.js 472 B 0 B
build/atomic-block-components/title-frontend.js 1.41 kB 0 B
build/atomic-block-components/title.js 1.26 kB 0 B
build/blocks-checkout-editor.js 10.6 kB 0 B
build/blocks-checkout.js 19.8 kB 0 B
build/blocks.js 3.51 kB 0 B
build/cart.js 44.3 kB 0 B
build/editor-rtl.css 14.9 kB 0 B
build/editor.css 14.9 kB 0 B
build/handpicked-products.js 5.89 kB 0 B
build/price-format.js 1.37 kB 0 B
build/product-new.js 6.28 kB 0 B
build/product-top-rated.js 6.26 kB 0 B
build/reviews-by-category.js 11.2 kB 0 B
build/style-rtl.css 18.9 kB 0 B
build/style.css 18.9 kB 0 B
build/vendors--atomic-block-components/price-frontend.js 6.54 kB 0 B
build/vendors-style-rtl.css 1.05 kB 0 B
build/vendors-style.css 1.05 kB 0 B
build/wc-blocks-data.js 10.8 kB 0 B
build/wc-blocks-google-analytics.js 1.99 kB 0 B
build/wc-blocks-middleware.js 1.48 kB 0 B
build/wc-blocks-registry.js 2.73 kB 0 B
build/wc-payment-method-bacs.js 812 B 0 B
build/wc-payment-method-cheque.js 807 B 0 B
build/wc-payment-method-cod.js 903 B 0 B
build/wc-payment-method-paypal.js 844 B 0 B
build/wc-payment-method-stripe.js 12.4 kB 0 B
build/wc-settings.js 2.93 kB 0 B
build/wc-shared-context.js 1.54 kB 0 B
build/wc-shared-hocs.js 1.73 kB 0 B

compressed-size-action

Copy link
Contributor

@frontdevde frontdevde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested as per testing instructions and can confirm that the points show up in the Checkout sidebar as expected:

Screenshot 2021-06-11 at 16 29 54

LGTM 👍

@opr opr added this to the 5.4.0 milestone Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: checkout Issues related to the checkout block. category: extensibility Work involving adding or updating extensibility. Useful to combine with other scopes impacted. focus: blocks Specific work involving or impacting how blocks behave. focus: components Work that introduces new or updates existing components.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants