add_filter( 'woocommerce_get_price_html', 'override_default_price_html', 100, 2 );
function dw_change_default_price_html( $price,$product ){
if ( $product->price > 0 ) {
if ( $product->price && isset( $product->regular_price ) ) {
$from = $product->regular_price;
$to = $product->price;
return ( ( is_numeric( $to ) ) ? woocommerce_price( $to ) : $to ) .'<span>'. ( ( is_numeric( $from ) ) ? woocommerce_price( $from ) : $from ) .' </span>';
} else {
$to = $product->price;
return '<span>' . ( ( is_numeric( $to ) ) ? woocommerce_price( $to ) : $to ) . '</span>';
}
} else {
return __( 'Free!', 'woocommerce' );
}
}
<span class="price"><?php echo $price_html; ?></span>
на <span class="product_price"><?php echo $price_html; ?></span>
<?php echo wp_kses_post( $availability ); ?>
@media screen and (max-width:480px){
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
width: 42.5%;
}
}
add_filter('woocommerce_available_payment_gateways', 'yourslug_filter_gateways', 10);
function yourslug_filter_gateways($gateways)
{
$current_user = wp_get_current_user();
$role = $current_user->roles;
global $woocommerce;
/* добавить роль в условие или метод оплаты, который нужно исключить*/
if ($role[0] == 'administrator') {
unset($gateways['cod']);
}
return $gateways;
}
:first-child
esc_html
все равно нужно оставить. function vpank_replace_jquery() {
wp_deregister_script('jquery');
wp_enqueue_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js', array(), null, true);
}
add_action('wp_enqueue_scripts', 'vpank_replace_jquery');
href="<?php echo esc_url_raw( home_url( '/' ) ); ?>"
span