Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#4857 by tkristis
30 Oct 2017, 14:24
Environment - Linux,
PHP - 7.0.22,
Aimeos - 2017.07,
Laravel - 5.5.19.

I want to hide all products which are in 'list' page and leave just search bar with categories.
Like I understand I need to work with config/shop.php file, but I can't find information how to achieve that what i want.
Any help?
#4859 by aimeos
30 Oct 2017, 14:38
Simply remove the "catalog/lists" part from the page you want this to happen:
https://github.com/aimeos/aimeos-laravel/blob/master/src/config/shop.php#L21

Most probably you want to create a new page. Then, please have a look into these articles:
https://aimeos.org/docs/Laravel#Pages
#4860 by tkristis
30 Oct 2017, 14:54
But if I delete 'catalog/lists' then all products be hidden, even if I open any category.
I want to hide all products just from landing list page, but keep it in categories.
So if I want to do this I need to create a new page or there is another way?
#4873 by tkristis
02 Nov 2017, 12:18
I created controller ProductsController.php
Code: Select all<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ProductsController extends Controller
{
    public function index()
    {
       $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'index' );
        // do some more stuff
        return \View::make('index', $params);
    }
}


config/shop.php
Code: Select all'index' => [ 'catalog/filter' ]


index.blade.view
Code: Select all@extends('app')

@section('content')
    <?= $aibody['catalog/filter'] ?>
@endsection


Route
Code: Select allRoute::get('products', 'ProductsController@index');


So far everything works fine, but page don't have Aimeos css styling and js.
Also categories not showing how many products in it.
Could you help me with that?
#4875 by aimeos
02 Nov 2017, 22:38
Change your Blade template to this:
Code: Select all@extends('base')

@section('aimeos_header')
    <?= $aiheader['catalog/filter'] ?>
@stop

@section('aimeos_nav')
    <?= $aibody['catalog/filter'] ?>
@endsection

The aimeos_header will contain the tags for retrieving the product counts and extending from "base" template will add you Aimeos CSS and JS: https://github.com/aimeos/aimeos-laravel/blob/master/src/views/base.blade.php
#4877 by tkristis
03 Nov 2017, 13:29
Thank you, now it shows how many products in each category.
But problem is that base template can't be found.

Maybe it's because I created index.blade.php template in app/resources/views?
But it must be in app/ vendor/aimeos/aimeos-laravel/src/views ?
#4881 by aimeos
05 Nov 2017, 11:42
That might be the case. Please have a look into the Laravel documentation how it exactly works.