if ($product_values = $this->features_values->get_features_values(array('product_id'=>$product->id))) {
foreach ($product_values as $pv) {
if (!isset($product->features[$pv->feature_id])) {
$product->features[$pv->feature_id] = $pv;
}
$product->features[$pv->feature_id]->values[] = $pv;
}
}
Array
(
[38] => stdClass Object
(
[id] => 2478
[color] => 000000
[feature_id] => 38
[position] => 2478
[count] => 1
[auto_name_id] =>
[auto_value_id] =>
[type] => color
[url] => color
[in_filter] => 1
[yandex] => 1
[url_in_product] => 1
[to_index] => 0
[value] => Черный
[translit] => chernyj
[name] => Цвет
[values] => Array
(
[0] => stdClass Object
*RECURSION*
)
)
[1] => stdClass Object
(
[id] => 436
[color] => e6e6e6
[feature_id] => 1
[position] => 436
[count] => 1
[auto_name_id] =>
[auto_value_id] =>
[type] => plate
[url] => ves
[in_filter] => 0
[yandex] => 1
[url_in_product] =>
[to_index] => 0
[value] => 170 г
[translit] => 170g
[name] => Вес
[values] => Array
(
[0] => stdClass Object
*RECURSION*
)
)
)
$product_features = $this->featuresgroups->get_product_features_groups_options(array('product_id'=>$product->id));
$unique_product_features_keys = array();
$unique_product_features = array();
foreach($product_features as $f) {
if (!in_array($f->name, $unique_product_features_keys)) {
$unique_product_features_keys[] = $f->name;
$unique_product_features[] = $f;
}
}
foreach($unique_product_features as $f) {
foreach($product_features as $fv) {
if ($f->name === $fv->name) {
$f->values[] = $fv;
}
}
}
$product->features = $unique_product_features;
Array
(
[0] => stdClass Object
(
[feature_id] => 38
[value] => Черный
[translit] => chernyj
[name] => Цвет
[product_id] => 718
[id_group_feature] => 3
[image] =>
[gname] => Основные характеристики
[values] => Array
(
[0] => stdClass Object
*RECURSION*
)
)
[1] => stdClass Object
(
[feature_id] => 75
[value] => 32 ГБ
[translit] => 32spgb
[name] => Объем памяти
[product_id] => 718
[id_group_feature] => 7
[image] =>
[gname] => Память
[values] => Array
(
[0] => stdClass Object
*RECURSION*
)
)
)
.body-borders > * {
position: fixed;
z-index: 11000;
}
.body-borders .top-border {
top: 0;
left: 0;
width: 100%;
}
.body-borders .right-border {
top: 0;
right: 0;
height: 100%;
}
.body-borders .bottom-border {
bottom: 0;
left: 0;
width: 100%;
}
.body-borders .left-border {
top: 0;
left: 0;
height: 100%;
}
$fields = array(
'author' => array(
'label' => __( 'Name', 'woocommerce' ),
'type' => 'text',
'placeholder' => 'Ваше имя',
'value' => $commenter['comment_author'],
'required' => $name_email_required,
),
'email' => array(
'label' => __( 'Email', 'woocommerce' ),
'type' => 'email',
'value' => $commenter['comment_author_email'],
'required' => $name_email_required,
),
);
$comment_form['fields'] = array();
foreach ( $fields as $key => $field ) {
$field_html = '<p class="comment-form-' . esc_attr( $key ) . '">';
$field_html .= '<input class="form_input" placeholder="'. esc_attr( $field['placeholder'] ) .'" id="' . esc_attr( $key ) . '" name="' . esc_attr( $key ) . '" type="' . esc_attr( $field['type'] ) . '" value="' . esc_attr( $field['value'] ) . '" size="30" ' . ( $field['required'] ? 'required' : '' ) . ' /></p>';
$comment_form['fields'][ $key ] = $field_html;
}
Данный код решает проблему. Спасибо огромное за помощь, уже не раз замечаю что вы активно помогаете новичкам как я)