add_filter( 'woocommerce_countries', 'v888v_add_new_country' );
function v888v_add_new_country( $countries ) {
$new_countries = [];
/*так, например, выбрать, что оставить*/
foreach($countries as $k => $v){
if($k == 'KZ') $new_countries[$k] = $v;
if($k == 'RU') $new_countries[$k] = $v;
if($k == 'UA') $new_countries[$k] = $v;
}
/*или ввести только то, что нужно*/
$new_countries = array(
'RU' => 'Россия',
);
return $new_countries;
}
add_filter( 'woocommerce_order_item_name', 'display_product_title_as_link', 10, 2 );
function display_product_title_as_link( $item_name, $item ) {
$_product = get_product( $item['variation_id'] ? $item['variation_id'] : $item['product_id'] );
$link = get_permalink( $_product->id );
return '<a href="'. $link .'" rel="nofollow">'. $item_name .'</a>';
}
<?php foreach ( $catalog_orderby_options as $id => $name ) : ?>
<a href="?orderby=<?php echo esc_attr( $id );?>" class="orderby-link"><?php echo esc_html( $name )?></a>
<?php endforeach; ?>
<ul class="products">
<?php
$product_ids_on_sale = wc_get_product_ids_on_sale();
$args = array(
'post_type' => 'product',
'post__in' => array_merge( array( 0 ), $product_ids_on_sale )
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
wc_get_template_part( 'content', 'product' );
endwhile;
} else {
echo __( 'Продуктов не найдено' );
}
wp_reset_postdata();
?>
</ul><!--/.products-->