$rand_index = wp_rand( 0, max );
$result = new stdClass;
if(!empty($variant['sku']) && empty($variant['name']))
$this->db->query('SELECT v.id as variant_id, p.id as product_id FROM __products p LEFT JOIN __variants v ON v.product_id=p.id WHERE p.name=? LIMIT 1', $item['name']);
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/functions.php on line 6221
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/includes/misc.php on line 1282
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/admin-header.php on line 9
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/functions.php on line 6221
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/includes/misc.php on line 1282
[05-Aug-2020 10:37:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/admin-header.php on line 9
[05-Aug-2020 10:37:56 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/pluggable.php on line 1281
[05-Aug-2020 10:37:56 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/pluggable.php on line 1284
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/pluggable.php on line 1281
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/pluggable.php on line 1284
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/http.php on line 494
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/http.php on line 495
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/admin-ajax.php on line 27
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/admin-ajax.php on line 28
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/functions.php on line 6107
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-includes/functions.php on line 6221
[05-Aug-2020 10:37:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/Template/functions.php:616) in /home/public_html/wp-admin/includes/misc.php on line 1282
/**
* Вывод атрибутов на странице товара
*/
function productFeature() {
global $post;
$attribute_names = array( 'pa_razmer-domika', 'pa_materialy' );
foreach ( $attribute_names as $attribute_name ) {
$taxonomy = get_taxonomy( $attribute_name );
if ( $taxonomy && ! is_wp_error( $taxonomy ) ) {
$terms = wp_get_post_terms( $post->ID, $attribute_name );
$terms_array = array();
if ( ! empty( $terms ) ) {
foreach ( $terms as $term ) {
$archive_link = get_term_link( $term->slug, $attribute_name );
$full_line = '<a href="' . $archive_link . '">'. $term->name . '</a>';
array_push( $terms_array, $full_line );
}
echo '<span class="attribute">' . $taxonomy->labels->name . ' ' . implode( $terms_array, ', ' ). '</span>';
}
}
}
}
// Определяем место вывода атрибута
add_action('woocommerce_single_product_summary', 'productFeature', 7);
$product_tabs = apply_filters( 'woocommerce_product_tabs', array() );
if ( ! empty( $product_tabs ) ) : ?>
<div class="row">
<?php foreach ( $product_tabs as $key => $product_tab ) : ?>
<div class="col-6">
<?php
if ( isset( $product_tab['callback'] ) ) {
call_user_func( $product_tab['callback'], $key, $product_tab );
}
?>
</div>
<?php endforeach; ?>
<?php do_action( 'woocommerce_product_after_tabs' ); ?>
</div>
<?php endif; ?>
<?php
$parent_id = 5;
echo '<h2>Услуги</h2>';
# получаем дочерние рубрики
$sub_cats = get_categories( array(
'child_of' => $parent_id,
'hide_empty' => 0
) );
if( $sub_cats ){
foreach( $sub_cats as $cat ){
// Данные в объекте $cat
// $cat->term_id
// $cat->name (Рубрика 1)
// $cat->slug (rubrika-1)
// $cat->term_group (0)
// $cat->term_taxonomy_id (4)
// $cat->taxonomy (category)
// $cat->description ()
// $cat->parent (0)
// $cat->count (14)
// $cat->object_id (2743)
// $cat->cat_ID (4)
// $cat->category_count (14)
// $cat->category_description ()
// $cat->cat_name (Рубрика 1)
// $cat->category_nicename (rubrika-1)
// $cat->category_parent (0)
echo '<h3>'. $cat->name .'</h3>';
# получаем записи из рубрики
$myposts = get_posts( array(
'numberposts' => -1,
'category' => $cat->cat_ID,
'orderby' => 'post_date',
'order' => 'DESC',
) );
# выводим записи
global $post;
foreach($myposts as $post){
setup_postdata($post);
echo '<li><a href="'. get_permalink() .'">'. get_the_title() .'</a></li>';
}
}
wp_reset_postdata(); // сбрасываем глобальную переменную пост
}
.navbar-nav {
width:100%;
justify-content: space-around;
}