This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * FKCart category based free gift rewards. | |
| * 1876 => carnes-del-corral | |
| * 29711 => carnes-del-mar | |
| */ | |
| add_filter( 'fkcart_rewards_list', 'my_fkcart_category_rewards_list', 999 ); | |
| add_filter( 'fkcart_gift_products', 'my_fkcart_category_gift_products', 999, 2 ); | |
| add_action( 'wp_footer', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: WP ZIP Downloader | |
| * Description: Download installed plugins and themes as ZIP files without ZipArchive. | |
| * Version: 1.0.0 | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Show the cumulative coupon discount inside the FunnelKit sliding cart, | |
| * just above the checkout button. | |
| */ | |
| add_action( 'fkcart_before_checkout_button', 'betterwood_fkcart_discount_anzeigen' ); | |
| function betterwood_fkcart_discount_anzeigen() { | |
| if ( is_null( WC()->cart ) || WC()->cart->is_empty() ) { | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'fkcart_enable_item_link', function ( $show, $cart_item_key, $cart_item ) { | |
| add_filter( 'woocommerce_cart_item_permalink', 'fkcart_custom_permalink', 10, 3 ); | |
| return $show; | |
| }, 10, 3 ); | |
| function fkcart_custom_permalink( $permalink, $cart_item, $cart_item_key ) { | |
| remove_filter( 'woocommerce_cart_item_permalink', 'fkcart_custom_permalink', 10 ); | |
| $urls = array( | |
| 123 => 'https://example.com/page-a/', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('wp_footer', function () { | |
| if ( ! function_exists('is_checkout') || ! is_checkout() ) return; | |
| ?> | |
| <script> | |
| (function ($) { | |
| var attached = { billing: false, shipping: false }; | |
| function ready() { | |
| return window.google && google.maps && google.maps.places; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Force Sublium Subscribe & Save discount to calculate against | |
| * the product's regular price, not the sale price. | |
| * | |
| * Works on product page, cart, and checkout. | |
| * Place in your child theme's functions.php or a site-specific plugin. | |
| */ | |
| add_filter( 'sublium_wcs_plan_price', 'sublium_sns_discount_on_regular_price', 10, 3 ); | |
| function sublium_sns_discount_on_regular_price( $price, $product, $plan ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'page_template_hierarchy', function( $templates ) { | |
| if ( isset( $_GET['wfty_source'] ) || isset( $_GET['wfocu-si'] ) || isset( $_GET['wfacp_is_checkout_override'] ) ) { | |
| return array_values( array_diff( $templates, array( 'order-confirmation' ) ) ); | |
| } | |
| return $templates; | |
| }, 99 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'woocommerce_checkout_process', 'validate_billing_phone_9_digits' ); | |
| function validate_billing_phone_9_digits() { | |
| $phone = isset( $_POST['billing_phone'] ) ? sanitize_text_field( $_POST['billing_phone'] ) : ''; | |
| // Remove all spaces and non-digit characters before checking | |
| $phone_digits = preg_replace( '/\D/', '', $phone ); | |
| if ( strlen( $phone_digits ) !== 9 ) { | |
| wc_add_notice( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'woocommerce_login_form_end', function () { | |
| if ( ! class_exists( 'WFACP_Common' ) || WFACP_Common::get_id() < 1 ) { | |
| return; | |
| } | |
| $wfacp_id = absint( WFACP_Common::get_id() ); | |
| if ( 'wfacp_checkout' !== get_post_type( $wfacp_id ) ) { | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_email_enabled_customer_new_account', function( $enabled, $object ) { | |
| // Check if we're in a checkout/order processing context with a Sublium plan in cart | |
| if ( WC()->cart && \Sublium_WCS\Includes\Main\Cart::get_instance()->cart_contains_plan() ) { | |
| return false; | |
| } | |
| return $enabled; | |
| }, 10, 2 ); |