Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / gist:c273058bfe3519b55f8034d0671ba562
Created October 14, 2025 10:04
Funnelkit Cart: Autoship Plugin compatibility with funnelkit cart
class Fkcart_Autoship_wrap {
public function __construct() {
// Register hooks
add_filter('fkcart_update_side_cart_on_load', array($this, 'update_side_cart_on_load'));
add_action('fkcart_quick_before_view_content', array($this, 'before_view_content'));
add_action('fkcart_quick_after_view_content', array($this, 'after_view_content'));
add_action('wp_footer', array($this, 'footer_script'));
@xlplugins
xlplugins / Checkout : Restrict shipping based on specific zip codes.
Created October 14, 2025 04:23
Checkout : Restrict shipping based on specific zip codes.
/**
* Restrict shipping based on specific zip codes.
*/
add_action( 'woocommerce_after_checkout_validation', 'restrict_shipping_by_zipcode', 10, 2 );
function restrict_shipping_by_zipcode( $data, $errors ) {
// List of restricted zip codes
$restricted_zips = ['110001', '00701', '00901']; // Replace with your zip codes
// Get the shipping postcode from the checkout data
$shipping_postcode = isset( $data['shipping_postcode'] ) ? strtoupper(trim($data['shipping_postcode'])) : '';
@xlplugins
xlplugins / move_order_summary_below_payment_coupon_in_its_position
Created October 13, 2025 11:00
move order summary below payment method by keeping coupon in its own position
/*change_text_on_order_summary*/
function title_html() {
?>
<div class="wfacp_internal_form_wrap wfacp-comm-title none margin-top">
<h2 class="wfacp_section_heading wfacp_section_title wfacp-normal wfacp-text-left">
<?php echo __( 'SUMMARY OF YOUR ORDER', 'woofunnels-aero-checkout' ) ?></h2>
</div>
<?php
}
?>
@xlplugins
xlplugins / gist:1f200fa6fa5b4a3f52a168062fec258f
Created October 10, 2025 11:03
Funnelkit Checkout: Override The address 1 and address 2 with short name call
add_action( 'wfacp_after_checkout_page_found', function () {
add_action( 'wp_footer', function () {
?>
<script>
window.addEventListener('load', function () {
(function ($) {
function extractValueByType(components, typeKey, nameType = 'long_name') {
const match = components.find(comp => comp.types.includes(typeKey));
return match ? match[nameType] : '';
@xlplugins
xlplugins / gist:9dac3eedba4c5e3ff6cbc8b5ab488532
Created October 9, 2025 13:14
Funnelkit Checkout: display Subtotal After Discount in FunnelKit Checkout.
if ( ! class_exists( 'WFACP_Subtotal_After_Discount' ) ) {
#[AllowDynamicProperties]
class WFACP_Subtotal_After_Discount {
private static $instance = null;
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
@xlplugins
xlplugins / gist:be9ccc26d1c840c51cf2a38454478fc1
Created October 9, 2025 11:04
Funnelkit Checkout : remove single quote in the billing and shipping address 1
add_action( 'wfacp_internal_css', function () {
?>
<script>
window.addEventListener('load', function () {
(function ($) {
function remove_single_quotes() {
var billingField = 'billing_address_1';
var shippingField = 'shipping_address_1';
@xlplugins
xlplugins / gist:fc0eeac8065ae8185e7c2accdb345ccf
Last active October 9, 2025 07:25
Funnelkit Checkout: Change the position of multiple customer Address field position
class WFACP_Compatibility_With_WC_Multiple_Customer_Addresses_field_position {
public $instance = null;
public $checkout_instance = null;
public function __construct() {
add_action( 'process_wfacp_html', [ $this, 'display_field' ], 999, 3 );
/* Add remove action */
add_action( 'wfacp_template_load', [ $this, 'actions' ], 8 );
@xlplugins
xlplugins / Add price value in free gift
Last active October 9, 2025 15:36
Cart : Add price value in free gift
class fkcart_Zero_Price {
public function __construct(){
add_action( 'woocommerce_before_calculate_totals',[$this,'update_free_gift'], 99 );
add_action( 'woocommerce_cart_loaded_from_session',[$this,'update_free_gift'], 99 );
}
/**
* Update free gift product price to 0
*
* @param $cart
*
@xlplugins
xlplugins / gist:f6f1ae9691fa6ba08292c1d4af0aaddb
Created October 7, 2025 13:26
Funnelkit Bump: Register New Bump Position above the payment method in the funnelkit checkout
add_action( 'after_setup_theme', function () {
if ( ! class_exists( 'WFOB_Add_New_Position' ) ) {
return;
}
new WFOB_Add_New_Position( [
'position_id' => 'wfacp_template_before_payment_field',
'hook' => 'wfacp_template_before_payment',
'position_name' => 'Above Payment Method',
@xlplugins
xlplugins / gist:db89366104ac86b6928a277cc2c11710
Created October 4, 2025 07:19
Funnelkit Cart: Free Product Functionality will be work on the all page not cart compatability with WPLoyalty - WooCommerce Loyalty Points, Rewards and Referral Pro by Wployalty
add_filter( 'fkcart_re_run_get_slide_cart_ajax', '__return_true', 9999 );
add_filter('fkcart_update_side_cart_on_load',function (){
return 'yes';
});
add_action('fkcart_before_cart_items',function (){
do_action('woocommerce_before_cart');
});