add_filter( 'woocommerce_cart_calculate_fees', 'add_my_fee', 10, 1 );
function add_my_fee() {
$gateway = WC()->session->get( 'chosen_payment_method' );
if ( $gateway == 'paypal' ) {
WC()->cart->add_fee( 'Наценка за метод оплаты который нам не нравится', 100 );
}
}
function custom_posts_per_page( $query ) {
if ( is_admin() || ! $query->is_main_query() ) {
return;
}
if ( $query->is_search() ) {
$query->set( 'posts_per_page', 12 );
}
if ( $query->is_category() ) {
if ( wp_is_mobile() ) {
$query->set( 'posts_per_page', 5 );
} else {
$query->set( 'posts_per_page', 10 );
}
}//endif
}//function
add_action( 'pre_get_posts', 'custom_posts_per_page' );
It is not possible to edit with mobile phones and tablets for the moment. You can only edit pages with Elementor on desktop computers.