Chủ Nhật, 1/06/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.

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

Trending.

HuananZhi X79 / X99 Motherboard BIOS POST codes

HuananZhi X79 / X99 Motherboard BIOS POST codes

01/01/2025
Tạo file IMG Windows.GZ bằng VM VirtualBox để cài đặt trên VPS Digitalocean, Linode

Tạo file IMG Windows.GZ bằng VM VirtualBox để cài đặt trên VPS Digitalocean, Linode

31/12/2024
Xóa, Sửa, Nâng dung lượng RAM ẢO – Swap trên Ubuntu

Xóa, Sửa, Nâng dung lượng RAM ẢO – Swap trên Ubuntu

01/01/2025
Cài đặt AApanel & TOR network

Cài đặt AApanel & TOR network

01/01/2025
Tăng / Giảm giá SALE toàn bộ cửa hàng, Xóa Giá Sale

Tăng / Giảm giá SALE toàn bộ cửa hàng, Xóa Giá Sale

01/01/2025
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