get('Version')); // Enqueue custom CSS wp_enqueue_style('astra-child-custom-css', get_stylesheet_directory_uri() . '/css/custom.css', array('astra-child-style'), wp_get_theme()->get('Version')); // Enqueue custom JS wp_enqueue_script('astra-child-custom-js', get_stylesheet_directory_uri() . '/js/custom.js', array('jquery'), wp_get_theme()->get('Version'), true); } add_action('wp_enqueue_scripts', 'astra_child_enqueue_styles'); // Function to enable Theme File Editor function enable_theme_file_editor() { if (defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT) { // If DISALLOW_FILE_EDIT is defined and true, redefine it as false to enable the editor define('DISALLOW_FILE_EDIT', false); } } // Hook to admin_menu to ensure the Theme File Editor is available in the admin area add_action('admin_menu', 'enable_theme_file_editor'); /** * shipping-label */ add_action('woocommerce_review_order_before_order_total', function() { $chosen_shipping_methods = WC()->session->get('chosen_shipping_methods'); // Get selected shipping method $shipping_cost = WC()->cart->get_shipping_total(); // Get shipping cost if (WC()->cart->needs_shipping() && !empty($chosen_shipping_methods)) { $shipping_method_id = $chosen_shipping_methods[0]; $packages = WC()->shipping()->get_packages(); $shipping_label = ''; // Find the correct shipping label foreach ($packages as $package) { foreach ($package['rates'] as $rate_id => $rate) { if ($rate_id === $shipping_method_id) { $shipping_label = $rate->get_label(); break; } } } // Display shipping method name + cost if (!empty($shipping_label)) { ?>