Thứ Hai, 18/08/2025
Loading...
  • Login
Hoàng Giang Nam Blog
  • Home
  • WordPress
    • WordPress
    • Woocommerce
  • Windows
  • Office
  • Phần Mềm
  • Thủ thuật
  • Linux
    • Ubuntu
    • CentOS
    • VPS – Server
    • Web Server
No Result
View All Result
Hoàng Giang Nam Blog
  • Home
  • WordPress
    • WordPress
    • Woocommerce
  • Windows
  • Office
  • Phần Mềm
  • Thủ thuật
  • Linux
    • Ubuntu
    • CentOS
    • VPS – Server
    • Web Server
No Result
View All Result
  • Login
Hoàng Giang Nam Blog
No Result
View All Result
Home Wordpress Woocommerce
Delete custom field in database wordpress

Hiển Thị Giá Trị Custom Field – ACF

admin by admin
01/01/2025
Share on FacebookShare on Twitter

Bắt buộc cài plugin ACF nhé

/* #################### Hiển thị giá trị Custom Field sau Add To Cart - Yêu cầu ACF #################### */
function hgn_display_custom_field() {
    global $post;

    // Lấy sản phẩm hiện tại
    $product = wc_get_product($post->ID);

    // Lấy giá trị Custom Field 'zz_author_text'
    $author_text = $product->get_meta('zz_author_text');

    // Kiểm tra và hiển thị nếu có giá trị
    if ($author_text) {
        echo '<div class="custom-author-text">';
        echo esc_html($author_text);
        echo '</div>';
    }
}

// Thêm hook hiển thị custom field
add_action('woocommerce_before_add_to_cart_form', 'hgn_display_custom_field');

/* ################### End #################### */

 

Tags: Woocommerce
admin

admin

Next Post
Hiển thị thêm nút Demo – Mua hàng Tiki, Shopee…

Hiển thị thêm nút Demo - Mua hàng Tiki, Shopee...

Please login to join discussion

Recommended.

Tự động cập nhật bản ghi DNS khi thay đổi IP

Tự động cập nhật bản ghi DNS khi thay đổi IP

01/01/2025
Sử dụng Nginx làm Reverse Proxy cho nhiều trang web

Sử dụng Nginx làm Reverse Proxy cho nhiều trang web

18/12/2024

Trending.

HuananZhi X79 / X99 Motherboard BIOS POST codes

HuananZhi X79 / X99 Motherboard BIOS POST codes

01/01/2025
Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

19/12/2024
Tổng hợp download link ISO Windows

Tổng hợp download link ISO Windows

31/12/2024
Nginx: 413 – Request Entity Too Large Error and Solution

Nginx: 413 – Request Entity Too Large Error and Solution

01/01/2025
Cấu trúc template của Woocommerce

Cấu trúc template của Woocommerce

19/12/2024
Hoàng Giang Nam

Blog chia sẽ kiến thức lập trình, source code, themes, plugin, phần mềm & thủ thuật máy tính...

Follow Us

Danh mục

  • CentOS
  • Chung
  • Server Email
  • Thủ thuật máy tính
  • Ubuntu
  • VPS – Server
  • Web Server
  • Windows
  • Woocommerce
  • Wordpress

Recent News

Disable Web Search Results in Windows 10/11 Start Menu

16/01/2025
Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

19/12/2024
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2024 Hoanggiangnam.com

No Result
View All Result
  • Home
  • Phần Mềm
  • Thủ thuật máy tính
  • WordPress
  • Ubuntu
  • Office
  • Photography
  • Windows

© 2024 Hoanggiangnam.com

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Click to Copy