/*!/wp-content/themes/astra-child/style.css*/<?php //==============================================================================// 1. CORE WOOCOMMERCE CHECKOUT OPTIMIZATION RULES //==============================================================================add_filter('woocommerce_checkout_redirect_empty_cart','__return_false');add_filter('woocommerce_checkout_update_order_review_expired','__return_false');// Directly handle immediate redirection calls natively inside the WooCommerce engine add_filter('woocommerce_add_to_cart_redirect','misha_skip_cart_redirect_checkout');function misha_skip_cart_redirect_checkout($url){return wc_get_checkout_url(/buy/wp-content/themes/astra-child/)}//==============================================================================// 2. SAFELY DEQUEUE CART FRAGMENT SCRIPTS TO PREVENT CHECKOUT STALLING //==============================================================================add_action('wp_enqueue_scripts','disable_wc_cart_fragments_on_checkout',99);function disable_wc_cart_fragments_on_checkout(){if (is_checkout() || is_order_received_page()){wp_dequeue_script('wc-cart-fragments')}}//==============================================================================// 3. PARENT AND CHILD THEME STYLESHEETS REGISTRATION //==============================================================================function my_theme_enqueue_styles(){$parent_style='astra';$child_style='astra-child';wp_enqueue_style($parent_style,get_template_directory_uri() . '/style.css');wp_enqueue_style($child_style,get_stylesheet_uri())}add_action('wp_enqueue_scripts','my_theme_enqueue_styles');//==============================================================================// 4. CUSTOM DYNAMIC DATE UTILITY SHORTCODE ([mydate]) //==============================================================================function mydate_function(){date_default_timezone_set('GMT');return date('l, \\t\h\e jS \of F Y',strtotime('-2 weekdays'))}add_shortcode('mydate','mydate_function');//==============================================================================// 5. CLEAN SINGLE-INSTANCE CURRENT YEAR SHORTCODE ([year]) //==============================================================================function year_shortcode(){return date('Y')}add_shortcode('year','year_shortcode');//==============================================================================// 6. INSTANT REDIRECT TO STATIC NON-CMS THANK YOU PAGE (PASSED SECURELY VIA URL) //==============================================================================add_action('woocommerce_thankyou','redirect_to_static_thankyou',10,1);function redirect_to_static_thankyou($order_id){if (! $order_id){return}// Grab the order object from the backend database natively $order=wc_get_order($order_id);if (! $order){return}// Extract names and cleanly urlencode them to handle special characters or spaces safely $first_name=urlencode($order->get_billing_first_name());$last_name=urlencode($order->get_billing_last_name());// Build the super-fast static path targeting your non-CMS index.php file $static_url="https://yoursleepbetterstore.com" . $first_name . "&ln=" . $last_name;// Execute an instantaneous browser redirect out of WordPress wp_redirect($static_url);exit}