Код: Выделить всё
а также вот код, который, я думаю, выполняет работу по удалению:
Код: Выделить всё
public function hide_price_and_add_to_cart() {
$hide_price_and_add_to_cart = 'yes' === yith_wcmbs_settings()->get_option( 'yith-wcmbs-hide-price-and-add-to-cart' );
if ( $hide_price_and_add_to_cart ) {
global $product;
if ( $product ) {
$downloadable = yith_wcmbs_is_downloadable_product( $product );
$base_product_id = yit_get_base_product_id( $product );
if ( $downloadable && $this->user_has_access_to_product( get_current_user_id(), $base_product_id ) && ( apply_filters( 'yith_wcmb_skip_check_product_needs_credits_to_download', false ) || ! $this->product_needs_credits_to_download( get_current_user_id(), $base_product_id ) ) ) {
$hook = 'woocommerce_single_product_summary';
$to_remove = array(
'woocommerce_template_single_add_to_cart',
'woocommerce_template_single_price',
);
foreach ( $to_remove as $callback ) {
$priority = has_action( $hook, $callback );
if ( false !== $priority ) {
remove_action( $hook, $callback, $priority );
}
}
do_action( 'yith_wcmbs_hide_price_and_add_to_cart' );
}
}
}
}
Я попробовал удалить часть $hook из код плагина, но он не работает
Подробнее здесь: https://stackoverflow.com/questions/759 ... -button-in