// Add custom Theme Functions here
//CODE LAY LUOT XEM
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return "01 lượt xem";
}
return $count.' lượt xem';
}
// CODE DEM LUOT XEM
function setPostViews($postID) {
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
}else{
$count++;
update_post_meta($postID, $count_key, $count);
}
}
//CODE HIEN THI SO LUOT XEM BAI VIET TRONG DASHBOARDH
add_filter('manage_posts_columns', 'posts_column_views');
add_action('manage_posts_custom_column', 'posts_custom_column_views',5,2);
function posts_column_views($defaults){
$defaults['post_views'] = __('Views');
return $defaults;
}
function posts_custom_column_views($column_name, $id){
if($column_name === 'post_views'){
echo getPostViews(get_the_ID());
}
}
/*Sắp xếp lại thứ tự các field*/
add_filter("woocommerce_checkout_fields", "order_fields");
function order_fields($fields) {
//Shipping
$order_shipping = array(
"shipping_last_name",
"shipping_phone",
"shipping_address_1"
);
foreach($order_shipping as $field_shipping)
{
$ordered_fields2[$field_shipping] = $fields["shipping"][$field_shipping];
}
$fields["shipping"] = $ordered_fields2;
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields',99 );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_country']);
unset($fields['billing']['billing_city']);
unset($fields['billing']['billing_state']);
unset($fields['billing']['billing_address_2']);
$fields['billing']['billing_last_name'] = array(
'label' => __('Họ và tên', 'devvn'),
'placeholder' => _x('Nhập đầy đủ họ và tên của bạn', 'placeholder', 'devvn'),
'required' => true,
'class' => array('form-row-wide'),
'clear' => true
);
$fields['billing']['billing_address_1']['placeholder'] = 'Ví dụ: Số xx Ngõ xx Phú Kiều, Bắc Từ Liêm, Hà Nội';
unset($fields['shipping']['shipping_company']);
unset($fields['shipping']['shipping_postcode']);
unset($fields['shipping']['shipping_country']);
unset($fields['shipping']['shipping_city']);
unset($fields['shipping']['shipping_state']);
unset($fields['shipping']['shipping_address_2']);
$fields['shipping']['shipping_phone'] = array(
'label' => __('Điện thoại', 'devvn'),
'placeholder' => _x('Số điện thoại người nhận hàng', 'placeholder', 'devvn'),
'required' => true,
'class' => array('form-row-wide'),
'clear' => true
);
$fields['shipping']['shipping_last_name'] = array(
'label' => __('Họ và tên', 'devvn'),
'placeholder' => _x('Nhập đầy đủ họ và tên của người nhận', 'placeholder', 'devvn'),
'required' => true,
'class' => array('form-row-wide'),
'clear' => true
);
$fields['shipping']['shipping_address_1']['placeholder'] = 'Ví dụ: Số xx Ngõ xx Phú Kiều, Bắc Từ Liêm, Hà Nội';
return $fields;
}
add_action( 'woocommerce_admin_order_data_after_shipping_address', 'my_custom_checkout_field_display_admin_order_meta', 10, 1 );
function my_custom_checkout_field_display_admin_order_meta($order){
echo '
'.__('Số ĐT người nhận').': ' . get_post_meta( $order->get_id(), '_shipping_phone', true ) . '
';
}
Cây nước nóng lạnh Daiwa JX1 - Nước khoáng
Skip to content
Cây nước nóng lạnh Daiwa JX1
Cây nước nóng lạnh Daiwa JX-1 là sản phẩm quen thuộc trên thị trường Việt Nam từ 10 năm nay, được nhập khẩu nguyên chiếc từ Đài loan, với những tính năng ưu việt, đa dạng các mẫu mã cho người dùng lựa chọn kiểu dáng phù hợp nhất với nhu cầu
Willard Schwartzbach –
I have been browsing online greater than 3 hours today, but I by no means found any fascinating article like yours. It’s beautiful value enough for me. In my view, if all site owners and bloggers made good content as you did, the web will be much more helpful than ever before.
https://www.zoritolerimol.com
slot depo qris terpercaya –
This blog is definitely rather handy since I’m at the moment creating an internet floral website – although I am only starting out therefore it’s really fairly small, nothing like this site. Can link to a few of the posts here as they are quite. Thanks much. Zoey Olsen
https://www.uptv.org/contact-us/
the brain song reviews –
Have you ever thought about publishing an e-book or guest authoring on other sites? I have a blog based on the same subjects you discuss and would really like to have you share some stories/information. I know my viewers would enjoy your work. If you’re even remotely interested, feel free to shoot me an email.
https://youtu.be/GlK-rA6iirg
miminwd login –
Helpful info. Fortunate me I found your website by chance, and I am surprised why this twist of fate did not happened in advance! I bookmarked it.
https://miminwd.it.com/
the brain song –
There is clearly a lot to realize about this. I suppose you made certain nice points in features also.
https://youtu.be/Ze-LhXkmWHk
29 empire –
I wanted to write you one little word to say thank you again for your beautiful opinions you have shared at this time. It has been so extremely generous of people like you to allow without restraint just what a number of us could possibly have sold for an e-book to end up making some dough for their own end, primarily now that you could have tried it if you ever wanted. These tactics in addition served like the great way to be aware that some people have similar fervor the same as my very own to find out a whole lot more in terms of this condition. I am sure there are some more pleasurable sessions up front for people who find out your blog post.
https://www.aslwithandrew.com/about/
29empire –
I really appreciate this post. I’ve been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thx again
https://www.thegrandsouthseakhaolak.com/accommodation.html
togel 4d –
I think you have mentioned some very interesting details, thankyou for the post.
https://aplacecalledroam.com/
innovazione tecnologica –
Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but other than that, this is wonderful blog. A fantastic read. I’ll certainly be back.
https://www.e-service-online.com/innovazione-tecnologica-tecnologie-idee-innovative/
slot gacor –
Some times its a pain in the ass to read what website owners wrote but this internet site is rattling user genial! .
https://alfutuh.ponpes.id/
qjoker123 –
I am really inspired along with your writing skills as smartly as with the layout for your blog. Is that this a paid subject or did you customize it yourself? Anyway stay up the nice quality writing, it’s uncommon to see a great weblog like this one these days..
https://surat.fh.unitomo.ac.id/
fdertolmrtokev –
I went over this web site and I think you have a lot of fantastic information, saved to favorites (:.
https://www.fdertolmrtokev.com