FILTER
SORT BY
/* 1. MASAÜSTÜNDE BİZİM BAR'I GİZLE */
@media (min-width: 768px) {
#emsun-mobile-action-bar { display: none !important; }
}
/* 2. MOBİL TASARIM */
@media (max-width: 767px) {
/* Orijinal Tema Sıralama Kutusunu Mobilde TAMAMEN GİZLE (Karışmasın) */
.woocommerce-ordering {
display: none !important;
}
/* Filtre Widget'ını Başlangıçta Gizle */
.elementor-widget-wp-widget-berocket_aapf_group {
display: none;
background: #fafafa;
padding: 15px;
border-bottom: 2px solid #eee;
margin-bottom: 15px;
}
/* "142 Sonuç..." Yazısını Gizle */
.woocommerce-result-count { display: none !important; }
/* --- ANA ÇUBUK (BAR) --- */
#emsun-mobile-action-bar {
display: flex;
width: 100%;
background: #ffffff;
border-top: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
margin-bottom: 1px;
position: relative;
z-index: 90;
}
/* --- SOL VE SAĞ KUTULAR (ORTAK) --- */
.emsun-action-item {
flex: 1; /* %50 Genişlik */
height: 50px;
display: flex;
align-items: center;
justify-content: center;
font-size: 13px;
font-weight: 700;
color: #333;
cursor: pointer;
position: relative;
text-transform: uppercase;
}
/* Ortadaki Ayırıcı Çizgi */
.emsun-action-item:first-child {
border-right: 1px solid #e5e5e5;
}
/* İkon Ayarları */
.emsun-action-item i {
margin-right: 8px;
font-size: 14px;
color: #777;
}
/* --- SAĞ TARAFTAKİ SELECT KUTUSU (Hayalet Buton) --- */
#emsun-mobile-sort-select {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0; /* Görünmez yap */
z-index: 100; /* En üstte olsun */
cursor: pointer;
font-size: 16px; /* Mobilde zoom yapmaması için */
-webkit-appearance: none; /* iOS stilini sıfırla */
}
}
jQuery(document).ready(function($){
if ($(window).width() < 768) {
// 1. FİLTRELE BUTONU (Aç/Kapa)
$('#emsun-toggle-filter-btn').on('click', function(){
$('.elementor-widget-wp-widget-berocket_aapf_group').slideToggle('medium');
$(this).find('i').toggleClass('fa-filter fa-times');
});
// 2. SIRALAMA İŞLEMİ (Sayfa Yönlendirme)
$('#emsun-mobile-sort-select').on('change', function(){
var selectedSort = $(this).val(); // Seçilen değer (örn: price)
if(selectedSort) {
// Mevcut URL'yi al
var currentUrl = new URL(window.location.href);
// 'orderby' parametresini güncelle veya ekle
currentUrl.searchParams.set('orderby', selectedSort);
// Sayfayı yeni parametre ile yenile
window.location.href = currentUrl.toString();
}
});
}
});