Thứ Hai, 30/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.

Delete custom field in database wordpress

Delete custom field in database wordpress

01/01/2025
Fix lỗi 413 Request Entity Too Large

Fix lỗi 413 Request Entity Too Large

19/12/2024

Trending.

HuananZhi X79 / X99 Motherboard BIOS POST codes

HuananZhi X79 / X99 Motherboard BIOS POST codes

01/01/2025
Tổng hợp download link ISO Windows

Tổng hợp download link ISO Windows

31/12/2024

Cách tính số lần sạc của pin laptop Windows

19/12/2024
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
Thay đổi port SSH của VPS

Thay đổi port SSH của VPS

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