У меня странная проблема с WordPress.
Этот код должен возвращать поле таксономии, выбранное ACF Taxonomy, из поля повторителя. Поле ACF установлено в pa_color (атрибут продукта woocommerce).
Код хорошо работает на основном языке (IT)
На переводе (англ) есть странная проблема.
С рабочего стола все отлично работает, и я вижу английское название цвета, но с мобильного телефона вижу итальянское название цвета.
Я не могу понять, почему один и тот же код дает разную печать.
есть код
global $product;
$current_id = "";
if(isset($_POST['prodid']) && $_POST['prodid'] != "" ) {
$current_id = $_POST['prodid'];
}
if(have_rows('gallery_color', $current_id)):
while(have_rows('gallery_color', $current_id)):
the_row();
$colore_attributo = get_sub_field('colore', $current_id);
$colore = $colore_attributo->slug;
$gallery = get_sub_field('galleria', $current_id);
print_r($colore_attributo);
if($colore == $selected_color) {
foreach($gallery as $single_image){
$img_url = wp_get_attachment_image_src( $single_image['ID'], 'full' );
/* ###### GET ALT ###### */
$img_alt = get_post_meta( $single_image['ID'], '_wp_attachment_image_alt', true);
/* ###### GET TITLE ###### */
$img_title = get_the_title( $single_image['ID'] );
?>
<div class="woocommerce-product-gallery__image">
<img class="img-fit wp-post-image" src="<?php echo $img_url[0]; ?>" alt="<?php echo $img_alt; ?>" title="<?php echo $img_title; ?>">
</div>
<?php
}
}
endwhile;
endif;
Есть печать
DEKSTOP PRINT
WP_Term Object
(
[term_id] 342
[name] Red
[slug] red
[term_group] 0
[term_taxonomy_id] 342
[taxonomy] pa_color
[description]
[parent] 0
[count] 2
[filter] raw
[meta_value] 0
)
WP_Term Object
(
[term_id] 338
[name] Burgundy
[slug] burgundy
[term_group] 0
[term_taxonomy_id] 338
[taxonomy] pa_color
[description]
[parent] 0
[count] 2
[filter] raw
[meta_value] 0
)
МОБИЛЬНАЯ ПЕЧАТЬ
WP_Term Object
(
[term_id] 322
[name] Rosso
[slug] rosso
[term_group] 0
[term_taxonomy_id] 322
[taxonomy] pa_color
[description]
[parent] 0
[count] 2
[filter] raw
[meta_value] 0
)
WP_Term Object
(
[term_id] 318
[name] Cuoio
[slug] cuoio
[term_group] 0
[term_taxonomy_id] 318
[taxonomy] pa_color
[description]
[parent] 0
[count] 2
[filter] raw
[meta_value] 0
)
Вы можете видеть различную распечатку, с рабочего стола и со смартфона, из одного и того же кода ...
У меня должна быть "настольная печать" с декстопа и с мобильного.
Любая помощь?
Большое спасибо