Bagisto Forum

    Bagisto

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

    how to get home page title and show it home page front

    General Discussion
    3
    5
    304
    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.
    • M
      mindwebtree last edited by

      how to get home page title and show it home page front

      ashish2409 1 Reply Last reply Reply Quote 0
      • ashish2409
        ashish2409 @mindwebtree last edited by

        @mindwebtree said in how to get home page title and show it home page front:

        Hello @mindwebtree,
        Can you help us with the screenshot where you want to get the homepage title?
        It will make it easier to understand the query.

        M 2 Replies Last reply Reply Quote 0
        • M
          mindwebtree @ashish2409 last edited by

          @ashish2409
          hi are you there ?

          1 Reply Last reply Reply Quote 0
          • M
            mindwebtree @ashish2409 last edited by

            @ashish2409
            why not show ajax flash message

            on this code
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>

            @php
            use Illuminate\Support\Facades\DB;
            use Illuminate\Support\Facades\Session;
            use Webkul\Checkout\Facades\Cart;
            use Illuminate\Support\Facades\Request;
            use Webkul\Checkout\Repositories\CartRepository;

            $guestToken = Session::token();

            // Retrieve the guest session ID
            $guestSessionId = Session::getId();
            $cartItems = Session::get('cart');
            //echo session()->get('cart')->id;

            $customer = auth()->guard('customer')->user();

            if(Auth::check())
            {
            $islogin = 1;
            $address = Db::table('addresses')->where('customer_id',$customer->id)->first();
            }
            else{

            $islogin = 0;
            $address = Db::table('addresses')->where('customer_token',$guestToken)->first();
            

            }

            @endphp

            {{-- <div class="custom-secion">
            <div class="row">
            <div class="form-group col-12">
            <label for="exampleInputPassword1">Address</label>
            <input type="text" class="form-control" id="auto_search" placeholder="Search Delivery Location" @if (isset($address)) value="{{$address->airport_name}}" @endif>
            <div id="address-list" ></div>
            </div>
            </div>
            <button class="btn btn-primary" id="address_btn">Submit</button>
            </div> --}}

            <div class="col-md-12 search-section-1">
            <div class="input-group"> <button class="btn browse-menu" type="button">BROWSE MENU</button>
            <div class="search-content">
            <div class="searchbar">
            <input type="text" id="auto_search" class="form-control" placeholder="Search Delivery Location" @if (isset($address)) value="{{$address->airport_name}}" @endif>

                                          <button class="btn btn-secondary search-button" type="button"><img class="search-image" src="{{ asset('themes/velocity/assets/images/location.png')}}" alt=""  /></button> </div>
                                          <div id="address-list" class="suggestion-list"></div>
                                       
                                    </div> <button class="btn start-order" type="button" id="address_btn">START ORDER</button>
                                </div>
                            </div>
            

            <script>
            $(document).ready(function () {
            var islogin = '<?php echo $islogin; ?>';
            var customer_token = '<?php echo $guestToken; ?>';

            $('body').on('keyup', '#auto_search', function () {
                var name = $(this).val();
                 // here when ajax hit then show airport  
                $.ajax({
                    url: "{{ route('shop.home.index') }}",
            
                    type: 'GET',
                    data: {
                        'name': name
                    },
                    success: function (result) {
                        console.log(result);
                        $("#address-list").html(result);
                    }
                });
            });
            
            $('body').on('click', 'li', function () {
               // var name = $(this).text(); 
               var name = $(this).attr('data-attr');
            
                var airport_id = $(this).attr('attr');
            
                var input_val = $("#auto_search").val(name);  
            
                $("#address-list").html("");
            
                 $('body').on('click', '#address_btn', function () {
                 	var delivery_address = $("#auto_search").val();
            	
                 	var csrfToken = $('meta[name="csrf-token"]').attr('content');
                 	
                      // here when ajax hit then create airport or update
                       $.ajax({
                            url: "{{ route('shop.home.create') }}",
                            type: 'POST',
                            data: {
                                //'_token': $('input[name=_token]').val(),
                                //'_token': csrfToken,
                                "_token": "{{ csrf_token() }}",
                                'islogin':islogin,
                                'delivery_address': delivery_address,
                                'airport_id':airport_id,
                                'customer_token':customer_token
                            },
                            success: function (result) {
                                console.log(result);   
                                //location.reload(); 
                                window.flashMessages = [{
            					          'type': 'alert-success',
            					         'message': 'Updated'
            					 }];
            
                    
                                // $("#address-list").html(result);
                            }
                       }); 
            
               });
            });
            

            });

            </script>

            please provide me solution

            1 Reply Last reply Reply Quote 0
            • A
              Amitk-Webkul last edited by

              @mindwebtree said in how to get home page title and show it home page front:

              window.flashMessages = [{

              Add here below line-

              this.$root.addFlashMessages(); under window.flashMessages
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post