Hi all i have built a e-shop with laravel 4.2 currently i have done product filter which have the pagination with products per page, every thing is works fine other than pagination.
Issue is once the ajax request has been posted then i have click pagination link page 2 the pagination data for $products->links() will be lost,so i need to fetch the $products->links() data to Ajax.
Here my controller call for pagination query:
if(Input::get('ajax')){
$products = $products_query->paginate(Input::get('pagination'));
$this->layout = View::make('layouts.ajax');
$viewfile = 'frontend.categories.ajax_products';
}
Here is my view:
<div class="page-setup">
{{$products->links()}}
</div>
Here is Ajax Call:
var ajax_filter = function(filldata) {
var slug = '{{$available_price_range["slug"] or ''}}';
var fdata = {
ajax: 1,
minprice: 0,
maxprice: '',
search_keyword: $('#search_keyword').val(),
attribute_value_id : ''
}
var data = $.extend({}, fdata, filldata);
//console.log(data)
$.ajax({
url: '{{URL::to('/')}}/category/'+slug,
type: 'post',
data: data,
success: function(resp) {
alert(resp);
$('.fabric_thumb1').html(resp);
$('.page-setup').html();
}
})
}
So i need to get the $products->links() data to the Ajax call Kindly please help me to resolve the issues.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community