• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

Undefined Menu issue in sidebar in profile

General Discussion
3
6
1.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    dsharma last edited by 6 Aug 2019, 07:06

    Hello,

    After sign in it is showing me undefined menu in sidebar for profile. May i know from where you are passing menu in profile.

    Please reply

    Regards
    Deepak Sharma

    1 Reply Last reply Reply Quote 0
    • R
      rahul last edited by 6 Aug 2019, 08:24

      Hi @dsharma

      You can find it from 'menu.php' file in Config folder of Shop package.

      If you want to create menu for your package then follow this link - https://forums.bagisto.com/topic/226/how-to-create-menu-for-customers

      Thanks

      1 Reply Last reply Reply Quote 0
      • D
        dsharma last edited by 6 Aug 2019, 13:19

        hi,

        thankyou so much for your reply i got that error

        Undefined variable: menu (View: C:\xampp\htdocs\proimagesports\packages\Proimage\Shop\src\Resources\views\customers\account\partials\sidemenu.blade.php) (View: C:\xampp\htdocs\proimagesports\packages\Proimage\Shop\src\Resources\views\customers\account\partials\sidemenu.blade.php)

        i have specified

        protected function composeView()
        {
        view()->composer('shop::customers.account.partials.sidemenu', function ($view) {
        $tree = Tree::create();

                foreach (config('menu.customer') as $item) {
                    $tree->add($item, 'menu');
                }
        
                $tree->items = core()->sortItems($tree->items);
        
        
        
                $view->with('menu', $tree);
            });
        }
        
        /**
         * Register package config.
         *
         * @return void
         */
        protected function registerConfig()
        {
            $this->mergeConfigFrom(
                dirname(__DIR__) . '/Config/menu.php', 'menu.customer'
            );
        }
        

        config/menu.php of shop of my package

        <?php

        return [
        [
        'key' => 'account',
        'name' => 'shop::app.layouts.my-account',
        'route' =>'customer.profile.index',
        'sort' => 1
        ], [
        'key' => 'account.profile',
        'name' => 'shop::app.layouts.profile',
        'route' =>'customer.profile.index',
        'sort' => 1
        ], [
        'key' => 'account.address',
        'name' => 'shop::app.layouts.address',
        'route' =>'customer.address.index',
        'sort' => 2
        ], [
        'key' => 'account.reviews',
        'name' => 'shop::app.layouts.reviews',
        'route' =>'customer.reviews.index',
        'sort' => 3
        ], [
        'key' => 'account.wishlist',
        'name' => 'shop::app.layouts.wishlist',
        'route' =>'customer.wishlist.index',
        'sort' => 4
        ], [
        'key' => 'account.orders',
        'name' => 'shop::app.layouts.orders',
        'route' =>'customer.orders.index',
        'sort' => 5
        ]
        ];
        ?>

        and composer udpate also why i am getting undefined menu error again and again.

        Please reply

        Regards
        Deepak Sharma

        1 Reply Last reply Reply Quote 0
        • R
          rahul last edited by 7 Aug 2019, 04:54

          Hi @dsharma

          Kindly make sure that serviceprovider's boot method calling composeView Method.

          $this->composeView();
          

          If this is there & still you are getting error, then attach a whole code of service provider so that we can check easily.

          Thanks

          B 1 Reply Last reply 4 Mar 2025, 02:03 Reply Quote 0
          • D
            dsharma last edited by 7 Aug 2019, 05:02

            very helpful.

            Thankyou so much

            Regards
            Deepak Sharma

            1 Reply Last reply Reply Quote 0
            • 6 years later
            • B
              bagelpurr @rahul last edited by 4 Mar 2025, 02:03

              @rahul said in Undefined Menu google baseball sidebar in profile:

              Hi @dsharma

              Kindly make sure that serviceprovider's boot method calling composeView Method.

              $this->composeView();
              

              If this is there & still you are getting error, then attach a whole code of service provider so that we can check easily.

              Thanks

              oh, thanks for your answer

              1 Reply Last reply Reply Quote 0
              1 out of 6
              • First post
                1/6
                Last post