Task 10121 | fix: поправили прайсы цен для карт, которые некорректно выводятся при заполнении из админки
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* хлебные крошки
|
||||
*/
|
||||
|
||||
// Проверяем, не объявлена ли уже функция
|
||||
|
||||
if (!function_exists('generate_yandex_breadcrumbs')) {
|
||||
|
||||
function generate_yandex_breadcrumbs()
|
||||
@@ -107,58 +107,61 @@ if (!function_exists('generate_yandex_breadcrumbs')) {
|
||||
);
|
||||
|
||||
// Кастомные таксономии
|
||||
} elseif (is_tax()) {
|
||||
$term = get_queried_object();
|
||||
$taxonomy = $term->taxonomy;
|
||||
|
||||
// Архив типа поста для этой таксономии
|
||||
$taxonomy_obj = get_taxonomy($taxonomy);
|
||||
if (!empty($taxonomy_obj->object_type)) {
|
||||
$post_type = $taxonomy_obj->object_type[0];
|
||||
$post_type_obj = get_post_type_object($post_type);
|
||||
|
||||
if ($post_type_obj && $post_type_obj->has_archive) {
|
||||
$archive_link = get_post_type_archive_link($post_type);
|
||||
if ($archive_link) {
|
||||
$breadcrumbs[] = array(
|
||||
"@type" => "ListItem",
|
||||
"position" => $position++,
|
||||
"name" => $clean_title($post_type_obj->labels->name),
|
||||
"item" => $archive_link
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Родительские термины для иерархических таксономий
|
||||
if (is_taxonomy_hierarchical($taxonomy)) {
|
||||
$parent_terms = array();
|
||||
$parent_id = $term->parent;
|
||||
while ($parent_id) {
|
||||
$parent_term = get_term($parent_id, $taxonomy);
|
||||
array_unshift($parent_terms, $parent_term);
|
||||
$parent_id = $parent_term->parent;
|
||||
}
|
||||
|
||||
foreach ($parent_terms as $parent_term) {
|
||||
$breadcrumbs[] = array(
|
||||
"@type" => "ListItem",
|
||||
"position" => $position++,
|
||||
"name" => $clean_title($parent_term->name),
|
||||
"item" => get_term_link($parent_term)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$breadcrumbs[] = array(
|
||||
"@type" => "ListItem",
|
||||
"position" => $position++,
|
||||
"name" => $clean_title($term->name),
|
||||
"item" => get_term_link($term)
|
||||
);
|
||||
|
||||
// Отдельные посты
|
||||
} elseif (is_single()) {
|
||||
}
|
||||
// elseif (is_tax()) {
|
||||
// $term = get_queried_object();
|
||||
// $taxonomy = $term->taxonomy;
|
||||
//
|
||||
// // Архив типа поста для этой таксономии
|
||||
// $taxonomy_obj = get_taxonomy($taxonomy);
|
||||
// if (!empty($taxonomy_obj->object_type)) {
|
||||
// $post_type = $taxonomy_obj->object_type[0];
|
||||
// $post_type_obj = get_post_type_object($post_type);
|
||||
//
|
||||
// if ($post_type_obj && $post_type_obj->has_archive) {
|
||||
// $archive_link = get_post_type_archive_link($post_type);
|
||||
// if ($archive_link) {
|
||||
// $breadcrumbs[] = array(
|
||||
// "@type" => "ListItem",
|
||||
// "position" => $position++,
|
||||
// "name" => $clean_title($post_type_obj->labels->name),
|
||||
// "item" => $archive_link
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Родительские термины для иерархических таксономий
|
||||
// if (is_taxonomy_hierarchical($taxonomy)) {
|
||||
// $parent_terms = array();
|
||||
// $parent_id = $term->parent;
|
||||
// while ($parent_id) {
|
||||
// $parent_term = get_term($parent_id, $taxonomy);
|
||||
// array_unshift($parent_terms, $parent_term);
|
||||
// $parent_id = $parent_term->parent;
|
||||
// }
|
||||
//
|
||||
// foreach ($parent_terms as $parent_term) {
|
||||
// $breadcrumbs[] = array(
|
||||
// "@type" => "ListItem",
|
||||
// "position" => $position++,
|
||||
// "name" => $clean_title($parent_term->name),
|
||||
// /* "item" => get_term_link($parent_term)*/ // TODO: Ссылки на таксономии отключены
|
||||
// "item" => $archive_link
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $breadcrumbs[] = array(
|
||||
// "@type" => "ListItem",
|
||||
// "position" => $position++,
|
||||
// "name" => $clean_title($term->name),
|
||||
// "item" => get_term_link($term)
|
||||
// );
|
||||
//
|
||||
// // Отдельные посты
|
||||
// }
|
||||
elseif (is_single()) {
|
||||
global $post;
|
||||
$post_type = get_post_type($post);
|
||||
|
||||
@@ -226,39 +229,40 @@ if (!function_exists('generate_yandex_breadcrumbs')) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($main_taxonomy) {
|
||||
$terms = get_the_terms($post, $main_taxonomy);
|
||||
if (!empty($terms) && !is_wp_error($terms)) {
|
||||
$main_term = $terms[0];
|
||||
|
||||
// Родительские термины для иерархических таксономий
|
||||
if (is_taxonomy_hierarchical($main_taxonomy)) {
|
||||
$parent_terms = array();
|
||||
$parent_id = $main_term->parent;
|
||||
while ($parent_id) {
|
||||
$parent_term = get_term($parent_id, $main_taxonomy);
|
||||
array_unshift($parent_terms, $parent_term);
|
||||
$parent_id = $parent_term->parent;
|
||||
}
|
||||
|
||||
foreach ($parent_terms as $parent_term) {
|
||||
$breadcrumbs[] = array(
|
||||
"@type" => "ListItem",
|
||||
"position" => $position++,
|
||||
"name" => $clean_title($parent_term->name),
|
||||
"item" => get_term_link($parent_term)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$breadcrumbs[] = array(
|
||||
"@type" => "ListItem",
|
||||
"position" => $position++,
|
||||
"name" => $clean_title($main_term->name),
|
||||
"item" => get_term_link($main_term)
|
||||
);
|
||||
}
|
||||
}
|
||||
// if ($main_taxonomy) {
|
||||
// $terms = get_the_terms($post, $main_taxonomy);
|
||||
// if (!empty($terms) && !is_wp_error($terms)) {
|
||||
// $main_term = $terms[0];
|
||||
//
|
||||
// // Родительские термины для иерархических таксономий
|
||||
// if (is_taxonomy_hierarchical($main_taxonomy)) {
|
||||
// $parent_terms = array();
|
||||
// $parent_id = $main_term->parent;
|
||||
// while ($parent_id) {
|
||||
// $parent_term = get_term($parent_id, $main_taxonomy);
|
||||
// array_unshift($parent_terms, $parent_term);
|
||||
// $parent_id = $parent_term->parent;
|
||||
// }
|
||||
//
|
||||
// foreach ($parent_terms as $parent_term) {
|
||||
// $breadcrumbs[] = array(
|
||||
// "@type" => "ListItem",
|
||||
// "position" => $position++,
|
||||
// "name" => $clean_title($parent_term->name),
|
||||
// /* "item" => get_term_link($parent_term)*/
|
||||
// "item" => $archive_link
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $breadcrumbs[] = array(
|
||||
// "@type" => "ListItem",
|
||||
// "position" => $position++,
|
||||
// "name" => $clean_title($main_term->name),
|
||||
// "item" => get_term_link($main_term)
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// Текущий пост
|
||||
|
||||
@@ -26,8 +26,8 @@ function modal_system_container() {
|
||||
|
||||
?>
|
||||
<div id="modal-overlay" class="fixed inset-0 bg-[rgba(0,0,0,0.5)] backdrop-blur-sm z-50 flex items-center justify-center p-4 opacity-0 invisible transition-all ">
|
||||
<div class="bg-[#f9f9f9] rounded-[20px] max-w-[970px] w-full max-h-[90vh] relative transform scale-90 transition-transform overflow-hidden">
|
||||
<button id="modal-close" class="absolute top-4 right-4 z-10 w-8 h-8 flex items-center cursor-pointer justify-center rounded-full hover:bg-gray-100 transition-colors text-gray-500 hover:text-gray-700">
|
||||
<div id="modal-container" class="bg-[#f9f9f9] rounded-[20px] w-full max-h-[90vh] relative transform transition-transform overflow-hidden" style="max-width: 970px;">
|
||||
<button id="modal-close" class="absolute top-4 right-4 z-10 w-8 h-8 flex items-center cursor-pointer justify-center rounded-full hover:bg-gray-100 transition-colors text-black outline-none hover:text-gray-700">
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
||||
</svg>
|
||||
|
||||
Reference in New Issue
Block a user