SELECT
orders.num, orders.createdon, orders.cost, orders.status,
GROUP_CONCAT(products.name) prod_names,
GROUP_CONCAT(products.count) prod_counts,
GROUP_CONCAT(products.cost) prod_costs
FROM `modx_ms2_orders` AS orders
JOIN `modx_ms2_order_products` AS products ON orders.id = products.order_id
WHERE `user_id` = 106
GROUP BY orders.num, orders.createdon, orders.cost, orders.status
<ul class="toys"></ul>
<ul class="gifts"></ul>
function toListElements(jsonStr) {
function normalize(str) {
return str.split(';').map(function(item) {
return '<li>' + item + '</\li>';
}).join('');
}
const jsonObj = JSON.parse(jsonStr);
document.querySelector('.toys').innerHTML = normalize(jsonObj['toys']);
document.querySelector('.gifts').innerHTML = normalize(jsonObj['gifts']);
}
toListElements('{"toys":"машинка;кукла;мяч","gifts":"конструктор;набор;мячик;набор"}');
let isFirstClick = true;
$(".products-toggle").click(function(e) {
if (isFirstClick) {
e.preventDefault();
//первый цикл
productsRow = $(this).parent().siblings('.products-row');
if(productsRow .hasClass("shown")) {
productsRow .animate({"height": "50px"}).removeClass("shown");
} else {
productsRow .animate({"height": "auto"}).addClass("shown");
animateHeight = productsRow .height();
}
isFirstClick = false;
}
else if (!(isFirstClick)) {
//после первого выполнять это
if(productsRow .hasClass("shown")) {
productsRow .animate({"height": "50px"}).removeClass("shown");
} else {
productsRow .animate({"height": animateHeight }).addClass("shown");
}
}
});
if ($(this).find('input[name="DATA[NAME]"]').val().length < 2 ) {
return (alert("Введите имя"), !1)
} else if (0 == IsEmail(t)) {
return (alert("Введите корректный email"), !1)
} else {
return ($.ajax({...тут отправка формы})
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Document</title>
</head>
<body>
<div>
<form action="">
<input type="text" name="name">
<input type="text" name="phone">
<input type="hidden" name="first" value="first">
<input type="submit" name="first">
</form>
</div>
<div>
<form action="">
<input type="text" name="name">
<input type="text" name="email">
<input type="hidden" name="second" value="second">
<input type="submit" name="second">
</form>
</div>
<div>
<form action="">
<input type="text" name="name">
<textarea name="textarea"></textarea>
<input type="hidden" name="third" value="third">
<input type="submit" name="third">
</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("form").on("submit", function(e){
e.preventDefault()
var data = $(this).serialize()
$.ajax({
url: 'ajax.php',
method: 'POST',
data: data,
success: function(response){
console.log(response)
var answer = jQuery.parseJSON(response);
if(answer.type === 'success'){
alert(answer.text)
}
if(answer.type === 'error'){
alert(answer.text)
}
}
})
})
})
</script>
</body>
</html>
<?php
if(isset($_POST)){
if(isset($_POST['first'])){
if(!empty($_POST['name'])){
$answer = ['type' => 'success', 'text' => 'Отправлена форма First'];
}else{
$answer = ['type' => 'error', 'text' => 'Заполните поле "name" в форме First'];
}
}
if(isset($_POST['second'])){
$answer = ['type' => 'success', 'text' => 'Отправлена форма Second'];
}
if(isset($_POST['third'])){
$answer = ['type' => 'success', 'text' => 'Отправлена форма Third'];
}
echo json_encode($answer);
}
?>
mix-blend-mode
top
прижми к блоку со стрелкой, а чтобы он имел эффект выпадения, нужно прописать скрипт, который рассчитает высоту блока с товарами, а самому блоку с товарами по дэфолту в стилях задать ovevrflow: hidden; height: 0;
попробуйОшибка: Соединение прервано после 20 секунд неактивности
<?php
$prod_cat_args = array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
'parent' => 0
);
$woo_categories = get_categories( $prod_cat_args );
?>
<?php foreach ( $woo_categories as $woo_cat ) :
$woo_cat_id = $woo_cat->term_id;
$woo_cat_name = $woo_cat->name;
$woo_cat_slug = $woo_cat->slug;
$woo_cat_descr = $woo_cat->description;
$category_thumbnail_id = get_term_meta($woo_cat_id, 'thumbnail_id', true);
$thumbnail_image_url = wp_get_attachment_url($category_thumbnail_id);
$cat_link = get_term_link( $woo_cat_id, 'product_cat' );
?>
<div class="product-cat-item">
<a href="<?php echo $cat_link ?>"><?php echo $woo_cat_name ?></a>
<?php if ($thumbnail_image_url) : ?>
<img src="<?php echo $thumbnail_image_url ?>" alt="<?php echo $woo_cat_name ?>">
<?php endif; ?>
<p><?php echo $woo_cat_descr ?></p>
</div>
<?php endforeach; ?>
$args = [
'theme_location' => 'aside-1',
'menu' => '',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => 'aside-menu__inner',
'menu_id' => '',
'echo' => true,
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="%2$s dflex">%3$s</ul>',
'depth' => 1,
];
if ( get_field('name_direction_2') ) {
$args['menu'] = get_field('name_direction_2');
}
wp_nav_menu( $args );