Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / wffn_export_conversion_timestamp.php
Created July 10, 2026 13:29
Export analytics data in UTC format
add_filter( 'wffn_export_conversion_timestamp', function ( $formatted, $local, $dt ) {
if ( $dt instanceof DateTime ) {
$utc = clone $dt; $utc->setTimezone( new DateTimeZone( 'UTC' ) );
return $utc->format( 'Y-m-d\TH:i:s\Z' ); // 2026-07-10T12:02:25Z
}
return $formatted;
}, 10, 3 );
@xlplugins
xlplugins / fkwcs_restrict_buttons.php
Created July 10, 2026 11:40
Express Wallets - Single Button
<?php
/**
* Plugin Name: Express Wallets - Single Button (Apple > Google, hide PayPal)
* Description: Show only ONE express wallet button — Apple Pay if the device supports
* it, else Google Pay — and hide the PayPal EXPRESS button whenever a
* Stripe wallet is available. Works on product, cart and checkout.
*
* We do NOT re-detect wallet support and we do NOT pre-hide anything. FunnelKit Stripe
* already runs the wallet check and renders the buttons; we only step in AFTER it has
* finished and hide the ones we don't want. So the worst case is "all buttons show"
@xlplugins
xlplugins / plakatdyr fkcart image compatibility
Created July 7, 2026 11:55
plakatdyr fkcart image compatibility
add_filter( 'fkcart_item_image_size', function () {
return 'woocommerce_thumbnail';
} );
// 2) Remove FKCart's default card border/radius on slide-cart images (framed posters have their own frame).
add_action( 'wp_head', function () {
echo '<style id="fkcart-frame-img-clean">
#fkcart-modal .fkcart-item-wrap .fkcart--item .fkcart-image-wrapper img{border:0 !important;border-radius:0 !important}
#fkcart-modal .fkcart--item .fkcart-image-wrapper{border:0 !important;border-radius:0 !important;box-shadow:none !important;background:none !important}
</style>';
@xlplugins
xlplugins / Master checkbox for all orderbump show hide
Created July 7, 2026 08:03
Master checkbox for all orderbump show hide
/**
* Plugin Name: FK Order Bumps — master show/hide toggle
* Description: Adds one master checkbox that shows/hides ALL FunnelKit order bumps at once.
* Unchecking it also removes any added bump (via WFOB's own flow) and refreshes the
* order review, and the final state is saved on the order for later inspection.
*/
defined( 'ABSPATH' ) || exit;
/**
* Persist the toggle state on the order + show it on the admin order screen.
@xlplugins
xlplugins / Store Checkout — import legacy upsell offers
Last active July 7, 2026 09:01
Store Checkout — import legacy upsell offers
add_action( 'admin_init', function () {
$run_key = 'fk_move_standalone_upsells_20260707c'; // change to re-run
$log = function ( $m ) { if ( function_exists( 'wc_get_logger' ) ) { wc_get_logger()->info( $m, array( 'source' => 'fk-store-checkout-upsells' ) ); } };
if ( get_option( $run_key )
|| ! class_exists( 'WFFN_Common' ) || ! class_exists( 'WFOCU_Common' ) || ! class_exists( 'WFFN_Funnel' ) ) {
return;
}
@xlplugins
xlplugins / Delivery or pickup unavailable on update checkout by fk
Created July 6, 2026 11:46
Delivery or pickup unavailable on update checkout by fk
// --- server: return the correct options + min-spend notice for the CURRENT cart ---
add_action( 'wp_ajax_cr_relief_order_type', 'cr_relief_order_type_cb' );
add_action( 'wp_ajax_nopriv_cr_relief_order_type', 'cr_relief_order_type_cb' );
function cr_relief_order_type_cb() {
if ( ! function_exists( 'WC' ) || is_null( WC()->cart ) || ! class_exists( 'Coderockz_Woo_Delivery_Delivery_Option' ) ) {
wp_send_json_error();
}
WC()->cart->calculate_totals();
$settings = get_option( 'coderockz_woo_delivery_option_delivery_settings' );
@xlplugins
xlplugins / Dropdown field with pricing
Created July 2, 2026 10:26
Dropdown field with pricing
class Add_Custom_Fee_On_Change_Radio{
private $radio_fields = [
'vin_choice' => [ //field ID need to create
'confirm-part-fitment-using-my-vin' => [ // value of the option
'label' => 'Confirm part fitment using my VIN', //frontend value of the option
'price' => 10
],
'i-do-not-wish-to-provide-my-vin' => [
'label' => 'I do not wish to provide my VIN',
@xlplugins
xlplugins / Add price with a custom checkbox
Created July 2, 2026 10:20
Add price with a custom checkbox
class Add_Custom_Fee_On_Change_Checkbox {
private $field_lable = 'Shipping Way Fee';
private $checkout_fields = [
'shipping_way_0' => [
'label' => 'Your label here',
'price' => 10
],
];
@xlplugins
xlplugins / fkwcs_link_with_card.php
Created July 1, 2026 14:54
Use Stripe "Link within card" integration instead of "Link as a payment method"
@xlplugins
xlplugins / Move street number for Ireland
Created July 1, 2026 09:14
move_street_number_first_ireland
add_action( 'wfacp_footer_after_print_scripts', function () {
?>
<script>
window.addEventListener( 'load', function () {
wfacp_frontend.hooks.addFilter( 'wfacp_country_address_google_format', function ( output, components, instance ) {
if ( output._country !== 'IE' ) {
return output;
}
var number = instance.extractValueByType( components, 'street_number' );
var route = instance.extractValueByType( components, 'route' );