Skip to content

Instantly share code, notes, and snippets.

@AjayMathesh
AjayMathesh / UpsellWP: Reload page after adding cart-upsells offer
Created April 16, 2025 08:20
UpsellWP: Reload page after adding cart-upsells offer
add_filter('cuw_offer_reload_page', function ($reload, $campaign_type) {
if ($campaign_type == 'cart_upsells') {
return true;
}
return $reload;
},10,2);
@AjayMathesh
AjayMathesh / UpsellWP: Post-purchase upsells payment support for Webtoffee stripe(cc)
Created April 4, 2025 04:53
UpsellWP: Post-purchase upsells payment support for Webtoffee stripe(cc)
add_filter('cuw_post_purchase_supported_payment_gateways', function ($gateways) {
$gateways['eh_stripe_pay'] = esc_html__('Stripe By WebToffee(CC)', 'payment-gateway-stripe-and-woocommerce-integration');
return $gateways;
});
@AjayMathesh
AjayMathesh / UpsellWP Side Cart : Show Side cart while clicking elementor cart menu
Created March 31, 2025 09:55
UpsellWP Side Cart : Show Side cart while clicking elementor cart menu
add_action('wp_footer', function () {
?>
<script>
jQuery('.elementor-menu-cart__wrapper').on('click', function () {
jQuery('.uwpmc-widget').trigger('click');
});
</script>
<?php
}, 100);
@AjayMathesh
AjayMathesh / UpsellWP: Add Product Image Attributes
Created March 26, 2025 05:04
UpsellWP: Add Product Image Attributes
add_filter('cuw_product_image_attributes', function ($attributes, $product) {
$attributes['alt'] = __('The Alternative Text', 'checkout-upsell-woocommerce'); //Here You can change your own text
return $attributes;
},10,2);
@AjayMathesh
AjayMathesh / UpsellWP: Remove Filter Everything Pro Plugin JS Scripts
Last active March 21, 2025 10:55
UpsellWP: Remove Filter Everything Pro Plugin JS Scripts
add_filter('script_loader_src', function($src, $handle) {
if (is_admin() && !empty($_GET['page']) && $_GET['page'] === 'checkout-upsell-woocommerce') {
if (strpos($src, 'filter-everything-pro/assets/js/select2/select2.min.js') !== false) {
return false;
}
}
return $src;
}, 10000, 2);
@AjayMathesh
AjayMathesh / UpsellWP: Remove Filter Everything PRO plugin select2 styles
Last active March 21, 2025 10:56
UpsellWP: Remove Filter Everything PRO plugin select2 styles
add_filter('style_loader_src', function($src, $handle) {
if (is_admin() && !empty($_GET['page']) && $_GET['page'] === 'checkout-upsell-woocommerce') {
if (strpos($src, 'filter-everything-pro/assets/css/select2/select2.min.css') !== false) {
return false;
}
}
return $src;
}, 10000, 2);
@AjayMathesh
AjayMathesh / UpsellWP: Post purchase -> PaymentFlo Credit card payment support
Last active March 19, 2025 11:36
UpsellWP: Post purchase -> PaymentFlo Credit card payment support
add_filter('cuw_post_purchase_supported_payment_gateways', function ($gateways) {
$gateways['paymentflo_payment_savecc'] = esc_html__('PaymentFlo(CC)', 'paymentflo');
return $gateways;
});
@AjayMathesh
AjayMathesh / UpsellWP: Fix CUW Modal Overlay issue
Created March 18, 2025 09:02
UpsellWP:Fix CUW Modal Overlay issue
add_action('admin_head', function () { ?>
<style>
#cuw-page #overlay {
z-index: 0 !important;
}
</style>
<?php }) ?>
@AjayMathesh
AjayMathesh / UpsellWP: Redirect to checkout while closing popup
Created February 27, 2025 07:50
UpsellWP: Redirect to checkout while closing popup
add_action('wp_footer', function () {
$checkout_url = wc_get_checkout_url();
?>
<script>
jQuery(document).on('click', '.cuw-modal .cuw-modal-close', function(e) {
e.preventDefault();
window.location.replace("<?php echo $checkout_url; ?>");
})
</script>
<?php },100); ?>
@AjayMathesh
AjayMathesh / UpsellWP: FBT Exclude on sale products
Created February 21, 2025 07:21
UpsellWP: FBT Exclude onsale products
add_filter('cuw_fbt_product_ids_to_display', function ($ids) {
if (!empty($ids) && is_array($ids)
&& function_exists('wc_get_product_ids_on_sale')) {
$on_sale_ids = wc_get_product_ids_on_sale();
$ids = array_diff($ids, $on_sale_ids);
}
return $ids;
});