Skip to content

Instantly share code, notes, and snippets.

View senadir's full-sized avatar
💭
I'm on Sabbatical

Seghir Nadir senadir

💭
I'm on Sabbatical
View GitHub Profile
const { uniqBy } = require("lodash");
const glob = require("glob-promise");
const fs = require("fs").promises;
glob("episodes-data/*.json")
.then((files) => {
// read the folder or folders if you want: example json/**/*.json
return Promise.all(
files.map((file) => {
return fs
.readFile(file, "utf8")
assets/js/base/components/cart-checkout/address-form/index.js -> assets/js/base/components/text-input/index.js -> assets/js/base/components/text-input/validated.js -> assets/js/base/context/index.js -> assets/js/base/context/cart-checkout/index.js -> assets/js/base/context/cart-checkout/payment-methods/index.js -> assets/js/base/context/cart-checkout/payment-methods/payment-method-data-context.js -> assets/js/base/hooks/index.js -> assets/js/base/hooks/payment-methods/index.js -> assets/js/base/hooks/payment-methods/use-payment-method-interface.js -> assets/js/base/components/cart-checkout/index.js -> assets/js/base/components/cart-checkout/address-form/index.js
assets/js/base/components/cart-checkout/index.js -> assets/js/base/components/cart-checkout/address-form/index.js -> assets/js/base/components/text-input/index.js -> assets/js/base/components/text-input/validated.js -> assets/js/base/context/index.js -> assets/js/base/context/cart-checkout/index.js -> assets/js/base/context/cart-checkout/paym
<?php
/**
* A class to add support for webhooks endpoints.
*/
class Yalidine_Shipping_Webhooks {
/**
* The processing statuses.
*
@senadir
senadir / frontend.js
Last active April 8, 2024 12:31
Add a field to Checkout block that can adds a fee to an order realtime.
let selectedValue = null;
wp.data.subscribe( () => {
// This is only needed for fields registered in Contact or Additional, address fields are always pushed and you can use other hooks.
const additionalFields = wp.data
.select( 'wc/store/checkout' )
.getAdditionalFields();
// Use the same id you used to register your field.
const donationAmount = additionalFields[ 'my-plugin/donation' ];