This file contains hidden or 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 cart line items. | |
| registerCheckoutFilters( 'example-extension', { | |
| itemName: ( value, extensions, args ) => { | |
| // Return early since this filter is not being applied in the Cart context. | |
| // We must return the original value we received here. | |
| if ( args?.context !== 'cart' ) { | |
| return value; | |
| } |
This file contains hidden or 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 the subtotal price format. | |
| registerCheckoutFilters( 'example-extension', { | |
| subtotalPriceFormat: ( value, extensions, args ) => { | |
| // Return early since this filter is not being applied in the Cart context. | |
| // We must return the original value we received here. | |
| if ( args?.context !== 'cart' ) { | |
| return value; | |
| } |
This file contains hidden or 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 the total label. | |
| registerCheckoutFilters( 'example-extension', { | |
| totalLabel: () => 'Deposit due today' | |
| } ); |
This file contains hidden or 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; | |
| // Prevent a couponCode called '10off' from creating a notice when it gets removed. | |
| registerCheckoutFilters( 'example-extension', { | |
| showRemoveCouponNotice: ( value, extensions, { couponCode } ) => { | |
| return couponCode === '10off' ? false : value; | |
| } | |
| } ); |
This file contains hidden or 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; | |
| // Prevent a couponCode called '10off' from creating a notice when it gets applied. | |
| registerCheckoutFilters( 'example-extension', { | |
| showApplyCouponNotice: ( value, extensions, { couponCode } ) => { | |
| return couponCode === '10off' ? false : value; | |
| } | |
| } ); |
This file contains hidden or 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
| diff --git a/assets/js/base/components/cart-checkout/address-form/address-form.tsx b/assets/js/base/components/cart-checkout/address-form/address-form.tsx | |
| index cec368a6c..966ffeb06 100644 | |
| --- a/assets/js/base/components/cart-checkout/address-form/address-form.tsx | |
| +++ b/assets/js/base/components/cart-checkout/address-form/address-form.tsx | |
| @@ -144,6 +144,29 @@ const AddressForm = ( { | |
| id = id || instanceId; | |
| + const customValidationHandler = ( | |
| + inputObject: HTMLInputElement, |
This file contains hidden or 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
| import { __ } from '@wordpress/i18n'; | |
| __( 'Hello, Luigi!', 'woo-gutenberg-products-block' ); |
This file contains hidden or 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
| { | |
| "name": "niels/vip-go-site", | |
| "description": "VIP Go test site of Niels Lange", | |
| "repositories": [ | |
| { | |
| "type": "composer", | |
| "url": "https://wpackagist.org" | |
| } | |
| ], | |
| "require": { |
This file contains hidden or 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
| // Validate IPv4 address | |
| function isValidIPv4(string) { | |
| const octet = '(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)'; | |
| const regex = new RegExp(`^${octet}\\.${octet}\\.${octet}\\.${octet}$`); | |
| return regex.test(string) ? true : false; | |
| } |
This file contains hidden or 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
| <?php | |
| global $wpdb; | |
| $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id'" ); |