add_action('wp_enqueue_scripts', 'theme_enqueue_styles'); function theme_enqueue_styles() { wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css'); wp_enqueue_style('parent-style-woo', get_template_directory_uri() . '/woo-styles.css'); wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style')); } /** * Hide shipping rates when free shipping is available. * Updated to support WooCommerce 2.6 Shipping Zones. * * @param array $rates Array of rates found for the package. * @return array */ // function my_hide_shipping_when_free_is_available( $rates ) { // $free = array(); // foreach ( $rates as $rate_id => $rate ) { // if ( 'free_shipping' === $rate->method_id ) { // $free[ $rate_id ] = $rate; // break; // } // } // return ! empty( $free ) ? $free : $rates; // } // add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_available', 100 ); // /*Modifica el text de la pàgina de checkout "terminos y condiciones"*/ // function translate_text_checkout($translated, $text, $domain) { // if (is_checkout()) { // $translated = str_ireplace('términos y condiciones', 'Términos y Condiciones', $translated); // } // return $translated; // } // add_filter('gettext', 'translate_text_checkout', 10, 3); // add_filter('ngettext', 'translate_text_checkout', 10, 3); // function memory_usage() { // if (is_admin()) { // $mem = function_exists('memory_get_peak_usage') ? round(memory_get_peak_usage(true) / 1024 / 1024, 2) : 0; // echo "