Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / refresh payment gateway at checkout page
Created October 11, 2022 11:13
refresh payment gateway at checkout page
add_filter( 'wfacp_need_payment_gateway_refresh', function () {
return true;
}, 100 );
@xlplugins
xlplugins / Show custom fields inside the gateway
Last active March 24, 2025 14:05
Show custom fields inside the gateway
class WFACP_CustomFields_Inside_Gateway {
private $hook = 'woocommerce_checkout_after_terms_and_conditions';
private $hook_priority = 10;
private $collected_fields = [];
public function __construct() {
add_action( $this->hook, [ $this, 'display_fields' ], $this->hook_priority );
@xlplugins
xlplugins / WF_Allow_Theme_CSS_JS
Last active November 15, 2024 13:56
(Now we have setting for this) Allow theme scripts for particular step #upsell #funnelkit #theme css
class WF_Allow_Theme_CSS_JS {
private $allow_post_type = [
'wffn_landing',
'wffn_ty',
'wffn_optin',
'wffn_oty',
];
@xlplugins
xlplugins / gist:02c0ba4832779b8e2903f99049015e93
Created January 19, 2022 08:59
Trigger next button on page load
add_action( 'wfacp_internal_css', function () { ?>
<script>
window.addEventListener('load', function () {
(function ($) {
$('.wfacp_next_page_button').trigger('click')
})(jQuery);
});
@xlplugins
xlplugins / allow-current-theme-scripts-for-particular-step
Last active August 16, 2024 07:35
Allow current theme scripts for particular step #Upstroke #woofunnels #theme css
add_filter('wffn_allowed_themes', 'wffn_allow_current_theme_scripts' ); //for funnel builder pages ( sale, optin, optin thankyou and wc thankyou )
// add_filter('wfocu_allowed_themes', 'wffn_allow_current_theme_scripts' );// only for Upsell offer page
function wffn_allow_current_theme_scripts( $args ){
//Allow current theme scripts and css for particular step in canvas template
//'wfacp_checkout' for checkout
//'wfocu_offer' for upsell
//'wffn_landing' for landing
//'wffn_ty' for wc thankyou
@xlplugins
xlplugins / Reload Checkout Page once, Because of Cookie not set in this server at first time
Created November 30, 2021 10:42
Reload Checkout Page once, Because of Cookie not set in this server at first time
@xlplugins
xlplugins / modify_upsell_cancel_offers.php
Last active September 25, 2023 06:47
Modify Offer Ids that will cancel primary order #upsells #Upstroke #upstroke #UpStroke
add_filter('wfocu_offers_to_cancel_primary', function(){
return [XXXXXX,XXXXX]; //replace with the offer IDs
});
@xlplugins
xlplugins / gist:05bb40cac6876def7e6f19607aec15b6
Created November 3, 2021 05:38
Hide Address Fields On Virtual Cart
class WFACP_Hide_Address_Fields_On_Virtual_Cart {
public function __construct() {
add_action( 'wfacp_internal_css', [ $this, 'add_js' ] );
}
public function add_js() {
@xlplugins
xlplugins / Sale page redirect to checkout page using the Elementor pro add to cart button
Last active February 26, 2025 13:12
Sale page redirect to checkout page using the Elementor pro add to cart button
class WFFN_Change_Action_Of_Add_To_Cart {
// Define an array of landing page IDs and their corresponding checkout URLs
public $checkout_urls = [
347536 => 'https://dharmasun.shedrub1.site/checkouts/tte-full/', // en
347545 => 'https://dharmasun.shedrub1.site/de/checkouts/tte-full/', // de
// Add more entries as needed
];
public function __construct() {
@xlplugins
xlplugins / wfocu_custom_product_price
Created April 15, 2021 10:25
custom upsell pricing based on order total #Upstroke
add_filter( 'wfocu_offer_data', 'wfocu_custom_alter_price', 12, 3 );
function wfocu_custom_alter_price( $output, $offer_data, $is_front ) {
$percentage_discount_on_order = 50; //put your dynamic percentage discount amount here
if ( true === $is_front ) {
foreach ( $output->products as &$product ) {
if ( is_a( $product->data, 'WC_Product' ) ) {