add_action( ‘wpo_wcpdf_after_shipping_address’, ‘add_custom_billing_fields_to_pdf’, 10, 2 ); function add_custom_billing_fields_to_pdf ($document_type, $order) { if ($document_type == ‘packing-slip’) { $billing_playername = ”; $site_title = get_bloginfo(‘name’); if ($site_title == ‘Oakville Raiders’ || $site_title == ‘Seasiders Baseball Club’ || $site_title == ‘Peninsula Softball Club’) {…Continue reading
add_filter( ‘woocommerce_order_shipping_to_display_shipped_via’, ‘__return_empty_string’ );Continue reading
/** * @snippet Move Order Notes @ WooCommerce Checkout * @how-to businessbloomer.com/woocommerce-customization * @author Rodolfo Melogli, Business Bloomer * @compatible WooCommerce 3.9 * @community https://businessbloomer.com/club/ */ // 1. Hide default notes add_filter( ‘woocommerce_enable_order_notes_field’, ‘__return_false’ ); // 2. Create new billing…Continue reading
add_action(‘woocommerce_checkout_create_order’, ‘sync_shipping_with_billing’, 20, 2); function sync_shipping_with_billing($order, $data) { // Check if the order requires shipping if ( $order->needs_shipping_address() ) { // Copy billing details to shipping details $order->set_shipping_first_name( $data[‘billing_first_name’] ); $order->set_shipping_last_name( $data[‘billing_last_name’] ); $order->set_shipping_phone( $data[‘billing_phone’] ); } /* // Retrieve…Continue reading
add_action( ‘template_redirect’, ’empty_cart_redirection’ ); function empty_cart_redirection(){ if( is_checkout() ) : // Here set the Url redirection // $url_redirection = get_permalink( wc_get_page_id( ‘shop’ ) ); $url_redirection = get_home_url(); // When trying to access cart page if cart is already empty if(…Continue reading
add_filter( ‘wc_add_to_cart_message’, ‘asa_custom_wc_add_to_cart_message’, 10, 2 ); function asa_custom_wc_add_to_cart_message( $message, $product_id ) { $message = sprintf(esc_html__(‘%s has been added to your cart.’), get_the_title( $product_id ) ); return $message; }Continue reading
/** * Hindra åtkomst till /wp-admin för prenumeranter */ add_action( ‘admin_init’, function() { if ( is_user_logged_in() ) { $user = wp_get_current_user(); if ( in_array( ‘subscriber’, (array) $user->roles, true ) ) { if ( ! ( defined( ‘DOING_AJAX’ ) && DOING_AJAX…Continue reading
/** * 2) Dölj admin-baren för prenumeranter */ add_filter( ‘show_admin_bar’, function( $show ) { if ( is_user_logged_in() ) { $user = wp_get_current_user(); if ( in_array( ‘subscriber’, (array) $user->roles, true ) ) { return false; } } return $show; });Continue reading
/** * 1) Omdirigera prenumeranter till startsidan efter inloggning */ add_filter( ‘login_redirect’, function( $redirect_to, $requested_redirect_to, $user ) { if ( $user instanceof WP_User && in_array( ‘subscriber’, (array) $user->roles, true ) ) { return home_url(‘/’); } return $redirect_to; }, 10, 3…Continue reading
// —- Guards so you can import on any site safely if (!function_exists(‘adv_get_config’)) { function adv_get_config($key, $default = null) { // 1) Filter override $filtered = apply_filters(“advision_config_{$key}”, null); if ($filtered !== null) return $filtered; // 2) Constant override (from wp-config.php)…Continue reading