Chào bạn, tôi hiểu rồi. Đoạn code mà bạn đang tìm kiếm rất có thể là một hằng số (constant) được thêm vào file wp-config.php để tắt tính năng kiểm tra lỗi của WordPress.

Khi thêm dòng code này, bạn sẽ có thể lưu file trực tiếp trong trang quản trị mà không gặp thông báo yêu cầu dùng FTP nữa.

## ⚠️ Cảnh báo quan trọng
Phương pháp này sẽ TẮT ĐI LỚP BẢO VỆ của WordPress. Điều này có nghĩa là:

Bạn sẽ có thể lưu file từ trang quản trị.

NHƯNG, nếu code bạn lưu bị sai cú pháp, website của bạn sẽ bị lỗi trắng trang ngay lập tức. Lúc đó bạn vẫn sẽ phải dùng File Manager hoặc FTP để sửa lại file bị lỗi.

Hãy chắc chắn rằng bạn đã sao lưu hoặc biết cách phục hồi file trước khi thực hiện.

## Cách thực hiện: Thêm code vào file wp-config.php
Bạn cần truy cập vào hosting một lần cuối cùng để thêm đoạn mã này.

Đăng nhập vào hosting và mở Trình quản lý tệp (File Manager).

Tìm đến thư mục gốc của website, nơi bạn thấy các thư mục như wp-admin, wp-content, wp-includes.

Trong thư mục gốc này, tìm và mở file có tên wp-config.php để sửa.

Kéo xuống gần cuối file, tìm dòng chú thích sau:

PHP

/* That’s all, stop editing! Happy publishing. */
Dán đoạn code dưới đây vào ngay bên trên dòng chú thích đó:

PHP

define( ‘WP_DISABLE_FATAL_ERROR_HANDLER’, true );
File của bạn sẽ trông giống như thế này:

PHP

// … các dòng code khác ở trên …

define( ‘WP_DISABLE_FATAL_ERROR_HANDLER’, true ); // <— Dán vào đây

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
// …
Nhấn "Save Changes" (Lưu thay đổi) để lưu file lại.

Sau khi hoàn tất, bạn có thể quay lại trang quản trị WordPress và thử sửa file functions.php hoặc các file khác. Lỗi yêu cầu dùng FTP sẽ không còn xuất hiện nữa.

<?php

/**

 * The base configuration for WordPress

 *

 * The wp-config.php creation script uses this file during the installation.

 * You don't have to use the website, you can copy this file to "wp-config.php"

 * and fill in the values.

 *

 * This file contains the following configurations:

 *

 * * Database settings

 * * Secret keys

 * * Database table prefix

 * * ABSPATH

 *

 * @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/

 *

 * @package WordPress

 */

// ** Database settings – You can get this info from your web host ** //

/** The name of the database for WordPress */

define( 'DB_NAME', 'jhoyenjbhosting_wp773' );

/** Database username */

define( 'DB_USER', 'jhoyenjbhosting_wp773' );

/** Database password */

define( 'DB_PASSWORD', '5.[6zBSYp3' );

/** Database hostname */

define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */

define( 'DB_CHARSET', 'utf8' );

/** The database collate type. Don't change this if in doubt. */

define( 'DB_COLLATE', '' );

/**#@+

 * Authentication unique keys and salts.

 *

 * Change these to different unique phrases! You can generate these using

 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.

 *

 * You can change these at any point in time to invalidate all existing cookies.

 * This will force all users to have to log in again.

 *

 * @since 2.6.0

 */

define( 'AUTH_KEY',         'wbqt3t2sdttosthqm0oj3qsahs1pzflyvuyp5toewqwkfzznmxud7i2aqs8kpspj' );

define( 'SECURE_AUTH_KEY',  'feskmshlyx7rvrnrnfeafiljsbei4axzmvcyprmkl0qghhoafvf38anc7sfxlhj6' );

define( 'LOGGED_IN_KEY',    'wta5hfqh1nagoda8piune5uroxzemuxspkafvlyxk31zxvdb5dr7omv0u5ov7zad' );

define( 'NONCE_KEY',        'vcapbbqdf7evlniibi8bug7bqarwiqejhjwtawowl6fmbd4tso0mxi4vrij3icyj' );

define( 'AUTH_SALT',        'jri9eeo8a1fz9et5aivqkir58fpwvixdp0drcfslm69kscifykrxojv12ryxtyc0' );

define( 'SECURE_AUTH_SALT', 'ds7li0nwdt5ncrogq6anq426gzq8vqohzr7yoomydbsaa7h2rpjf3egigtur2zh9' );

define( 'LOGGED_IN_SALT',   'aqkop09pyuehs1f2je7z7euiip6whtrnokgitkqaicnidyvtek2qxyelopys7txo' );

define( 'NONCE_SALT',       'p1kkkj6ywt0w5pezcahj1p9fuougde2kwmmfmk9bdzfzcjynfzck8m06arhmfsyq' );

/**#@-*/

/**

 * WordPress database table prefix.

 *

 * You can have multiple installations in one database if you give each

 * a unique prefix. Only numbers, letters, and underscores please!

 *

 * At the installation time, database tables are created with the specified prefix.

 * Changing this value after WordPress is installed will make your site think

 * it has not been installed.

 *

 * @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#table-prefix

 */

$table_prefix = 'wpzi_';

/**

 * For developers: WordPress debugging mode.

 *

 * Change this to true to enable the display of notices during development.

 * It is strongly recommended that plugin and theme developers use WP_DEBUG

 * in their development environments.

 *

 * For information on other constants that can be used for debugging,

 * visit the documentation.

 *

 * @link https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/

 */

define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */

if ( ! defined( 'ABSPATH' ) ) {

define( 'ABSPATH', __DIR__ . '/' );

}

/** Sets up WordPress vars and included files. */

require_once ABSPATH . 'wp-settings.php';

Hiện tiến trình tư duy
Đúng rồi, đây chính là file wp-config.php của bạn.

Tôi đã thêm dòng code cần thiết vào đúng vị trí cho bạn. Bạn chỉ cần xóa toàn bộ nội dung file wp-config.php cũ trên hosting và thay thế bằng toàn bộ nội dung mới dưới đây.
wp-config.php đã được sửa đổi
15:33 16 thg 7

Mở

Sau khi bạn lưu lại file này trên hosting, bạn có thể quay lại trang quản trị WordPress và sửa file functions.php mà không còn gặp thông báo lỗi đó nữa.

Hiện tiến trình tư duy
Lỗi này xảy ra vì code bạn vừa dán vào có thể bị sai cú pháp hoặc xung đột với các đoạn code đã có sẵn trong file functions.php.

Để giải quyết dứt điểm, bạn hãy làm theo cách sau: xóa hết và thay thế bằng một đoạn code tổng hợp duy nhất, sạch sẽ.

### Hướng dẫn sửa lỗi
Truy cập vào hosting: Dùng Trình quản lý tệp (File Manager) hoặc FTP để mở file functions.php trong thư mục theme con của bạn:
wp-content/themes/partdo-child/functions.php

Xóa code cũ: Tìm và xóa toàn bộ các đoạn code tùy chỉnh mà bạn đã thêm vào trước đó liên quan đến việc ẩn giá/dịch thuật. Hãy đưa file functions.php về trạng thái gọn gàng nhất.

Dán code mới: Sao chép và dán duy nhất đoạn code tổng hợp dưới đây vào cuối file.

### Đoạn code tổng hợp cuối cùng
PHP

/**
* ===================================================================
* Thay thế giá sản phẩm bằng văn bản "Liên hệ" và tùy chỉnh giỏ hàng
* (Phiên bản tổng hợp để tránh lỗi cú pháp)
* ===================================================================
*/

// — PHẦN 1: Thay thế giá ở mọi nơi (trang chủ, sản phẩm, cột giá trong giỏ hàng…) —
function final_solution_replace_all_prices( $price, $product ) {
return 'Liên hệ’;
}
add_filter( ‘woocommerce_get_price_html’, ‘final_solution_replace_all_prices’, 9999, 2 );
add_filter( ‘woocommerce_cart_item_price’, ‘final_solution_replace_all_prices’, 9999, 2 );
add_filter( ‘woocommerce_cart_item_subtotal’, ‘final_solution_replace_all_prices’, 9999, 2 );

// — PHẦN 2: Thay thế các dòng TỔNG KẾT ở cuối giỏ hàng và thanh toán —
function final_solution_replace_totals_text( $total ) {
return ‘Chúng tôi sẽ liên hệ lại ngay’;
}
add_filter( ‘woocommerce_cart_subtotal’, ‘final_solution_replace_totals_text’, 9999, 1 );
add_filter( ‘woocommerce_cart_totals_order_total_html’, ‘final_solution_replace_totals_text’, 9999, 1 );

// — PHẦN 3: Dùng JavaScript để cập nhật Mini-Cart (giỏ hàng nhỏ ở header) —
function final_solution_update_ajax_cart() {
?>

jQuery(document).ready(function($) {

function updateFinalMiniCart() {
// Thay thế nội dung của từng sản phẩm trong mini-cart
$(‘.woocommerce-mini-cart-item .quantity’).html(‘Liên hệ’);

// Thay thế tổng tiền ở header và trong mini-cart dropdown
$(‘.site-header .cart-contents .amount, .woocommerce-mini-cart__total .woocommerce-Price-amount’).html(‘Chúng tôi sẽ liên hệ lại ngay’);

// Ẩn các thông báo không cần thiết
$(‘.woocommerce-mini-cart__free-shipping, .woocommerce-mini-cart__empty-message’).hide();
}

// Chạy các hàm khi trang tải xong và khi giỏ hàng thay đổi
updateFinalMiniCart();
$(document.body).on(‘added_to_cart removed_from_cart wc_cart_emptied’, function() {
setTimeout(updateFinalMiniCart, 100);
});

});

<?php
}
add_action('wp_footer', 'final_solution_update_ajax_cart');

Sau khi thay thế hoàn toàn code cũ bằng code mới này và lưu file lại, website của bạn sẽ hoạt động trở lại và tất cả các yêu cầu về việc ẩn giá sẽ được áp dụng đúng.

sửa lỗi này đi

Hiện tiến trình tư duy
Lỗi này xảy ra vì file functions.php của bạn đang chứa nhiều đoạn code cũ và mới xung đột, gây ra lỗi cú pháp.

Để giải quyết dứt điểm, bạn không nên cố gắng sửa từng dòng. Cách nhanh và chính xác nhất là xóa toàn bộ các đoạn code bạn đã thêm vào và thay thế bằng một đoạn code tổng hợp duy nhất dưới đây.

## Giải pháp duy nhất: Xóa hết và thay thế
Truy cập file qua hosting: Dùng Trình quản lý tệp (File Manager) hoặc FTP để mở lại file tại:
wp-content/themes/partdo-child/functions.php

XÓA HẾT CODE CŨ: Tìm và xóa tất cả các hàm và bộ lọc (add_filter) liên quan đến việc ẩn giá, dịch thuật mà bạn đã thêm vào từ các lần hướng dẫn trước.

DÁN CODE MỚI: Dán duy nhất đoạn code tổng hợp, sạch sẽ dưới đây vào cuối file.

### Đoạn code tổng hợp cuối cùng