Magento display current category level, parent and grandparent - php

We have a magento 1.9 installation and on the left side we want to have 3 level categories to display as shown in the attached image (the breadcrumbs image is to show the levels). Currently I'm able to get the current category and his parent.
Below is the example of how I want it.
Could you help me out on this?
This is the code we have so far
<?php
$level = $this->getCurrentCategory()->getParentCategory()->getLevel();
if($level > 1){
echo '
<p class="back-to-parent">
<a href="' . $this->getCurrentCategory()->getParentCategory()->getUrl() . '">
<i class="fa fa-arrow-left" aria-hidden="true"></i> ' . $this->getCurrentCategory()->getParentCategory()->getName() . '
</a></p>';
}
else{
//
}
?>
<?php if ($categories = $this->getCategoriesNavMenu()): ?>
<div id="sidebar-nav" class="block sidebar-nav-left <?php echo $this->getBlockAlias() ?>">
<button type="button" class="btn visible-xs btn-block btn-primary" data-toggle="collapse" data-target="#sidebar-nav-content">Meer categorieën <i class="fa fa-filter" aria-hidden="true"></i></button>
<div id="sidebar-nav-content" class="collapse">
<div class="block-content">
<ul id="sidebar-nav-menu">
<?php if ($this->showHome()): ?>
<li class="<?php echo $this->getHomeClasses() ?>">
<span class="category_name">Home</span>
</li>
<?php endif; ?>
<?php echo $categories; ?>
</ul>
</div>
</div>
<?php if ($this->getConfig()->isCollapsible()): ?>
<script type="text/javascript" language="javascript">
//<![CDATA[
Codnitive = {
expandMenu: function(parent)
{
var mode = parent.getElementsByTagName("ul")[0].getAttribute("expanded");
(mode == 1) ? Codnitive.collapse(parent) : Codnitive.expand(parent);
},
expand: function(parent)
{
parent.getElementsByTagName("ul")[0].style.display = "block";
parent.getElementsByTagName("span")[0].style.backgroundPosition = "right center";
parent.getElementsByTagName("ul")[0].setAttribute("expanded", "1");
},
collapse: function(parent)
{
parent.getElementsByTagName("ul")[0].style.display = "none";
parent.getElementsByTagName("span")[0].style.backgroundPosition = "left center";
parent.getElementsByTagName("ul")[0].setAttribute("expanded", "0");
}
};
//]]>
</script>
<?php endif; ?>
</div>
<?php endif ?>

Related

How to set first menu active in mega menu?

I am trying to create a hoverable mega menu, all works fine except the active one.
I checked in source codes and active class is added, but it doesn't show up the content until mouseenter on it.
see image please :
And this is when I go on it with mouse, it show up with no problem.
I gues I need to set main (FINANCE is main menu in pic) menu active, but dont know how to pass it to submenu.
Here is my full code :
$stmt_menu = $pdo->prepare("SELECT * FROM categories WHERE parentId = ? LIMIT 5");
$stmt_menu->execute([0]);
if ($stmt_menu->rowCount() > 0) {
$query = $stmt_menu->fetchAll();
foreach ($query as $row) {
if ($row['cat_type'] == 'mega') {
?>
<li class="dropdown megamenu-fw mega-li-<?php echo $row['catId']; ?>">
<?php echo $row['catName']; ?><span class="caret"></span>
<ul class="dropdown-menu megamenu-content dropdown-top" role="menu" aria-expanded="true" data-mega-ul="<?php echo $row['catId']; ?>">
<li>
<?php
$stmt_menu = $pdo->prepare("SELECT * FROM categories WHERE parentId = ? LIMIT 5");
$stmt_menu->execute([$row['catId']]);
if ($stmt_menu->rowCount() > 0) {
$subquery = $stmt_menu->fetchAll();
?>
<div class="sub-menu-left">
<ul class="nav-sub-categories">
<?php
$i = 0;
foreach ($subquery as $subq) {
$actives = '';
if($i == 0){
$actives = ' active';
}
?>
<li data-category-filter="<?php echo $subq['cat_seo_url']; ?>-<?php echo $subq['catId']; ?>" class="li-sub-category<?php echo $actives; ?>"><?php echo $subq['catName']; ?></li>
<?php
$i++;
}
?>
</ul>
</div>
<div class="sub-menu-right">
<?php
$i = 0;
foreach ($subquery as $subcats) {
$actives = '';
if($i == 0){
$actives = ' active';
}
?>
<div class="sub-menu-inner filter-<?php echo $subcats['cat_seo_url']; ?>-<?php echo $subcats['catId']; ?><?php echo $actives; ?>">
<div class="row row-menu-right">
<div class="col-sm-3 menu-post-item">
<div class="post-item-image">
<a href="is-allowance-instantly-strangers-applauded">
<img src="assets/img/img_bg_md.png" data-src="uploads/images/202203/image_380x226_624239afd7295.jpg" alt="Is allowance instantly strangers applauded" class="lazyload img-responsive img-post" width="1" height="1"/>
</a>
</div>
<h3 class="title"><?php echo $subcats['cat_seo_url']; ?> Is allowance instantly strangers applauded</h3>
<p class="post-meta">
admin
<span>Mar 28, 2022</span>
<span><i class="icon-comment"></i>2</span>
<span class="m-r-0"><i class="icon-eye"></i>894</span>
</p>
</div>
</div>
</div>
<?php
$i++;
}
?>
</div>
<?php
}
?>
</li>
</ul>
</li>
<?php
} elseif ($row['cat_type'] == 'dropdown') {
echo ' <li class="nav-item"><a class="nav-link" href="' . $row["cat_seo_url"] . '">test</a></li>';
} else {
echo ' <li class="nav-item"><a class="nav-link" href="' . $row["cat_seo_url"] . '">' . $row["catName"] . '</a></li>';
}
}
}

Can't get output cart using ajax, codeignier

I've been struggling to create a shopping cart using ajax. I'm new to codeigniter and ajax but it seems the request from ajax is successful since the alert('success') in success:function is working. But I can't output data from the controller. At the place where I want to output cart I just get "welcome to xamp window" Could you tell me what I'm doing wrong?
Product view:
<?php if(count($data)): ?>
<?php foreach ($data as $item) { ?>
<div class="shop-item">
<div class="image">
<a href="<?php echo base_url(); ?>index.php/items/item1">
<img class="shop-item-image" src="<?php echo base_url("uploads/".$item->image) ?>" alt="Ariana Grande: thank u, next exclusive clear/pink lp"/>
</a>
<?php if($item->status=='sold'): ?>
<p class="sold-btn">Sold out</p>
<?php else: ?>
<button class="cart-btn" data-productid="<?php echo $item->id;?>" data-productartist="<?php echo $item->artist;?>"
data-producttitle="<?php echo $item->title;?>" data-productprice="<?php echo $item->price;?>" data-productimage="<?php echo $item->image;?>">
<i class="fa fa-shopping-cart"></i>Add to cart</button>
<?php endif; ?>
</div>
<a class="artist" href="#">
<div class="shop-item-details">
<span class="brand"><?php echo $item->artist; ?></span>
</div>
</a>
<div class="title">
<span class="format double-vinyl-lp"><?php echo $item->title; ?></span>
</div>
<div>
<span class="price">€<?php echo $item->price; ?></span>
</div>
</div>
<?php } ?>
<?php endif; ?>
</div>
Jquery
$(document).ready(function() {
$('.cart-btn').click(function () {
var product_id = $(this).data("productid");
var product_artist = $(this).data("productartist");
var product_title = $(this).data("producttitle");
var product_price = $(this).data("productprice");
var image = $(this).data("productimage");
var quantity = 1;
$.ajax({
url :'/index.php/cart/add_to_cart',
method : "POST",
data : {product_id: product_id, product_artist: product_artist, product_title: product_title, product_price: product_price, quantity:quantity, image:image},
success: function(data){
alert(product_artist);
$('#detail-cart').html(data);
},
});
});
$('#detail-cart').load("<?php echo site_url('index.php/cart/load_cart');?>");
})
Controller
public function add_to_cart() {
$data = array(
'id' => $this->input->post('product_id'),
'name' => $this->input->post('product_artist'),
'price' => $this->input->post('product_price'),
'qty' =>1
//'title'=>$this->input->$_POST('product_title'),
//'image'=>$this->input->$_POST('image')
);
$this->cart->insert($data);
print_r(($this->cart->total_items()));
echo $this->show_cart();
}
public function show_cart(){
$output = '';
$no = 0;
foreach ($this->cart->contents() as $items) {
$no++;
$output .='
<div>
<a href="">
<p>hello</p>
</a>
</div>
<div class="description">
<a class="artist" href="">'.$items['name'].'</a>
<p class="mini-total"><span>'.number_format($items['qty']).'</span>×<span>'.number_format($this->cart->total()).'</span></p>
remove
</div>
<div class="quantity">
<i class="fa fa-chevron-up"></i>
<i class="fa fa-chevron-down"></i>
</div>
';
}
return $output;
}
public function load_cart(){
echo $this->show_cart();
}
}
cert view I want to display it in a different view as a part of the header
<div id="detail-cart" class="mini-cart-item">
</div>
I figured the problem. the problem was in url
url :'/index.php/cart/add_to_cart'
didn't work; neither:
url :'<?phph echo base_url();?>index.php/cart/add_to_cart
what i did was declaring :
<script>
base_url= '<?phph echo base_url();?>index.php/cart/add_to_cart'
</script>
and then set url as
url: base_url+'index.php/cart/add_to_cart'
and it worked;

issue with php code and meta tags

I need little bit of help with a small issue,
I need you to fix some line in PHP
What is the issue:
when we share our page on facebook linkedin it comes with
<ol> <li> <span> or <p>
For example the second line on post comes like this!
<ol> <li>Oversee the safety and compliance programs for all the facilities operated by PWSAC.
<?php error_reporting(0);
$user_data=$this->session->userdata('session_user_data');
$f=$this->uri->segment('1');
$p=$this->uri->segment('2');
$i=$this->uri->segment('3');
//echo $apply_url=$f.'/'.$p.'/'.$i; exit;
$this->session->set_userdata('session_apply_job_url',$apply_url);
$image=base_url().'img/user.png';
if(#$company_details[0]->logo!=''){
if (file_exists('./upload/user/resize/'.$company_details[0]->logo)){
$image=base_url().'upload/user/resize/'.$company_details[0]->logo;
}
}
$selectSkill='';
$skill_arr=array();
$selectSkill=#$candidate_profile[0]->skills;
if(!empty($selectSkill)){
$skill_arr=explode(',',$selectSkill);
}
$client_ip=$this->Common->get_client_ip();
$job_visits=$this->Common->selectMultiWhere('tbl_job_visits',$where=array('ip_addtess'=>$client_ip,'job_id'=>$i));
if(empty($job_visits)){
$this->db->insert('tbl_job_visits',array('ip_addtess'=>$client_ip,'job_id'=>$i,'user_id'=>#$this->userId,'date'=>date('Y-m-d h:i:s')));
}
$related_jobs=array();
if(!empty($selectSkill)){
$related_jobs=$this->Common->related_jobs($selectSkill);
}
//echo '<pre>';print_r($user_data[0]->ID);exit;
?>
<style>
.btn-disable_b {
background-color: #c0c0c0;
color: #c0c0c0;
cursor: not-allowed;
display: inline-block;
pointer-events: none;
}
.bg-whit.newmainAdd { background: #f5f5f5 !important;}
</style>
<!--<div id="main">
<div id="container"></div>
Keep Going!
</div>
<div id="footer">You Made It!</div>-->
<section class="wow fadeIn no-padding-bottom newmainAdd" id="main">
<div class="container">
<div class="row">
<div class="col-md-8 col-sm-7 col-xs-12 bg-aqt">
<div class="leftModal newadd1">
<div class="full p-r-15">
<div class="jobDescription">
<div class="jobDescriptionLeft"> <img src="<?php echo $image; ?>" alt="<?php if(isset($candidate_profile[0]->job_title)){echo $candidate_profile[0]->job_title;}?>"> </div>
<div class="jobDescriptionRight">
<h2>
<?php echo glang('Jobs at');?> <?php if(isset($users_info[0]->company_name)){echo $users_info[0]->company_name;}?> : <?php if(isset($candidate_profile[0]->job_title)){echo $candidate_profile[0]->job_title;}?> <?php echo glang('in');?> <?php if(isset($job_description[0]->location)){echo $job_description[0]->location;}?> - <?php echo glang('AquacultureTalent');?>
</h2>
<h3><span>
<?php
//$arr = substr($str, 0, strpos($str, '('));
if($job_description[0]->role_description!=''){
$arr = explode(".", $job_description[0]->role_description, 2);
echo $arr[0].'.';
}
?>
</span></h3>
</div>
</div>
<div class="fullTimeArea full">
<ul>
<li>
<?php if(isset($job_description[0]->job_type)){if($job_description[0]->job_type=='fulltime'){echo 'Full-time';}else if($job_description[0]->job_type=='contract'){echo 'Contract';}elseif($job_description[0]->job_type=='parttime'){echo 'Part-time';}else{echo 'Full-time';}} ?>
</li>
<li><i class="fa fa-calendar"></i> <?php echo $this->Common->time_passed(strtotime($post_jobs_info[0]->approved_date)); ?> </li>
<li><i class="fa fa-map-marker"></i><a href="javascript:;">
<?php if(isset($job_description[0]->location)){echo $job_description[0]->location;}?>
</a></li>
<?php if($job_description[0]->show_salary==1){ ?>
<li><i class="fa fa-eur"></i><a href="javascript:;" data-toggle="tooltip" data-placement="top" title="Gross Anual Salary">
<?php if(isset($job_description[0]->gross_salary_low)){echo $job_description[0]->gross_salary_low;}?>
-
<?php if(isset($job_description[0]->gross_salary_high)){echo $job_description[0]->gross_salary_high;}?>
</a></li>
<?php } ?>
<!--<li><i class="fa fa-bar-chart-o"></i> Intermediate</li>-->
<li><a href="javascript:;" data-toggle="tooltip" title="Preferred spoken language!"><i class="fa fa-language"></i>
<?php if(isset($candidate_profile[0]->language)){echo $candidate_profile[0]->language;}?>
</a></li>
<li> <i class="fa fa-briefcase abs"></i>
<ul>
<li><a href="javascript:;"><span>
<?php if(isset($position_category[0]->title)){echo $position_category[0]->title;}?>
</span></a></li>
</ul>
</li>
<li> <i class="fa fa-tags abs"></i>
<ul>
<?php for($i=0;count($skill_arr)>$i;$i++){ ?>
<?php $skill_category=$this->Common->selectMultiWhere('tbl_talent_profile_option',$where=array('optionsId'=>$skill_arr[$i])); ?>
<li><span><?php echo $skill_category[0]->title; ?></span></li>
<?php }?>
</ul>
</li>
</ul>
</div>
<div class="offerSection full">
<?php if(isset($job_description[0]->role_description)){echo $job_description[0]->role_description;}?>
</div>
<div class="offerSection full">
<h3><?php echo glang('Main requirements');?></h3>
<?php if(isset($job_description[0]->main_requirements)){echo $job_description[0]->main_requirements;}?>
</div>
<div class="offerSection full">
<h2><?php echo glang('Nice to have');?></h2>
<?php if(isset($job_description[0]->nice_to_have)){echo $job_description[0]->nice_to_have;}?>
</div>
<div class="offerSection full">
<h2><?php echo glang('Perks');?></h2>
<?php if(isset($job_description[0]->perks)){echo $job_description[0]->perks;}?>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-5 col-xs-12" >
<div class="" >
<div class="full" id="container">
<div class="rightModal newadd2">
<?php
$string=$candidate_profile[0]->job_title;
$string_slug=$this->Common->create_slug($string);
$i=$this->uri->segment('3');
if(!empty($user_data)){
$student_application_details=$this->Common->selectMultiWhere('tbl_job_application_list',$where=array('applicant_id'=>$this->userId));
$application_array=array();
foreach($student_application_details as $row){
$application_array[]=$row->job_id;
}
?>
<?php if($this->userRoll==3 || $this->userRoll==2 || $this->userRoll==4){ ?>
<a class="applyNow button-3d btn-disable" href="javascript:;"><?php echo glang('apply');?></a>
<?php }else{?>
<?php if(in_array($i,$application_array)){?>
<a class="applyNow button-3d btn-disable" href="javascript:;"><?php echo glang('Already applied');?></a>
<?php }else{ ?>
<a class="applyNow button-3d" href="<?php echo base_url()?>apply-job/<?php echo $string_slug?>/<?php echo $p;?>"><?php echo glang('apply now');?></a>
<?php } ?>
<?php } ?>
<?php }else{ ?>
<a class="applyNow button-3d" href="<?php echo base_url();?>login?login_for=apply"><?php echo glang('Sign up to apply');?></a>
<?php } ?>
<div class="full m-t-30">
<?php if(!empty($user_data)){?>
<?php $bookmark_info=$this->Common->selectMultiWhere('tbl_bookmarks',$where=array('user_id'=>$user_data[0]->ID));
$bookmark_array=array();
foreach($bookmark_info as $row){
$bookmark_array[]=$row->job_id;
}
?>
<?php if($this->userRoll==3 || $this->userRoll==2 || $this->userRoll==4){ ?>
<div id="bookmarksBtn" class="btn-disable_b"> <a class="bookmarksBtn m-t-20 <?php if(in_array($i,$bookmark_array)){ echo 'remove_bookmark active';}else{echo 'add_bookmark';} ?>" data-id="<?php echo $i;?>" href="javascript:;"><i class="fa fa-bookmark"></i>
<?php if(in_array($i,$bookmark_array)){ echo glang('Remove Bookmark');}else{ echo glang('Bookmark'); } ?>
</a> </div>
<?php }else{ ?>
<div id="bookmarksBtn"> <a class="bookmarksBtn m-t-20 <?php if(in_array($i,$bookmark_array)){ echo 'remove_bookmark active';}else{echo 'add_bookmark';} ?>" data-id="<?php echo $i;?>" href="javascript:;"><i class="fa fa-bookmark"></i>
<?php if(in_array($i,$bookmark_array)){ echo glang('Remove Bookmark');}else{ echo glang('Bookmark'); } ?>
</a> </div>
<?php } ?>
<?php }else{ ?>
<a class="bookmarksBtn m-t-20" href="<?php echo base_url();?>login?login_for=apply"><i class="fa fa-bookmark"></i> <?php echo glang('Sign up to Bookmark');?></a>
<?php } ?>
</div>
<div class="full shereArea m-t-30">
<h4><?php echo glang('SHARE');?></h4>
<ul>
<li><i class="fa fa-facebook"></i></li>
<li class="twit"><i class="fa fa-twitter"></i></li>
<li class="linkD"><i class="fa fa-linkedin"></i></li>
<li class="mail2"><i class="fa fa-envelope"></i></li>
</ul>
</div>
<div class="full shereArea m-t-50">
<h4><?php echo glang('Related job offers');?></h4>
<div class="clearfix"></div>
<ul class="full offerspart">
<?php foreach($related_jobs as $r_job){ ?>
<?php if($r_job->id!=$i){ ?>
<?php $string=$r_job->job_title;
$string_slug=$this->Common->create_slug($string);
?>
<li><a href="<?php echo base_url()?>offer-details/<?php echo $string_slug?>/<?php echo $r_job->id; ?>">
<h5>
<?php if(isset($r_job->job_title)){ echo $r_job->job_title;} ?>
</h5>
<p>
<?php if(isset($r_job->company_name)){ echo $r_job->company_name;} ?>
</p>
</a></li>
<?php } ?>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
</section>
<script>
$(document).on('click', '.add_bookmark', function() {
var id = $(this).data('id');
$.ajax({
url: base_url + 'apply/add_bookmark',
type: 'post',
data: {id: id},
dataType: 'json',
beforeSend: function(){
//$(self).parent().addClass('active');
},
complete: function(data){
$("#bookmarksBtn").load(location.href + " #bookmarksBtn>*", "");
},
success: function(json){},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
$(document).on('click', '.remove_bookmark', function() {
var id = $(this).data('id');
var self = this;
$.ajax({
url: base_url + 'apply/remove_bookmark',
type: 'post',
data: {id: id},
dataType: 'json',
beforeSend: function() {
//$(self).parent().parent().children('.bookmark').removeClass('active');
},
complete: function(data) {
$("#bookmarksBtn").load(location.href + " #bookmarksBtn>*", "");
},
success: function(json) {},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
$(".clickIcon").click(function(){
$(".dashLeft").toggleClass("dashLeft-left");
});
</script>
<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script type="text/javascript" >
jQuery(document).ready(function($){
//variables
var $window = $(window);
var $container = $("#container");
var $main = $("#main");
var window_min = 0;
var window_max = 0;
var threshold_offset = 50;
/*
set the container's maximum and minimum limits as well as movement thresholds
*/
function set_limits(){
//max and min container movements
var max_move = $main.offset().top + $main.height() - $container.height() - 2*parseInt($container.css("top") );
var min_move = $main.offset().top;
//save them
$container.attr("data-min", min_move).attr("data-max",max_move);
//window thresholds so the movement isn't called when its not needed!
//you may wish to adjust the freshhold offset
window_min = min_move - threshold_offset;
window_max = max_move + $container.height() + threshold_offset;
}
//sets the limits for the first load
set_limits();
function window_scroll(){
//if the window is within the threshold, begin movements
if( $window.scrollTop() >= window_min && $window.scrollTop() < window_max ){
//reset the limits (optional)
set_limits();
//move the container
container_move();
}
}
$window.bind("scroll", window_scroll);
/**
* Handles moving the container if needed.
**/
function container_move(){
var wst = $window.scrollTop();
//if the window scroll is within the min and max (the container will be "sticky";
if( wst >= $container.attr("data-min") && wst <= $container.attr("data-max") ){
//work out the margin offset
var margin_top = $window.scrollTop() - $container.attr("data-min");
//margin it down!
$container.css("margin-top", margin_top);
//if the window scroll is below the minimum
}else if( wst <= $container.attr("data-min") ){
//fix the container to the top.
$container.css("margin-top",0);
//if the window scroll is above the maximum
}else if( wst > $container.attr("data-max") ){
//fix the container to the top
$container.css("margin-top", $container.attr("data-max")-$container.attr("data-min")+"px" );
}
}
//do one container move on load
container_move();
});
</script>
If you visit this job: https://aquaculturetalent.com/offer-details/123/hatchery-operation-manager and view its source, you'll see this code:
<meta name="description" content="<p>The Hatchery Operations Manager basic functions:</p>
<ol>
<li>Oversee all non-fish culture hatchery operations and staff involved with these tasks including the M/V Alaskan Challenger</li>
<li>Prepare annual budgets with hatchery managers for each facility and the annual budget for the Anchorage Distribution Center to present the General Manager/CEO</li>
<li>To work on a daily basis with the General Manager/CEO and members of the top management team to carry out the directives of the Board</li>
<li>Oversee the safety and compliance programs for all the facilities operated by PWSAC.">
Notice there's HTML inside the content=. Somewhere along the line you're not closing the li or ol and meta tags correctly. Update your back-end code that populates those pieces of data to be valid HTML and it should be fine.
You need to filter to remove tags and escape HTML entities, before content is placed into the meta description, wherever that is happening. Example...
<?php
$desc = "<p>The Hatchery Operations Manager basic functions</p>";
$desc_sanitized = filter_var($desc, FILTER_SANITIZE_STRING);
echo '<meta name="description" content="' . htmlspecialchars($desc_sanitized) . '">';

How increment a number in wordpress page?

I have a page where i generate a multiple ID's and i put in page, is ads page like that:
if you see in my page i have that message: The number is: 1 after every ad
I want to increment that number, i try this but i can when de page is in loading my x is alwais 1:
<?php
$x = 1;
if($x <= 5) {
echo "The number is: $x <br>";
$x++;
}
?>
I want to increment always in my page 1,2,3,4,5 not always 1, but how can i do
Above i put all my code from page:
<?php
global $ae_post_factory, $user_ID;
$place_obj = $ae_post_factory->get('place');
$post = $place_obj->current_post;
// et_location_lat et_location_lng
?>
<?php
$query = $wpdb->get_var('SELECT count(*) as featured FROM `eHouTHuQpostmeta` WHERE `post_id`=' . get_the_ID() . ' and meta_key = "et_featured" and meta_value=1');
$date = $wpdb->get_var('SELECT meta_value FROM `eHouTHuQpostmeta` WHERE `post_id`=' . get_the_ID() . ' and meta_key = "et_twitter_url" ');
$hour = $wpdb->get_var('SELECT meta_value FROM `eHouTHuQpostmeta` WHERE `post_id`=' . get_the_ID() . ' and meta_key = "et_google_url" ');
?>
<li <?php post_class( 'post-item' ); ?> >
<div style="width:100%">
<div style="float:left;width:50%">
<?php if($query == 1){ ?><STRONG>SUGGESTED</STRONG><?php } ?>
</div>
<div style="float:right;width:50%;text-align:right">
<?php
if($date != "" && $hour != ''){
echo "<span id='data-time'>" . $date . "</span>";
}
?>
</div>
<div style="clear:both"></div>
</div>
<div class="place-wrapper<?php if($query == 1){ echo " featured-box"; } ?>">
<a href="<?php the_permalink(); ?>" class="img-place">
<img src="<?php echo $post->the_post_thumnail; ?>" alt="<?php the_title(); ?>"/>
<?php if(isset($post->et_google_url) && $post->et_google_url){ ?>
<div class="cat-<?php echo $post->place_category[0]; ?>">
<div class="ribbon">
<span class="ribbon-content"><?php echo $post->et_google_url; ?></span>
</div>
</div>
<?php } ?>
</a>
<div class="place-detail-wrapper">
<h2 class="title-place"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
</a></h2>
<span class="address-place">
<i class="fa fa-map-marker"><span itemprop="latitude" id="latitude" content="<?php echo $post->et_location_lat;?>"></span></i>
<span itemprop="longitude" id="longitude" content="<?php echo $post->et_location_lng;?>"></span>
<span class="distance"></span>
<?php echo $post->et_full_location; ?>
</span>
<span class="address-place">
<?php echo strip_tags(html_entity_decode(get_the_excerpt())); ?>
<hr>
</span>
<div class="rate-it" data-score="<?php echo $post->rating_score; ?>">
</div>
<?php
if (!empty($post->et_fb_url)) {
echo "<span class='imageContainer'> <i class='fa fa-usd' style=''>" . $post->et_fb_url . '</i></span>';
}
?>
</i>
</div>
<?php
if(#wp_get_current_user()->user_login == get_the_author())
{
?>
<!--<div class="place-config">
<i class="fa fa-cog edit-config"></i>
<img src="http://romanianusa.com/wp-content/uploads/2015/12/1450310691_6.png" class="edit-config" style="width:22px;height:22px;">
</div>
<div class="edit-place-post">
<a href="http://romanianusa.com/post-place?id=<?php the_ID(); ?>"><i class="fa fa-history place-remove fa-3x" style="padding-right:50px"></i>
<i class="fa fa-pencil place-edit fa-3x" style="padding-right:50px; padding-top:15px"></i>
<i class="fa fa-trash-o place-remove fa-3x" style="padding-top:15px"></i>
<br>
<span style="padding-right:52px">Repost</span>
<span style="padding-right:52px;">Edit</span>
<span style="padding-right:8px;">Trash</span>
</div>-->
<?php
}
?>
</div>
<?php
$x = 1;
if($x <= 5) {
echo "The number is: $x <br>";
}
$x++;
?>
<?php
if (!empty($post->et_url)) {
?>
<!--<center><span id="flag"><?php echo $post->et_url; ?></span></center>-->
<center><?php echo $post->et_url; ?></center>
<?php
}
?>
</li>

Slidedown menu with sliding down rest menu

I need slide down multiple-level vertical menu with Headings of sections of the catalog
I use bootstrap btn-group-vertical:
<?php
if($slider_enabled){
?>
<div class='clearfix'></div>
<div class='clearfix'></div>
<div class="col-xs-3">
<div class='index-slider1'>
<div class="btn-group-vertical1 open" role="group" aria-label="Vertical">
<?php
$arrarr1[0] = 0;
$arrarr2 = array();
$categories1 = $categories;
$ccount=0; $ccount1=0; $ccount2=0; $clevel=0;
while($ccount1!=count($categories)) {
$ccount2++;
if(count($categories1[$ccount]["childs"])>0) {
?>
<div class="btn-group-vertical1 open" role="group" aria-label="Vertical">
<button id="btnGroupVerticalDrop_<?=($ccount2.".".$ccount1.".".$clevel.".".$ccount);?>" type="button" class="btn btn-default1 dropdown-toggle dropdown-menu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<?php
$tcnt = -1;
while(++$tcnt<=$clevel) {
echo " ";
}
echo $categories1[$ccount]["name"];
?>
<span class="caret right1"></span>
</button>
<ul class="dropdown-menu1 drop" aria-labelledby="btnGroupVerticalDrop_<?=($ccount2.".".$ccount1.".".$clevel.".".$ccount);?>">
<?php
array_push($arrarr2, array($ccount, $categories1, $strcount));
$categories1 = $categories1[$ccount]["childs"]; $ccount=-1;
$clevel++;
$strcount = substr($strcount, 0, strrpos($strcount, "."));
?>
<?php
} else {
?>
<button type="button" class="btn btn-default1" id="<?=($ccount2.".".$ccount1.".".$clevel.".".$ccount);?>">
<?php
$tcnt = -1;
while(++$tcnt<$clevel) {
echo " ";
}
echo $categories1[$ccount]["name"];
?>
</button>
<?php
}
while($ccount==(count($categories1)-1)) {
$arrarr1 = array_pop($arrarr2);
$strcount = $arrarr1[2]; $categories1 = $arrarr1[1]; $ccount = $arrarr1[0];
$clevel--;
?>
</ul>
</div>
<?php
}
if(count($arrarr2)==0) {
$ccount1++;
}
$ccount++;
}
?>
</div>
</div>
</div>
<div class="col-xs-9"></div>
<?php
}
?>
<script type='text/javascript'>
$(document).ready(function(){
$(".drop").click(function(event){
event.stopPropagation();
});
});
</script>
Issue: First level of menu is slide up and slide down but second level and so on is not response. The purpose is to make slide down catalog of Headings sections which will be as link to the goods page. Maybe there is allready solution of the developed catalog?

Categories