Send Product Data To Stripe

//add order details to Stripe payment metadata function filter_wcv_sc_payment_metadata( $metadata, $order, $source ) { $order_data = $order->get_data(); $metadata[‘Total Tax Charged’] = $order_data[‘total_tax’]; $metadata[‘Total Shipping Charged’] = $order_data[‘shipping_total’]; $count = 1; foreach( $order->get_items() as $item_id => $line_item ){ $item_data = $line_item->get_data();…Continue reading

How to Exclude a Plan from the Signup Page?

function hide_specific_membership_plan( $query_args ) { $user_id = get_current_user_id(); if ( ! $user_id ) { return; } $user_data = get_userdata( $user_id ); $user_roles = $user_data->roles; if ( in_array( ‘subscriber’, $user_roles ) ) { //Post ids that you want to hide $exclude_posts…Continue reading

Why ISO 4217 is Used for Google, Facebook, and Bing in XML Feeds (snippet 2)

//Google Feeds add_filter(‘adt_pfp_localize_price_iso4217_feeds’, function($feeds) { // Remove all Google feeds from ISO4217 formatting return array_filter($feeds, function($feed) { return strpos($feed, ‘google_’) !== 0; }); }); //Facebook Feeds add_filter(‘adt_pfp_localize_price_iso4217_feeds’, function($feeds) { // Remove all Facebook feeds from ISO4217 formatting return array_filter($feeds, function($feed)…Continue reading

Why ISO 4217 is Used for Google, Facebook, and Bing in XML Feeds (snippet 3)

// Force localization for all feeds add_filter(‘adt_product_feed_localize_price_args’, function($args) { $args[‘decimal_separator’] = ‘.’; $args[‘thousand_separator’] = ‘,’; return $args; }); add_filter(‘adt_pfp_localize_price_iso4217_feeds’, function($feeds) { // Remove all Google feeds from ISO4217 formatting return array_filter($feeds, function($feed) { return strpos($feed, ‘google_’) !== 0; }); });Continue reading