Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@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' ) ) {
@xlplugins
xlplugins / gist:bfcfab5b057e1c0a0719b9dccce5d7df
Created February 4, 2021 08:22
unset link on xl thank you page
add_filter ( 'woocommerce_order_item_permalink' , '__return_false' );
add_action( 'woocommerce_account_downloads_column_download-product','xlwcty_remove_hyper_link_from_download_product');
function xlwcty_remove_hyper_link_from_download_product($download)
{
echo esc_html( $download['product_name'] );
}
@xlplugins
xlplugins / wffn_show_menu_upsell.php
Last active February 17, 2021 10:45
Allow upsell menu to show to the funnel builder users #funel builder
add_filter('wffn_show_menu_upsell','__return_true');