Skip to content
  • HaiDM - Wordpress Developer

  • Trang chủ
  • Chia sẻ
  • Dự án Wordpress
  • Dự án ReactJS

woocommerce

Chia sẻ code thêm “- x%” vào sau giá của Woo trong chi tiết sản phẩm

Chia sẻ code thêm “- x%” vào sau giá của Woo trong chi tiết sản phẩm

calendar 02/07/2026 clock 12:30 avatar HaiDM
Code thêm vào wp-content/themes/{your-theme}/functions.php của theme nhé add_filter('woocommerce_format_sale_price', 'add_sale_price_percentage', 20, 3 ); function add_sale_price_percentage( $price, $regular_price, $sale_price ){ // Strip html tags and currency (we keep only the float number) $regular_price = strip_tags( $regular_price ); $regular_price = (float) preg_replace('/[^0-9.]+/', '', $regular_price); $sale_price = strip_tags( $sale_price ); $sale_price = (float) preg_replace('/[^0-9.]+/', '', $sale_price); // Percentage text […]
Xem chi tiết »
Your theme does not declare WooCommerce support

Your theme does not declare WooCommerce support

calendar 02/07/2026 clock 12:04 avatar HaiDM
Khi bạn tạo theme cho woocommerce mà bị thông báo lỗi như này thì hãy thêm đoạn code sau vào theme nhé. như vậy sẽ chuyên nghiệp hơn cho theme của bạn ^^. Your theme does not declare WooCommerce support – if you encounter layout issues please read our integration guide or choose a WooCommerce […]
Xem chi tiết »
  • contact icon
  • contact icon
to top
  • icon
  • icon
  • icon

Copyright ©2025 All rights reserved