Tag: metadata
Lighting – Fixture Meta Field Initialization
/** * Initialize custom meta fields for Lighting > Lighting Fixtures products. * * Applies to product_cat slugs: * – lighting-fixtures (parent Lighting Fixtures) * – followspots * – pars * – wash-lights * – dj-lights * – uplights *…Continue reading
WP Simple Pay: Copy Payment Metadata to Customer Metadata
/** * @link https://library.wpcode.com/snippet/e5wng05d/ * * @param StripeEvent $event Stripe Event. * @param StripeSubscription|StripePaymentIntent $object Stripe Subscription or PaymentIntent */ function simpay_add_metadata_to_customer( $event, $object ) { $customer_id = $object->customer->id; $customer = SimplePayCorePaymentsStripe_API::request( ‘Customer’, ‘update’, $customer_id, array( ‘metadata’ => $object->metadata->toArray(), )…Continue reading
WP Simple Pay: Copy Payment Metadata to Customer Metadata
/** * @link https://library.wpcode.com/snippet/e5wng05d/ * * @param \Stripe\Event $event Stripe Event. * @param \Stripe\Subscription|\Stripe\PaymentIntent $object Stripe Subscription or PaymentIntent */ function simpay_add_metadata_to_customer( $event, $object ) { $customer_id = $object->customer->id; $customer = \SimplePay\Core\Payments\Stripe_API::request( ‘Customer’, ‘update’, $customer_id, array( ‘metadata’ => $object->metadata->toArray(), )…Continue reading
WP Simple Pay: Add Customer Phone to Customer Metadata
/** * @link https://library.wpcode.com/snippet/d2zk7n2x/ */ add_filter( ‘simpay_get_customer_args_from_payment_form_request’, /** * @param array $args * @return array */ function( $args ) { if ( isset( $args[‘phone’] ) ) { $args[‘metadata’][‘phone’] = $args[‘phone’]; } return $args; } );Continue reading
WP Simple Pay: Modify Customer Record Creation
/** * @link https://library.wpcode.com/snippet/3234y0or/ */ add_filter( ‘simpay_get_customer_args_from_payment_form_request’, /** * @param array $customer_args * @param SimplePay\Core\Abstracts\Form $form Form instance. * @param array $form_data Form data generated by the client. * @param array $form_values Values of named fields in the payment form.…Continue reading
WP Simple Pay: Add Custom Field Data to Customer Metadata
/** * @link https://library.wpcode.com/snippet/924r645g/ */ add_filter( ‘simpay_get_customer_args_from_payment_form_request’, /** * @param array $customer_args Arguments for Customer. * @param \SimplePay\Core\Abstracts\Form $form Form instance. * @param array $deprecated Empty array. * @param array $form_values Values of named fields in the payment form. *…Continue reading