Thứ Hai, 9/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
Thông báo WooCommerce: "Bạn cần $$$ để được giao hàng miễn phí!"

Thông báo WooCommerce: “Bạn cần $$$ để được giao hàng miễn phí!”

admin by admin
19/12/2024
Share on FacebookShare on Twitter

WooCommerce: get free shipping if you add "x" money

 

Đoạn mã PHP: Hiển thị số tiền còn lại để đạt đến ngưỡng giao hàng miễn phí

/**
 * @snippet $$$ remaining to Free Shipping @ WooCommerce Cart
 * @how-to Get CustomizeWoo.com FREE
 * @author Rodolfo Melogli
 * @compatible WooCommerce 3.9
 */

add_action('woocommerce_before_cart', 'bbloomer_free_shipping_cart_notice');

function bbloomer_free_shipping_cart_notice() {
    $min_amount = 50; // Thay đổi giá trị này theo ngưỡng miễn phí vận chuyển của bạn
    $current = WC()->cart->subtotal;

    if ($current < $min_amount) {
        $remaining_amount = wc_price($min_amount - $current);
        $added_text = sprintf('Get free shipping if you order %s more!', $remaining_amount);

        $return_to = wc_get_page_permalink('shop');
        $notice = sprintf(
            '<a href="%s" class="button wc-forward">%s</a> %s',
            esc_url($return_to),
            'Continue Shopping',
            $added_text
        );

        wc_print_notice($notice, 'notice');
    }
}

 

 

Tags: Custom themeCustom Woocommerce
admin

admin

Next Post
Cấu trúc template của Woocommerce

Cấu trúc template của Woocommerce

Please login to join discussion

Recommended.

Cấu hình ban đầu sau khi cài đặt WordPress – Giới hạn RAM cho WordPress

Cấu hình ban đầu sau khi cài đặt WordPress – Giới hạn RAM cho WordPress

01/01/2025
Cách thiết lập và lưu trữ nhiều trang web Dịch vụ ẩn TOR bằng VestaCP

Cách thiết lập và lưu trữ nhiều trang web Dịch vụ ẩn TOR bằng VestaCP

18/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
Cài đặt AApanel & TOR network

Cài đặt AApanel & TOR network

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
Dùng thử VPS Linode trong 60 Ngày với 100$ Credit trải nghiệm dịch vụ

Dùng thử VPS Linode trong 60 Ngày với 100$ Credit trải nghiệm dịch vụ

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