function wpp_get_parent_id($product_id) {
$product = get_product( $product_id );
$out = array();
if ( $product->is_type( 'grouped' ) ) {
$grouped = $product->get_grouped();
foreach ( $grouped as $grouped_array ) {
$grouped = new WC_Product( $grouped_array[ 'parent_id' ] );
$out[ 'variation_' . $grouped->id ] ;
}
}
return $out;
}
<?php $i = 0; ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php $i++ ?>
<div class="col-md-<?php if ($i == 1) echo '6'; else echo '4' ?>">
<div class="services-item">
<div class="img">
<img src="<?php bloginfo('template_url'); ?>/img/archive.png" alt="archive">
<span class="price">
<?php the_field('стоимость');?> P
</span>
</div>
<div class="information">
<h3>
<?php echo get_the_title(); ?>
</h3>
<p>
<?php echo get_the_content(); ?>
</p>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php
$category = get_queried_object();
$args = array(
'taxonomy' => 'product_cat',
'show_option_none' => __(''),
'echo' => 1,
'depth' => 1,
'wrap_class' => '',
'level_class' => '',
'child_of' => $category->term_id,
'parent_title_format' => '<h5 style="display:none">%s</h5>',
'current_class' => 'selected'
);
custom_list_categories( $args );
?>
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
if (mail("info@ipgard.com", "Test mail", "Test mail ")) {
echo "ok";
} else {
echo "error";}
?>