2026, 새로운 도약을 시작합니다.

영카트 제품카테고리 메뉴 3차분류 나오게 하는법

2042117992_1697068967.2104.jpg

위 처럼 2차 분류를 옥외용 광 패치코드에 넣었는데

2042117992_1697068998.4942.jpg

메뉴에는 옥외용 광 패치코드라는 중분류가 반영이 안되고

그냥 상품명만 노출이 됩니다. (상세페이지에는 중분류 타이틀이 노출 됨)

메뉴에도 중분류가 나오고 그 안으로 상품들이 들어가 있게 수정이될까요?

아래에 메뉴 부분 소스랑, 아코디언 메뉴 스크립트 적어드립니다.

Copy
Copy


/*

 * jQuery UI Multilevel Accordion v.1

 * 

 * Copyright (c) 2011 Pieter Pareit

 *

 * http://www.scriptbreaker.com

 *

 */

//plugin definition

(function($){

    $.fn.extend({

    //pass the options variable to the function

    accordion: function(options) {

        

        var defaults = {

            accordion: 'true',

            speed: 300,

            closedSign: '[+]',

            openedSign: '[-]'

        };

        // Extend our default options with those provided.

        var opts = $.extend(defaults, options);

        //Assign current element to variable, in this case is UL element

         var $this = $(this);

         

         //add a mark [+] to a multilevel menu

         $this.find("li").each(function() {

             if($(this).find("ul").size() != 0){

                 //add the multilevel sign next to the link

                 $(this).find("a:first").append(""+ opts.closedSign +"");

                 

                 //avoid jumping to the top of the page when the href is an #

                 if($(this).find("a:first").attr('href') == "#"){

                       $(this).find("a:first").click(function(){return false;});

                   }

             }

         });

         //open active level

         $this.find("li.active").each(function() {

             $(this).parents("ul").slideDown(opts.speed);

             $(this).parents("ul").parent("li").find("span:first").html(opts.openedSign);

         });

          $this.find("li a").click(function() {

              if($(this).parent().find("ul").size() != 0){

                  if(opts.accordion){

                      //Do nothing when the list is open

                      if(!$(this).parent().find("ul").is(':visible')){

                          parents = $(this).parent().parents("ul");

                          visible = $this.find("ul:visible");

                          visible.each(function(visibleIndex){

                              var close = true;

                              parents.each(function(parentIndex){

                                  if(parents[parentIndex] == visible[visibleIndex]){

                                      close = false;

                                      return false;

                                  }

                              });

                              if(close){

                                  if($(this).parent().find("ul") != visible[visibleIndex]){

                                      $(visible[visibleIndex]).slideUp(opts.speed, function(){

                                          $(this).parent("li").find("span:first").html(opts.closedSign);

                                      });

                                      

                                  }

                              }

                          });

                      }

                  }

                  if($(this).parent().find("ul:first").is(":visible")){

                      $(this).parent().find("ul:first").slideUp(opts.speed, function(){

                          $(this).parent("li").find("span:first").delay(opts.speed).html(opts.closedSign);

                      });

                      

                      

                  }else{

                      $(this).parent().find("ul:first").slideDown(opts.speed, function(){

                          $(this).parent("li").find("span:first").delay(opts.speed).html(opts.openedSign);

                      });

                  }

              }

          });

    }

});

})(jQuery);

답변 1개

기획자체를 바꾸셔야될거 같다고 생각합니다.

왼쪽메뉴는 상품을 기준으로 나열하는 기획으로 

지금 원하시는것은 3차 분류이시기에 

분류기준으로 메뉴를 만드셔야될것으로 판단됩니다.

지금 상품기준 메뉴구성으로 아코디언을 만드시기엔 까다로워 보입니다.

조건을 추가하시거나 쿼리를 더 만드셔야될거 같아요

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고