Файл отвечающий за работу ТАБСов (которые по умолчанию работают настранице товара) находится здесь:
Добавление для регистрации данного скрипта происходит так:
И собственно сам арегистрация скрипта:
Добавление регистрации и сама регистрация происходят в файле
Еще есть хук:
Переопределение подключения js скриптов в WooCommerce:
https://ru.stackoverflow.com/questions/ ... oocommerce
Код: Выделить всё
/wp-content/plugins/woocommerce/assets/js/frontend/single-product.js
Добавление для регистрации данного скрипта происходит так:
Код: Выделить всё
'wc-single-product' => array(
'src' => self::get_asset_url( 'assets/js/frontend/single-product' . $suffix . '.js' ),
'deps' => array( 'jquery' ),
'version' => $version,
),
И собственно сам арегистрация скрипта:
Код: Выделить всё
private static function register_script( $handle, $path, $deps = array( 'jquery' ), $version = WC_VERSION, $in_footer = true ) {
self::$scripts[] = $handle;
wp_register_script( $handle, $path, $deps, $version, $in_footer );
}
Добавление регистрации и сама регистрация происходят в файле
Код: Выделить всё
/wp-content/plugins/woocommerce/includes/class-wc-frontend-scripts.php
Еще есть хук:
Код: Выделить всё
в файлеadd_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
Код: Выделить всё
/wp-content/plugins/woocommerce/includes/wc-template-hooks.php
Переопределение подключения js скриптов в WooCommerce:
Код: Выделить всё
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
if ( is_product() ) {
wp_dequeue_script( 'wc-single-product' );
wp_enqueue_script( 'my-wc-single-product', get_template_directory_uri() . '/js/single-product.min.js', array( 'jquery' ) );
}
}
https://ru.stackoverflow.com/questions/ ... oocommerce