This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* External dependencies | |
*/ | |
import { | |
createContext, | |
useContext, | |
useReducer, | |
useRef, | |
useMemo, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* External dependencies | |
*/ | |
import { registerPlugin } from '@wordpress/plugins'; | |
import { ExperimentalOrderLocalPickupPackages } from '@woocommerce/blocks-checkout'; | |
const render = () => { | |
return ( | |
<ExperimentalOrderLocalPickupPackages> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* External dependencies | |
*/ | |
import { registerPlugin } from '@wordpress/plugins'; | |
import { ExperimentalDiscountsMeta } from '@woocommerce/blocks-checkout'; | |
const render = () => { | |
return ( | |
<ExperimentalDiscountsMeta> | |
<div class="wc-block-components-totals-wrapper"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* External dependencies | |
*/ | |
import { registerPlugin } from '@wordpress/plugins'; | |
import { ExperimentalOrderShippingPackages } from '@woocommerce/blocks-checkout'; | |
const render = () => { | |
return ( | |
<ExperimentalOrderShippingPackages> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* External dependencies | |
*/ | |
import { registerPlugin } from '@wordpress/plugins'; | |
import { ExperimentalOrderMeta } from '@woocommerce/blocks-checkout'; | |
const render = () => { | |
return ( | |
<ExperimentalOrderMeta> | |
<div class="wc-block-components-totals-wrapper"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Replace coupon label for matching coupon(s). | |
registerCheckoutFilters( 'example-extension', { | |
coupons: ( coupons ) => { | |
return coupons.map( ( coupon ) => { | |
// Regex to match autocoupon then unlimited undersores and numbers | |
if ( ! coupon.label.match( /autocoupon(?:_\d+)+/ ) ) { | |
return coupon; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Adjust subtotal price format of the order summary items. | |
registerCheckoutFilters( 'example-extension', { | |
subtotalPriceFormat: ( value, extensions, args ) => { | |
// Return early since this filter is not being applied in the Summary context. | |
// We must return the original value we received here. | |
if ( args?.context !== 'summary' ) { | |
return value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Adjust cart item class of the order summary items. | |
registerCheckoutFilters( 'example-extension', { | |
cartItemClass: ( value, extensions, args ) => { | |
// Return early since this filter is not being applied in the Summary context. | |
// We must return the original value we received here. | |
if ( args?.context !== 'summary' ) { | |
return value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Adjust cart item price of the order summary items. | |
registerCheckoutFilters( 'example-extension', { | |
cartItemPrice: ( value, extensions, args ) => { | |
// Return early since this filter is not being applied in the Summary context. | |
// We must return the original value we received here. | |
if ( args?.context !== 'summary' ) { | |
return value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Adjust item name of the order summary items. | |
registerCheckoutFilters( 'example-extension', { | |
itemName: ( value, extensions, args ) => { | |
// Return early since this filter is not being applied in the Summary context. | |
// We must return the original value we received here. | |
if ( args?.context !== 'summary' ) { | |
return value; | |
} |
NewerOlder