// 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 ) . '
';
}
Nước khoáng Tiền Hải 19L - Nước khoáng
Skip to content
zoritoler imol –
Great tremendous things here. I am very satisfied to peer your article. Thanks so much and i’m having a look ahead to contact you. Will you please drop me a e-mail?
https://www.zoritolerimol.com
prodentim reviews –
Hello! I just would like to give a huge thumbs up for the great info you have here on this post. I will be coming back to your blog for more soon.
https://youtu.be/OQ6s7_aD0p4
Meetup 私人老号 –
Thankyou for helping out, great info .
https://linkedin.im/goods/28.html
แชทวิดีโอ Shagle –
I’d need to verify with you here. Which isn’t one thing I normally do! I enjoy studying a submit that will make folks think. Additionally, thanks for permitting me to remark!
https://vibragame.biz/th/
cakra111 –
of course like your web site however you have to check the spelling on several of your posts. A number of them are rife with spelling issues and I to find it very bothersome to inform the reality on the other hand I¦ll certainly come again again.
https://cakra111.com/
china metal injection molding parts –
Thanks for another informative web site. Where else could I get that kind of info written in such an ideal way? I’ve a project that I am just now working on, and I’ve been on the look out for such information.
https://mikeshoppingroom.com/product-category/mim-parts/
slot depo 10k –
You are my inspiration , I have few blogs and sometimes run out from to brand : (.
https://owlsdays.com/category/entertainment/
slot online –
Hey! Would you mind if I share your blog with my zynga group? There’s a lot of folks that I think would really appreciate your content. Please let me know. Cheers
https://alfutuh.ponpes.id/
slot scatter hitam –
Hey! Do you know if they make any plugins to safeguard against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any suggestions?
https://www.belandnev.com/
fdertol mrtokev –
I truly wanted to write a small comment to be able to thank you for some of the amazing pointers you are sharing at this site. My prolonged internet investigation has at the end been compensated with reasonable ideas to exchange with my best friends. I ‘d tell you that most of us site visitors are definitely endowed to exist in a notable website with very many outstanding individuals with valuable concepts. I feel somewhat grateful to have encountered your web page and look forward to tons of more entertaining times reading here. Thanks a lot again for a lot of things.
https://www.fdertolmrtokev.com
29 empire –
I got what you mean ,saved to bookmarks, very nice web site.
https://freshkitchenboca.com/menu/
GordonGed –
казино без депозита Топ казино с бездепозитными бонусами – это список проверенных и надежных онлайн-казино, предлагающих самые выгодные условия для игры без предварительного пополнения счета.
LannyGasia –
установка электрического карниза Электрический карниз: Симфония комфорта и технологичности в вашем доме. Откройте для себя мир, где управление светом становится легким и интуитивно понятным, а шторы – не просто элемент декора, а часть интеллектуальной системы вашего жилища.
pultrusion tooling –
Perfect work you have done, this site is really cool with good information.
https://incomepultrusion.com/pultrusion-die/
togel 4d –
Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You obviously know what youre talking about, why waste your intelligence on just posting videos to your blog when you could be giving us something enlightening to read?
https://www.ancientfutureworship.com/
tlover tonet –
Saved as a favorite, I really like your blog!
http://www.tlovertonet.com/
headhunting –
Hello my friend! I want to say that this article is amazing, nice written and include almost all vital infos. I’d like to see more posts like this.
https://oveersea.com/
sblc provider –
I haven¦t checked in here for a while because I thought it was getting boring, but the last few posts are great quality so I guess I¦ll add you back to my daily bloglist. You deserve it my friend 🙂
https://www.wonderlandgmbh.com
raja botak –
Hmm it looks like your blog ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I too am an aspiring blog blogger but I’m still new to everything. Do you have any tips for inexperienced blog writers? I’d really appreciate it.
https://www.cavecitychristian.com/index.cfm
droversointeru –
Great work! This is the type of info that should be shared around the net. Shame on Google for not positioning this post higher! Come on over and visit my website . Thanks =)
https://www.droversointeru.com