how to get home page title and show it home page front
-
how to get home page title and show it home page front
-
@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. -
@ashish2409
hi are you there ? -
@ashish2409
why not show ajax flash messageon 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
-
@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