Hide ‘Order Again’ Button for Active Subscription Customers
body.tag-has-active-subscription p.order-again { display: none; }Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
body.tag-has-active-subscription p.order-again { display: none; }Continue reading
(function () { const fieldSelectors = [ ‘#billing_phone_field’, ‘#billing_company_field’, ‘#billing_address_1_field’, ‘#billing_address_2_field’, ‘#billing_city_field’, ‘#billing_postcode_field’, ‘#billing_state_field’, ‘#billing_country_field’ ]; const klaviyoSelectors = [ ‘#kl_newsletter_checkbox_field’, ‘#kl_sms_consent_checkbox_field’ ]; function setVisibility(selectors, show) { selectors.forEach(selector => { const el = document.querySelector(selector); if (el) { el.style.display = show…Continue reading
document.addEventListener(‘DOMContentLoaded’, function () { const observer = new MutationObserver(function () { const codeInput = document.querySelector(‘input[name=”cev_billing_email”]’); if (codeInput && !codeInput.hasAttribute(‘inputmode’)) { codeInput.setAttribute(‘inputmode’, ‘numeric’); } }); observer.observe(document.body, { childList: true, subtree: true }); });Continue reading
if ( ! function_exists( ‘rd_wc_subscription_renewal_coupon_locked_context’ ) ) { function rd_wc_subscription_renewal_coupon_locked_context(): bool { if ( is_admin() && ! wp_doing_ajax() ) { return false; } if ( ! function_exists( ‘WC’ ) ) { return false; } if ( function_exists( ‘wcs_cart_contains_renewal’ ) &&…Continue reading
add_filter( ‘wpf_woocommerce_subscription_sync_fields’, ‘rd_wpf_skip_inactive_subscription_sync_when_customer_has_active_subscription’, 10, 2 ); function rd_wpf_skip_inactive_subscription_sync_when_customer_has_active_subscription( $update_data, $subscription ) { if ( ! is_object( $subscription ) || ! method_exists( $subscription, ‘get_status’ ) || ! method_exists( $subscription, ‘get_user_id’ ) || ! method_exists( $subscription, ‘get_id’ ) ) { return $update_data;…Continue reading
add_filter( ‘iconic_wds_skip_cookie’, function() { return true; } );Continue reading
add_filter( ‘sptb_frequency_change_next_payment’, function( $bool, $user_id, $subscription ) { return false; }, 10, 3 );Continue reading
/** * Change wording of next payment date changed confirmation message via Toolbox for Subscriptions plugin from ‘shipment’ to ‘payment’ **/ add_filter( ‘jgtb_date_renewal_successful_message’, function( $message, $subscription ) { return ‘Next payment date has been successfully updated.’; }, 10, 2 );…Continue reading
add_filter( ‘jgtb_change_intervals’, function( $intervals, $subscription ) { foreach ( $intervals as $key => $interval ) { if ( ! in_array( $key, array( 1, 2 ) ) ) { // Numbers indicate which option (1 means weekly, 2 means every 2nd…Continue reading
add_filter( ‘woocommerce_product_description_heading’, ‘custom_change_description_heading_for_specific_categories’ ); function custom_change_description_heading_for_specific_categories( $heading ) { global $product; if ( ! is_product() || ! $product instanceof WC_Product ) { return $heading; } // Check if product has either ‘meals’ or ‘snacks’ category if ( has_term( [ ‘meals’,…Continue reading