Commit 56edec90 authored by Chi Bui's avatar Chi Bui 👀

edit frontend 12/09_02

parent 55a2ac58
......@@ -11546,11 +11546,9 @@ body.toolbar-loading.toolbar {
display: none !important;
}
}
.menu--category-menu.product.product-item .open .dropdown-menu {
display: flex !important;
margin-top: 3px;
}
.middle-header-wrapper .region-right-middle-header .cart-block-wrapper .cart-contents:before {
position: absolute;
......
......@@ -56,30 +56,29 @@ for (i = 0; i < acc.length; i++) {
if (checkHome.length == 0) {
$(".menu.menu--category-menu.nav").addClass('hide-block');
$(".menu.menu--category-menu.nav").addClass('not-home');
}else{
} else {
$(".menu.menu--category-menu.nav").addClass('product-index')
}
function menuSidebar(){
function menuSidebar() {
var current = location.pathname;
if(current == "/products"){
if (current == "/products") {
$(".menu.menu--category-menu.nav").removeClass('hide-block').removeClass('not-home').addClass('product');
$(".main-container").height($(".menu.menu--category-menu.nav").height()+110);
}
else if(current.length >= 16){
let currentpathSlice = current.slice(0,17);
if(currentpathSlice == "/product_category"){
$(".main-container").height($(".menu.menu--category-menu.nav").height() + 110);
} else if (current.length >= 16) {
let currentpathSlice = current.slice(0, 17);
if (currentpathSlice == "/product_category") {
$(".menu.menu--category-menu.nav").removeClass('hide-block').removeClass('not-home').addClass('product product-item');
$(".menu.menu--category-menu.nav li.active-trail").addClass('open');
$(".main-container").height($(".menu.menu--category-menu.nav").height()+110);
$(".menu.menu--category-menu.nav li.active-trail").addClass('open');
$(".main-container").css({"min-height":$(".menu.menu--category-menu.nav").height() + 50, "margin-bottom":"50px"}) ;
}
if(currentpathSlice == "/search-products"){
if (currentpathSlice == "/search-products") {
$(".menu.menu--category-menu.nav").removeClass('hide-block').removeClass('not-home').addClass('product');
$(".main-container").height($(".menu.menu--category-menu.nav").height()+110);
$(".main-container").height($(".menu.menu--category-menu.nav").height() + 110);
}
}
else{
} else {
$(".region-middle-bottom-header input").attr("placeholder", "Tìm kiếm");
if ($(window).width() > 991) {
var submenu3 = $(".sidebar-submenu-3");
......@@ -133,14 +132,14 @@ $(".menu.menu--category-menu.nav li.active-trail").addClass('open');
// $(".region-middle-bottom-header button").text(" ")
var textPrice = $(".field--name-price");
for(let i =0 ; i < textPrice.length; i++){
let price = textPrice.eq(i).text();
cost = price.split('').slice(0, 1).join("");
if (cost == "0") {
textPrice.eq(i).text("Liên hệ");
}
for (let i = 0; i < textPrice.length; i++) {
let price = textPrice.eq(i).text();
cost = price.split('').slice(0, 1).join("");
if (cost == "0") {
textPrice.eq(i).text("Liên hệ");
}
}
if($("article.commerce-product.full .field--name-price").text() == "Liên hệ"){
if ($("article.commerce-product.full .field--name-price").text() == "Liên hệ") {
$("article.commerce-product.full .product-right .field--name-variations button").hide();
$("article.commerce-product.full .product-right .form-group.form-type-number").hide();
}
......@@ -168,7 +167,7 @@ $(".menu.menu--category-menu.nav li.active-trail").addClass('open');
// console.log(numberInput);
numberInput.after('<div class="button btn-inde">+</div>');
numberInput.before('<div class="button btn-inde">-</div>');
$('.btn-inde').click( function() {
$('.btn-inde').click(function() {
var $button = $(this);
var oldValue = $button.parent().find("input").val();
......@@ -176,7 +175,7 @@ $(".menu.menu--category-menu.nav li.active-trail").addClass('open');
if ($button.text() == "+") {
var newVal = parseFloat(oldValue) + 1;
} else {
// Don't allow decrementing below zero
// Don't allow decrementing below zero
if (oldValue > 0) {
var newVal = parseFloat(oldValue) - 1;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment