Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@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 / 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');
@xlplugins
xlplugins / Collapsible order summary on mobile open on first load and then can close on click
Last active December 28, 2021 06:52
Collapsible order summary on mobile open on first load and then can close on click
add_action( 'wfacp_internal_css', 'exute_custom_aero_js' );
function exute_custom_aero_js() {
?>
<style>
@media (min-width: 992px)and (max-width: 1366px) {
.wfacp_collapsible_order_summary_wrap.wfacp_tablet.wfacp_mobile {
display: none;
}
}
@xlplugins
xlplugins / do-not-print-cart-error-notice-on-checkout.php
Created August 21, 2020 10:32
do not print cart error notice on checkout page
<?php
add_filter( 'wfacp_print_cart_error_notice', '__return_false' );
?>
@xlplugins
xlplugins / Do not assign billing email as username in aerocheckout and allow special character in email
Last active February 23, 2022 07:13
Allow special character in email and Do not assign billing email as username in aerocheckout
add_filter( 'wfacp_assign_email_as_a_username', '__return_false' );
<?php
add_filter( 'wfob_product_raw_data', function ( $raw_data, $product ) {
/**
* @var $product WC_Product
*/
$raw_data['regular_price'] = $product->get_regular_price();
$raw_data['price'] = $product->get_price();
return $raw_data;