// Add custom Theme Functions here
/*
* Author: Cu Min
* */
// Remove product cat base
add_filter('term_link', 'devvn_no_term_parents', 1000, 3);
function devvn_no_term_parents($url, $term, $taxonomy) {
if($taxonomy == 'product_cat'){
$term_nicename = $term->slug;
$url = trailingslashit(get_option( 'home' )) . user_trailingslashit( $term_nicename, 'category' );
}
return $url;
}
// Add our custom product cat rewrite rules
function devvn_no_product_cat_parents_rewrite_rules($flash = false) {
$terms = get_terms( array(
'taxonomy' => 'product_cat',
'post_type' => 'product',
'hide_empty' => false,
));
if($terms && !is_wp_error($terms)){
foreach ($terms as $term){
$term_slug = $term->slug;
add_rewrite_rule($term_slug.'/?$', 'index.php?product_cat='.$term_slug,'top');
add_rewrite_rule($term_slug.'/page/([0-9]{1,})/?$', 'index.php?product_cat='.$term_slug.'&paged=$matches[1]','top');
add_rewrite_rule($term_slug.'/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$', 'index.php?product_cat='.$term_slug.'&feed=$matches[1]','top');
}
}
if ($flash == true)
flush_rewrite_rules(false);
}
add_action('init', 'devvn_no_product_cat_parents_rewrite_rules');
/*Sửa lỗi khi tạo mới taxomony bị 404*/
add_action( 'create_term', 'devvn_new_product_cat_edit_success', 10);
add_action( 'edit_terms', 'devvn_new_product_cat_edit_success', 10);
add_action( 'delete_term', 'devvn_new_product_cat_edit_success', 10);
function devvn_new_product_cat_edit_success( ) {
devvn_no_product_cat_parents_rewrite_rules(true);
}
/*
* Dịch giỏ hàng/ Thanh Toán/ Hoàn Tất
*/
add_filter( 'gettext', function ( $strings ) {
$text = array(
'SHOPPING CART' => 'Giỏ Hàng',
'CHECKOUT DETAILS' => 'Thanh Toán',
'ORDER COMPLETE' => 'Hoàn Tất',
'SKU' => 'Mã sản phẩm',
'CATEGORY ARCHIVES' => 'Danh mục',
'Thêm vào giỏ hàng' => 'Thêm vào giỏ',
'Specification' => 'Thông số kỹ thuật',
'Reviews' => 'Đánh giá',
'Show All Categories' => 'Hiện tất cả danh mục',
'No product categories exist.' => 'Không có sản phẩm trong danh mục này!',
'Sorry, it seems that there are no available payment methods. Please contact us if you require assistance or wish to make alternate arrangements.' => 'Không có phương thức thanh toán phù hợp!',
'Shipping Details' => 'Chi tiết giao hàng',
'Nothing Found' => 'Không tìm thấy',
'WEIGHT' => 'Trọng lượng',
'DESCRIPTION' => 'Mô tả',
'ADD TO CART' => 'Thêm vào giỏ hàng',
'BRANDS' => 'Hãng',
'COLOR' => 'Màu sắc',
'Your order' => 'Đơn hàng của bạn'
);
$strings = str_ireplace( array_keys( $text ), $text, $strings );
return $strings;
}, 20 );
Toàn Á thông báo lịch nghỉ tết dương lịch năm 2024
Skip to content Công ty Toàn Á của chúng tôi xin thông báo lịch nghỉ Tết dương lịch năm 2024 cho quý đối tác, khách hàng nắm được và tiện liên hệ công tác. Chúc quý khách một năm mới an khang – thịnh vượng.
Nhằm tạo điều kiện thuận lợi trong việc liên lạc giữa công ty với Quý đối tác, Quý khách hàng cũng như để CBCNV công ty chủ động trong việc sắp xếp thời gian và phương tiện về quê sum họp gia đình, công ty thông báo thời gian nghỉ Tết dương lịch như sau:
Thời gian nghỉ: 01 ngày, thứ hai ngày 01/01/2024. Thời gian làm việc lại: thứ ba, ngày 02/01/2024. Chi tiết thông báo của Công ty Toàn Á: