<?php
// Add custom Theme Functions here
// function custom_woocommerce_breadcrumb_defaults( $defaults ) {
//     $defaults['breadcrumb'] = array(
//         'cart'     => __('Giỏ Hàng', 'woocommerce'),
//         'checkout' => __('Thanh Toán', 'woocommerce'),
//         'order-received' => __('Hoàn Tất Thanh Toán', 'woocommerce'),
//     );
//     return $defaults;
// }
// add_filter('woocommerce_get_breadcrumb', 'custom_woocommerce_breadcrumb_defaults');

// add_filter( 'woocommerce_breadcrumb_defaults', 'wcc_change_breadcrumb_home_text' );
// function wcc_change_breadcrumb_home_text( $defaults ) {
//     // Change the breadcrumb home text from 'Home' to 'Apartment'
// 	$defaults['checkout'] = 'Thanh Toán';
// 	return $defaults;
// }

// add_filter( 'woocommerce_breadcrumb_defaults', 'wcc_change_breadcrumb_home_text', 20 );

function add_contact_button_for_products_without_price() {
    global $product;
    
    if ( empty( $product->get_price() ) ) {
        echo '<a href="/kangen/contact" class="button alt contact-button">Liên hệ ngay</a>';
    }
}
add_action( 'woocommerce_single_product_summary', 'add_contact_button_for_products_without_price', 25 );
