Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / gist:ee4308a65f0ce2640caa9d935f8755ca
Created November 15, 2024 13:39
Funnelkit Checkout: Compatibility added with Theme Sofass by Everthemes #Sofass#theme
class WFACP_Theme_Sofass_by_GoalTheme {
public function __construct() {
add_action( 'after_setup_theme', [ $this, 'register_elementor_widget' ], 20 );
add_action( 'wfacp_internal_css', [ $this, 'add_css' ], 20 );
}
public function register_elementor_widget() {
@xlplugins
xlplugins / gist:94374c9ae696cd3b5c89cee398fb32dd
Created November 15, 2024 10:31
Funnelkit Checkout: Enable Smart button forcefully
class WFACP_Enable_Express_Checkout {
public function __construct() {
add_action( 'wfacp_template_load', [ $this, 'checkout_hook' ] );
}
public function checkout_hook() {
add_filter( 'wfacp_page_settings', [ $this, 'enable_smart_button_optimizations' ] );
}
public function enable_smart_button_optimizations( $page_settings ) {
@xlplugins
xlplugins / gist:a11631f7df6bc9cf14bedff13fb821b5
Created November 13, 2024 07:42
Funnelkit checkout: google address autocomplete put Address 2 field in France
add_action( 'wfacp_internal_css', function () {
?>
<script>
window.addEventListener('load', function () {
wfacp_frontend.hooks.addFilter('wfacp_countries_address_format', function (format) {
format.fr = {
'_address_1': {'keys': {'route': 'long_name'}, 'separator': ' '},
'_address_2': {'keys': {'street_number': 'long_name'}, 'separator': ' '},
'_city': {'keys': {'locality': 'long_name', 'postal_town': 'long_name'}, 'separator': ' '},
@xlplugins
xlplugins / gist:b2b9a61330b365ffc19cdda939c07771
Created November 13, 2024 05:57
Funnelkit Checkout: Compatibility added with Theme Issabella by JWSThemes team #Issabella#theme
class WFACP_Theme_Issabella_by_JWSThemes_team {
function __construct() {
add_action( 'wfacp_after_template_found', [ $this, 'action' ] );
}
public function action() {
if ( function_exists( 'jws_setup' ) ) {
remove_action( 'woocommerce_checkout_after_customer_details', 'woocommerce_checkout_payment', 30 );
@xlplugins
xlplugins / WFACP_Goya_Theme
Last active November 13, 2024 05:17
Funnelkit Checkout: Compatibility added with Theme Goya by Everthemes #Goya#theme
class WFACP_Goya_Theme {
function __construct() {
add_action( 'wfacp_after_template_found', [ $this, 'action' ] );
}
public function action() {
if ( function_exists( 'goya_product_image_on_checkout' ) ) {
remove_filter( 'woocommerce_cart_item_name', 'goya_product_image_on_checkout', 10, 3 );
}
@xlplugins
xlplugins / gist:d3ffe81635a5706e80c995101efd4143
Created November 12, 2024 13:16
Funnelkit Cart:Hide Child Product item of composite product like image and price
class FunnelKitWPCComposite1 {
public $tmp = [];
public function __construct() {
add_filter( 'fkcart_is_child_item', [ $this, 'check_free_item' ], 10, 2 );
add_filter( 'fkcart_item_hide_delete_icon', [ $this, 'check_free_item' ], 10, 2 );
add_filter( 'fkcart_cart_item_is_sold_individually', [ $this, 'check_free_item' ], 10, 2 );
@xlplugins
xlplugins / gist:ed0692712ef2d4d70d2b7c37a220a4a2
Created November 11, 2024 07:11
Funnelkit Cart: Restrict Open site cart on the cart page
add_action( 'wp_footer', function () {
// Check if we're on the cart page
if ( function_exists('is_cart') && is_cart() ) {
?>
<script>
(function () {
window.addEventListener('DOMContentLoaded', function () {
@xlplugins
xlplugins / fkwcs_metadata_info.php
Created November 8, 2024 12:49
Payment Metadata stripe
function fkwcs_filter_wc_stripe_payment_metadata($metadata, $order)
{
/**
* Get order data
*/
$order_data = $order->get_data();
$metadata[__('Customer Name', 'funnelkit-stripe-woo-payment-gateway')] = sanitize_text_field($order_data['billing']['first_name'] . ' ' . $order_data['billing']['last_name']);
$metadata[__('Customer Phone', 'funnelkit-stripe-woo-payment-gateway')] = sanitize_text_field($order_data['billing']['phone']);
$metadata[__('Total Tax', 'funnelkit-stripe-woo-payment-gateway')] = sanitize_text_field($order_data['total_tax']);
@xlplugins
xlplugins / fkwcs_gateway_disable_tokenization.php
Created November 7, 2024 14:31
fkwcs_gateway_disable_tokenization.php
/**
* Disallow FunnelKit Stripe plugin support for tokenization
*/
add_action( 'woocommerce_payment_gateway_supports', function ( $bool, $feature, $gateway ) {
if ( $gateway->id === 'fkwcs_stripe' && $feature === 'tokenization' ) {
return false;
}
return $bool;
@xlplugins
xlplugins / Checkout : Move the position of rewards point into the mini cart plugin by WooCommerce Points and Rewards By WooCommerce
Last active November 8, 2024 07:47
Checkout : Move the position of rewards point into the mini cart plugin by WooCommerce Points and Rewards By WooCommerce
class WFACP_Compatibility_With_WC_Points_and_Reward_mini_cart {
public $instance = null;
public $message = '';
public $count = 0;
public function __construct() {
/* Unhook rewards and points */
add_action( 'wfacp_template_load', [ $this, 'actions' ], 9 );